Plan for Joe Rossi
by Joe Rossi · 11/05/2005 (6:58 pm) · 7 comments
So this is my first plan. Let me start by saying I think this is a great community we have here, lots of smart people, and if everyone can contribute just a little we will end up with a lot. That said I hope to be contributing two things in the near future...
#1 Compressed DDS support.
DDS (DirectDraw Surface) is a compressed texture format that allows graphics cards to deal with texture data in a much more efficient way. Converting a few textures to this format will probably increase the FPS of any hardware accelerated game. Users will need a card that supports the GL_EXT_texture_compression_s3tc extension, but most every card has since circa 2002. Even crappy onboard cards do these days. Anyway this compression is lossy so expect some images to lose quality at higher compression ratios. To compress textures you can use ATI's Compressionator, NVidia DDS Tools, and (maybe?) GIMP's DDS plugin...but I've only tested with ATI's utility and in DirectX DXT mode.
So far I've loaded DXT3 and DXT5 compressed textures. I'll may stop there since those work, I'm not sure if I'll do DXT1. The one challange I have now is making it work in DirectX mode. I probably need to hack the OpenGL2d3d.DLL. I'm not exactly an expert at hacking Torque! So it only works in OGL for now. Don't expect a resource anytime soon. I'd like to make sure it works and is compatible with the new version of T2D before I send it out. This should work for TGE too BTW.
#2 Lua support
I've** managed to create a funky ScriptObject that allows Torque and Lua to get and set each others variables, execute each others scripts and other arbitrary code. This is great for me because I really enjoy coding in Lua and I already built a game logic codebase in Lua for another project.
The benefits of Lua are many, and I feel that Lua can offset any weakness of TorqueScript. Lua has some language features that (I think) TorqueScript is lacking like coroutines, function closures etc, and Lua may handle some things more efficiently. Don't get me wrong, Torque has a nice script language that I'm sure is very efficient for most things. Otherwise I'd have removed it completely. I just think some things can be easier with Lua. It only adds a few hundred KB to the EXE, too! Pretty cool. I plan to use Lua for the bulk of my game logic, TorqueScript for the rest. This could also enable some people to create editors with mostly Lua code.
**Creds to John Vanderbeck for his BasicObject code.
Edit: My Lua bridge code is nearly completed, at least for now. It's based on Lua 5.1 BETA, so I think I'll wait until that version is complete (before the end of the year, they're in code-freeze now I believe...) because this new version seems much better than the previous ones. I don't know what else to add to this. I made an "LUA_DEBUG" flag that will exit Torque gracefully and print errors if you mess up, and you can shut it off for release (if you know there are no mistakes in your scripts!). The main file is <500 lines of code. Maybe I'll make a little demo? Hmm.
Edit2: I've been able to emulate Torque engine calls using Lua tables. Now we can probably access all of TGE/T2D inside Lua scripts! I think I'll need a new plan for that. FYI it looks just like TorqueScript, but without the funny operators and C syntax :D It also takes very little code.
Until next time...
#1 Compressed DDS support.
DDS (DirectDraw Surface) is a compressed texture format that allows graphics cards to deal with texture data in a much more efficient way. Converting a few textures to this format will probably increase the FPS of any hardware accelerated game. Users will need a card that supports the GL_EXT_texture_compression_s3tc extension, but most every card has since circa 2002. Even crappy onboard cards do these days. Anyway this compression is lossy so expect some images to lose quality at higher compression ratios. To compress textures you can use ATI's Compressionator, NVidia DDS Tools, and (maybe?) GIMP's DDS plugin...but I've only tested with ATI's utility and in DirectX DXT mode.
So far I've loaded DXT3 and DXT5 compressed textures. I'll may stop there since those work, I'm not sure if I'll do DXT1. The one challange I have now is making it work in DirectX mode. I probably need to hack the OpenGL2d3d.DLL. I'm not exactly an expert at hacking Torque! So it only works in OGL for now. Don't expect a resource anytime soon. I'd like to make sure it works and is compatible with the new version of T2D before I send it out. This should work for TGE too BTW.
#2 Lua support
I've** managed to create a funky ScriptObject that allows Torque and Lua to get and set each others variables, execute each others scripts and other arbitrary code. This is great for me because I really enjoy coding in Lua and I already built a game logic codebase in Lua for another project.
The benefits of Lua are many, and I feel that Lua can offset any weakness of TorqueScript. Lua has some language features that (I think) TorqueScript is lacking like coroutines, function closures etc, and Lua may handle some things more efficiently. Don't get me wrong, Torque has a nice script language that I'm sure is very efficient for most things. Otherwise I'd have removed it completely. I just think some things can be easier with Lua. It only adds a few hundred KB to the EXE, too! Pretty cool. I plan to use Lua for the bulk of my game logic, TorqueScript for the rest. This could also enable some people to create editors with mostly Lua code.
**Creds to John Vanderbeck for his BasicObject code.
Edit: My Lua bridge code is nearly completed, at least for now. It's based on Lua 5.1 BETA, so I think I'll wait until that version is complete (before the end of the year, they're in code-freeze now I believe...) because this new version seems much better than the previous ones. I don't know what else to add to this. I made an "LUA_DEBUG" flag that will exit Torque gracefully and print errors if you mess up, and you can shut it off for release (if you know there are no mistakes in your scripts!). The main file is <500 lines of code. Maybe I'll make a little demo? Hmm.
Edit2: I've been able to emulate Torque engine calls using Lua tables. Now we can probably access all of TGE/T2D inside Lua scripts! I think I'll need a new plan for that. FYI it looks just like TorqueScript, but without the funny operators and C syntax :D It also takes very little code.
Until next time...
About the author
#2
Theres a link to the bounty list in the TSE forum.
11/05/2005 (8:02 pm)
If you own a copy of TSE, theres a pretty good bounty for "Implement full .DDS file loading support"Theres a link to the bounty list in the TSE forum.
#3
11/06/2005 (12:40 pm)
Hmm that sounds good, but I don't own TSE... just T2D. So I don't know if I'd be eligible for this bounty... :( How much are we talking anyway? Is anyone else working on this? I can't access that forum so I had no idea it was even "wanted".
#4
11/07/2005 (3:23 am)
I don't think I can post how much it is... but it's a more than what TSE and TGE would cost to buy.
#5
11/07/2005 (11:29 am)
I'd like the details, but I'm not planning to make a 3D game just yet and right now I really can't afford to buy TGE+TSE for a chance at claiming the bounty. If someone's going to take my code and get paid directly from it I'm kind of reluctant to post it. I still may, but .DDS just took a backseat to my Lua work :/
#6
01/25/2006 (8:40 pm)
i'd be interesting in seeing your lua bindings
#7
i need to use Con::executef(); function in my opengles proj
12/31/2009 (6:41 am)
how to use navigation controller functionality in opengles proj ori need to use Con::executef(); function in my opengles proj
Torque Owner Adrian Tysoe