Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Team Fortress 2 in WebGL (tojicode.com)
116 points by DanielRibeiro on Oct 6, 2011 | hide | past | favorite | 34 comments


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 :)


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.


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.


Therefore, a port of the original Portal to the web would be more feasible than a port of Team Fortress 2.


WebGL developer is credit to team!


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


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?


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.


Full screen is F11. It almost covers the mouse problem, too.


It doesn't cover the mouse problem for one simple reason: acceleration. Sure, I can tell when the pointer is on the border to my user-fullscreened window (I even have code to make sure that the user is fullscreened), but you suddenly lose track of acceleration. Since you can't grab and hide the cursor and just track raw movement deltas, you can't implement your own acceleration. That makes it impossible to do good mouse grab with current facilities.


I'm surprised you aren't already aware of this: the mouse lock API is being worked on in the W3C WebApps and Web Events working groups. Implementations in Chrome/Webkit and Firefox very soon, hopefully.

http://www.w3.org/2010/webevents/charter/2011/Overview.html#...


I'm aware of it, but it's just not there yet. It's very early stage -- just last month there were arguments about how to handle permissions around this even. It's at least 6 months from being mainline, if not longer.


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..


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.


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.


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?


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


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?


Yeah there are much better ways to optimize this, check out http://www.sunsetlakesoftware.com/2011/05/08/enhancing-molec...

This technique should work for WebGL too.


Where did the source code of the engine come from?


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


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...


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


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...

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!


> 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. ;)


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.


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.


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?


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.


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


If you haven't played for more than a few minutes, you really should try TF2. Besides being free- The cartoonish style will cease to matter completely in an hour or two, the children can be muted in 2 clicks, and there aren't any memes. (though some hats are a little silly, some weapon names are punny, and some taunts are also puns. Example: "Your Eternal Reward", a Spy knife. Example: "I will kill you with bear hands!", Heavy, equipped with Warrior's Spirit http://wiki.teamfortress.com/wiki/Warriors_Spirit)

Oh, also, don't play 2Fort, and turn off sprays. Options -> Multiplayer -> Do not download any custom files.

It takes a little while to get competent, but it really is a pretty good game, and twitch-reflexes are not important for anybody but scout and perhaps sniper.


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

EMP Grenades.


Ok, nothing with EMP in TF2 except for some anti-sticky bomb weapon the Engineer use. Looking for TF EMP grenade in Youtube gave me videos of jumpers. You know the demo man can do all that and probably more?

How about Jarate? http://www.planetcalypsoforum.com/gallery/showimage.php?i=19...

It's a jar of spit and piss that makes the lives miserable for the enemies.

http://videogamesrepublic.com/wp-content/uploads/2009/05/jar...


Ahem. TFC is a HL mod. The original TF is a Quake mod.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: