Game Development Community

TGB/TGEA integration first pass

by Prairie Games · 11/27/2007 (7:14 pm) · 15 comments

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

www.prairiegames.com/tgbtgea.jpg
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

#1
11/27/2007 (7:24 pm)
very rad, josh. :)
#2
11/27/2007 (8:59 pm)
Oy, that was fast. Thanks for keeping us posted, love to see when you do this kind of thing.
#3
11/27/2007 (9:36 pm)
@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 :)
#4
11/27/2007 (9:39 pm)
So... will this be able to apply a shader material to a 2d art object?
#5
11/28/2007 (3:38 am)
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.
#6
11/28/2007 (10:00 am)
Now that is just cool.
#7
11/28/2007 (4:40 pm)
Wow, that's awesome. Fantastic work as always!
#8
11/28/2007 (4:52 pm)
That's pretty cool.
#9
11/28/2007 (8:10 pm)
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 :)
#10
11/28/2007 (8:20 pm)
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.
#11
11/30/2007 (5:45 am)
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
#12
11/30/2007 (6:41 am)
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.
#13
12/10/2007 (6:10 pm)
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.
#14
12/10/2007 (7:14 pm)
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?
#15
01/27/2009 (8:03 pm)
wrong thread