
Team Fortress 2 in WebGL - DanielRibeiro
http://blog.tojicode.com/2011/10/source-engine-levels-in-webgl-video.html
======
JL2010
Minor remark about the headline: This appears to be a TF2 map loaded into a
minimal Source Engine WebGL port as an example. TF2 itself was not ported,
just enough of the Source Engine components to load a map - he could've used a
map file from just about any Source Engine powered game.

Awesome project :)

~~~
Produce
Technically this is not a port. It's just an OpenGL application that can read
and render the TF2 map format. A port would consist of modifying the original
source (which I assume the author does not have access to, since it's a closed
source product) so that it runs on a different platform.

~~~
JL2010
Fair distinction. Half-Life 2 SDK open sources a decent amount of code. Take a
look at his source code, a lot of it is a re-implementation of Valve's map and
model data structures in Javascript with similar naming convention. Hence why
I called it a "minimal port" or "ported just enough components" to load a map.

------
jeffreymcmanus
WebGL developer is credit to team!

------
daeken
Now we just need fullscreen and mouse grab support. Without those, first-
person gaming in the browser is effectively impossible.

~~~
alexhaefner
Actually, I think those problems will be solved before audio. Audio is in a
terrible state with the web. We need a good 3D sound API. Flash? Ugh. Write
the entire app in WebGL/JS/html and then go to flash?

~~~
daeken
Have you played with the experimental sound API in Chrome? It's not perfect
(latency is an issue for sure) but it's much, much better than what's out
there otherwise. The Mozilla audio API is decent, but doesn't do 3d AFAIK.

------
pavelkaroukin
So.. It looks like we are going to direction, where browsers will be used to
play action games in (probably, not really near) future.. Same direction
mobile development..

~~~
rorrr
I've been playing this action game for a while:

<http://www.nplay.com/BeGone/>

They update it around once week, the maps and the code.

~~~
pavelkaroukin
Yeah. And that's where it moves - centralized hosting, with ability to quickly
iterate through in-game and software changes. With ability to access it from
(in future) any browser. I definitely like it.

------
hugh3
OK folks, anyone know much about WebGL?

For my work, I'd be very interested in something that can do a decent job of
rendering atomic structures in a ball-and-stick view. Say, hundreds of balls
and a similar number of sticks. Is this within the capabilities of WebGL?

~~~
nkassis
You can check <http://www.chemdoodle.com/> under webcomponent. That might be
what you are looking for.

~~~
hugh3
That has some features along the right lines, but I see that the 3D modelling
bits really slow down when given more than twenty atoms to draw. Is that a
limit of WebGL, or could I get better performance out by using lesser
shading... or something?

Come to think of it, is this even WebGL?

~~~
nkassis
Yeah there are much better ways to optimize this, check out
[http://www.sunsetlakesoftware.com/2011/05/08/enhancing-
molec...](http://www.sunsetlakesoftware.com/2011/05/08/enhancing-molecules-
using-opengl-es-20)

This technique should work for WebGL too.

------
FrojoS
Where did the source code of the engine come from?

~~~
vogonj
the engine doesn't exist. this is just a renderer for Source maps.

edit: and here's the source for the renderer: <https://github.com/toji/webgl-
source>

~~~
magicalist
The author also gave a good break down of the map file format and the approach
he took to rendering it in a previous post:

[http://blog.tojicode.com/2011/09/source-engine-in-webgl-
tech...](http://blog.tojicode.com/2011/09/source-engine-in-webgl-tech-
talk.html)

------
kingkawn
Would rather have the original teamfortress, it was a lot more fun and would
allow me to indulge nostalgia more easily

~~~
Flow
I've only started Team Fortress Classic a few times. It feels really outdated.
That said, how can that old game be more fun that TF2? TF2 is shock full of
funny sounds, signs, taunts and so on!

Watch Meet the Sniper: <http://www.youtube.com/watch?v=PyNuriXG3BQ> or Meet
the Demo Man: [http://www.youtube.com/watch?v=rxps--
huGKY&feature=relmf...](http://www.youtube.com/watch?v=rxps--
huGKY&feature=relmfu)

Listen to some of the Demo Man sounds:
<http://wiki.teamfortress.com/wiki/Demoman_responses> . The game is really
well done, you have funny characters to pick from.

\- Demo Man - One-eyed drunk cyclops who is a black scottish patriot.

\- Sniper - Talks like Michael Caine did in the 60's. Throws "jarate" at
people.

\- Engineer - Texas redneck with tech know-how.

and more...

I really love TF2 and play it a lot, so should you!

~~~
coderdude
> I've only started Team Fortress Classic a few times. It feels really
> outdated.

Well yeah, it's an old game. It is by definition outdated (even has "classic"
in the title).

> That said, how can that old game be more fun that TF2?

I'm guessing you're a pretty young guy. How fun a game is does not depend on
when it was released. I used to love playing TFC. TF2 is a lame cartoon game
to me. It's a bunch of Reddit memes to me. It's 15 year old kids yelling over
microphones to me.

TFC forever. ;)

~~~
Flow
No, I'm 40-ish. I grew up with VIC-20 and C64 being state of the art in home
computing. I both played games and programmed stuff. I still do but on
computers a zillion times faster.

I never liked games that try to be realistic, what's the point, trying to make
me sleep bad because of gory headshots with blood everywhere?

So I prefer the semi-cartoonish style and hats. Several times every evening I
laugh out loud because of the silliness in TF2. Give it a try. It's not easy
because it's not realistic, but you can always go medic and follow better
players till you know the maps.

~~~
coderdude
Ahh I just assumed. I hear that from my younger brother a lot. He can't play
any old games because "there's not enough twitch factor" and the "graphics
suck." I've played it a few times, just wasn't for me.

~~~
Flow
Oh no, you're talking to someone who played HaloPC from summer 2004 to january
2010 and then gave up because of cheaters and lag.

Which games do you play these days?

~~~
coderdude
Right on. I'm a die-hard Left4Dead2 addict. I play almost nothing else
anymore. Even then, I only play a little bit on the weekends. Not enough time
anymore to really enjoy a game. It has to be something I can dip in and out of
in bursts.

~~~
Flow
Single-game guy like me then :) I only play TF2 and some indie-games. Often
it's either TF2 or doing something else.

