Torque2D Emscripten port sourcecode released
by James Urquhart · 01/23/2014 (3:44 pm) · 11 comments
Last month I unveiled a port of Torque2D which runs in web browsers via emscripten. It was developed largely over a period of a couple or weeks with the help of a few emscripten developers along the way.
After the unveil it generated some interest, but not really enough for me to make a product or anything commercial out of it especially given the current trend for game development engine tech: release everything for free.
Considering this, I've decided to release the code for the emscripten port under the same lovely MIT license as Torque2D itself. I hope someone can find it useful, perhaps to help promote their Torque2D game. Or who knows, maybe they can release a web-based browser game for it! The way web browsers are heading, I guess anything can happen!
The code is available on github. Enjoy!
After the unveil it generated some interest, but not really enough for me to make a product or anything commercial out of it especially given the current trend for game development engine tech: release everything for free.
Considering this, I've decided to release the code for the emscripten port under the same lovely MIT license as Torque2D itself. I hope someone can find it useful, perhaps to help promote their Torque2D game. Or who knows, maybe they can release a web-based browser game for it! The way web browsers are heading, I guess anything can happen!
The code is available on github. Enjoy!
About the author
#2
An amazing contribution, I hope to snoop around to see what I learn.
2 big announcements for T2D in less than 1 hour ... T3D is dying of envy :(
01/23/2014 (4:07 pm)
@James, You are one of the great!!! It would be very difficult to do something similar in the near future for T3D?An amazing contribution, I hope to snoop around to see what I learn.
2 big announcements for T2D in less than 1 hour ... T3D is dying of envy :(
#3
01/23/2014 (9:48 pm)
Extremely cool. Thank you so much for the MIT release of your code. I probably won't get a chance to look at this in detail until after T2D 3.0 is out the door, but it is definitely something to look forward to.
#4
01/23/2014 (10:18 pm)
I'm not sure if that first link is what you meant. Nevertheless, this is an awesome announcement, and thanks very much for releasing the code! If only I could squeeze some extra hours in the week to play with this...
#5
Thanks guys! It's great to hear this work is appreciated. :)
@Luis
For me the big problem with T3D is there is a lot of "baggage", especially in terms of the rendering. In order to do an emscripten port you'd essentially have to create a new renderer for WebGL / GL ES 2.0 and redo a lot of the shader code. I'm not exactly sure which shader version webgl uses, so it may or may not be as bad as I think. Still, a lot of work.
For T2D I lucked out as emscripten includes emulation for OpenGL 1.x, though it wouldn't have been too much extra work getting it to work without as T2D doesn't do anything too complicated. The only exception is the clip planes in the scroller component which unfortunately I had to disable as there is currently no equivalent functionality in webgl that I know of.
@Daniel
Whoops! Fixed it ;)
01/24/2014 (1:52 am)
@Michael, MikeThanks guys! It's great to hear this work is appreciated. :)
@Luis
For me the big problem with T3D is there is a lot of "baggage", especially in terms of the rendering. In order to do an emscripten port you'd essentially have to create a new renderer for WebGL / GL ES 2.0 and redo a lot of the shader code. I'm not exactly sure which shader version webgl uses, so it may or may not be as bad as I think. Still, a lot of work.
For T2D I lucked out as emscripten includes emulation for OpenGL 1.x, though it wouldn't have been too much extra work getting it to work without as T2D doesn't do anything too complicated. The only exception is the clip planes in the scroller component which unfortunately I had to disable as there is currently no equivalent functionality in webgl that I know of.
@Daniel
Whoops! Fixed it ;)
#6
Well, they managed to get Unreal working in firefox, so I don't see why you couldn't in theory do the same for T3D. If you had the time and money and knowhow :P.
I just tried out your port of the truck demo - so impressive. I'd really love to have a go at a game using this pipeline. My goodness. Too many projects, too little time. How does emscripten handle TorqueScript? I guess it compiles the compiler and things are really meta?
01/24/2014 (2:54 am)
Nearly there ;)Well, they managed to get Unreal working in firefox, so I don't see why you couldn't in theory do the same for T3D. If you had the time and money and knowhow :P.
I just tried out your port of the truck demo - so impressive. I'd really love to have a go at a game using this pipeline. My goodness. Too many projects, too little time. How does emscripten handle TorqueScript? I guess it compiles the compiler and things are really meta?
#7
01/24/2014 (3:33 am)
OpengGL ES 2.0 are in my T3D roadmap for support iOS and Android.
#8
TorqueScript works exactly the same, apart from an issue with the compiler which I had to work around.
@Luis,
Good to hear!
01/24/2014 (4:06 am)
@Daniel,TorqueScript works exactly the same, apart from an issue with the compiler which I had to work around.
@Luis,
Good to hear!
#9
01/25/2014 (1:30 pm)
What an incredible contribution to the community, thank you James!
#10
You are a god among developers! :D
A very awesome contribution to the torque 2D community!
01/25/2014 (7:37 pm)
@James - You are a god among developers! :D
A very awesome contribution to the torque 2D community!
#11
01/26/2014 (6:37 am)
Contributions like this and the Linux port from Frogger are what open source development is all about. You guys learned something, which is great for personal growth. The community benefits from the features for their own work. All around, good stuff. 
Employee Michael Perry
ZombieShortbus