Previous Blog Next Blog
Prev/Next Blog
by date

TGB/TGEA integration first pass

TGB/TGEA integration first pass
Name:Prairie Games
Date Posted:Nov 28, 2007
Rating:4.0 out of 5
Public:YES
Comments:YES
RSS Feed:GarageGames Blog feedor Subscribe with .
Profile Page:View profile page for Prairie Games

Blog post
I got the first pass at TGB/TGEA integration completed. TGB/TGEA are running in the same process rendering to the same window... I can already tell how cool this is going to be :)

There's still a fair bit of work to do... Tomorrow I should be able to get the rendering cleaned up a bit and hopefully get the input working. I am going with TGB as the platform layer... since it is a little more complicated and it would be harder to get what it needs into the TGEA platform...



This is the actual Python script... though, it is a bit of a gross simplification of what is actually going on. :)


#Torque Game Builder
from pytgb.engine import TGBInitialize, TGBShutdown
from pytgb.engine import Game as tgbGame

#Torque Game Engine Advanced
from pytgea.engine import TGEAInitialize, TGEAShutdown
from pytgea.engine import Game as tgeaGame

TGBInitialize()
TGEAInitialize()

while tgbGame.isRunning():
tgbGame.tick()
tgeaGame.tick()

TGEAShutdown()
TGBShutdown()


-JE

Recent Blog Posts
List:03/29/08 - TGEA 1.7 Build System and Embedded Python
03/14/08 - MegaTerrains - TGEA Update
01/18/08 - Minions of Mirth: Undead Wars Expansion
01/04/08 - Physics Overhaul - Video
12/26/07 - Web Integration - Video
12/21/07 - New MMO Client - Trees - Day/Night Video
12/18/07 - Minions of Mirth - 1.26 - Holiday Edition!
11/28/07 - TGB/TGEA integration first pass

Submit ResourceSubmit your own resources!

Adam deGrandis   (Nov 28, 2007 at 03:24 GMT)
very rad, josh. :)

Dave Young   (Nov 28, 2007 at 04:59 GMT)
Oy, that was fast. Thanks for keeping us posted, love to see when you do this kind of thing.

Prairie Games   (Nov 28, 2007 at 05:36 GMT)
@Dave: I've done similar stuff a few times now. The rendering/platform stuff being integrated isn't too bad. I'm still considering workflow... pretty sure that TGEA world editing will be another option, like the GUI Builder in TGB... it helps working with great components :)

Vashner   (Nov 28, 2007 at 05:39 GMT)
So... will this be able to apply a shader material to a 2d art object?

Prairie Games   (Nov 28, 2007 at 11:38 GMT)
Sure, it'll also support multiple 3d windows.. The TGEA tick will just update the sim/network and the actual rendering will be handled by a TGB window calling into TGEA setting its viewport.

Rubes   (Nov 28, 2007 at 18:00 GMT)
Now that is just cool.

Johnathon   (Nov 29, 2007 at 00:40 GMT)
Wow, that's awesome. Fantastic work as always!

Mike Rowley   (Nov 29, 2007 at 00:52 GMT)
That's pretty cool.

Prairie Games   (Nov 29, 2007 at 04:10 GMT)
Made some good progress on this today. Derived a TGEAWindow class in Python and was able to hook up input and stuff. It's pretty cool... the TGEA is just running the simulation stuff now... and the rendering actually happens in TGB's main loop when drawing the TGEAWindow control. I also exposed the GFXDevice class to Python and that's neat to play with too :)

Johnathon   (Nov 29, 2007 at 04:20 GMT)
I here I was happy I figured out how to click on 2D objects with the mouse LOL. Looking forward to reading about your progress.

Daniel Staub   (Nov 30, 2007 at 13:45 GMT)
RE: your last plan

I'm lost.

Correct me where I am wrong but this is how I translated your .plan;

GCC-XML -> Custom C++ bit -> pygccxml -> SIP gives Python access to all the TGB and TGEA goodness.

Would this allow you to use 100% Python to write TGB and TGEA based games?

Sammual

Prairie Games   (Nov 30, 2007 at 14:41 GMT)
GCC-XML -> pygccxml -> Custom SIP interface generating Python script with a little bit of C++ -> SIP -> Compiler = pytgb and pytgea

This'll allow us to write most of our code in Python. C++ is used where speed is critical and/or an interface is hard to derive... TorqueScript is not used for new code, though we modify it where there is already significant amounts of TorqueScript code.

The next update on this stuff should be pretty interesting... I'll definitely post some example of deriving from GuiControl directly in script... and using GFXDevice, etc... it is really powerful stuff.

Chaim Krause   (Dec 11, 2007 at 02:10 GMT)
Josh, I would very much love to move from TorqueScript to pure Python code. How can I/we get our hands on this? I'm not familiar enough with C++ to do this on my own, but I can apply a diff/patch if that's all it takes. How do I get started? I'll never catch you, but I would like to be able to use what you have built.

Johnathon   (Dec 11, 2007 at 03:14 GMT)
Just curious, how come the TGEA window has mac window titlebar buttons, and the TGB has windows? Is that a feature of TGEA or are they two different screens?

You must be a member and be logged in to either append comments or rate this resource.