T2D meets TGE
by David Barr · in Torque Game Builder · 05/04/2005 (11:12 am) · 29 replies
This afternoon, while messing about with a dynamic texture object (from 1.4 Torque) I was having trouble deciding what i wanted to do with the thing. It then struck me that it would open up all sorts of possibilities if you could get a T2D game actually inside a Torque game in 3D rather than overlayed on top in 2D.
So, an hour or so later, I now have a playable version of the T2D spaceshooter demo running inside a Torque game :)
Have a look at the little video below to get an idea of what you can do with an fxRenderObject, a DynamicTexture and T2D.
Its recorded with FRAPS so the background looks a little jerky but it is fine in game.
www.vhp.co.uk/T2D_meets_TGE.zip
Encoded in mpeg (plays in windows media player) and 5.2MB
So, an hour or so later, I now have a playable version of the T2D spaceshooter demo running inside a Torque game :)
Have a look at the little video below to get an idea of what you can do with an fxRenderObject, a DynamicTexture and T2D.
Its recorded with FRAPS so the background looks a little jerky but it is fine in game.
www.vhp.co.uk/T2D_meets_TGE.zip
Encoded in mpeg (plays in windows media player) and 5.2MB
#2
The possibilities here are endless. You should definately post this as a T2D and TGE resource!
Great work David.
- Melv.
05/04/2005 (11:42 am)
Very cool. :)The possibilities here are endless. You should definately post this as a T2D and TGE resource!
Great work David.
- Melv.
#3
definately! :) You would definately have my grattitude for a resource forewarning any pitfalls!
05/04/2005 (11:45 am)
Quote:You should definately post this as a T2D and TGE resource!
definately! :) You would definately have my grattitude for a resource forewarning any pitfalls!
#4
05/04/2005 (12:02 pm)
Very nice. I can see t2d been used for interactive computer terminals ala doom3 and thats just the obvious uses :)
#5
05/04/2005 (12:06 pm)
Well that just rocks. :)
#6
05/04/2005 (12:28 pm)
I dont do a lot of posting on the T2D forums (yeah I know its bad of me) but that requires a "Kick ass!" to be said ;)
#7
05/04/2005 (12:35 pm)
A game within a game - whats next!:) This has got to be amazing!:)
#9
05/04/2005 (1:19 pm)
I will post a resource when I have tidied things up a bit - its not exactly what you would call neatly integrated at the moment but it is great fun in the game :)
#10
David, nice job, you did it first! :)
Randy, T2D + TSE would be very cool too, yep....
05/04/2005 (10:53 pm)
Yeah, this is awesome. When Pat was working on this dynamic texture stuff, we were all talking about around his computer and someone literally said "man, I can't wait until someone in the community uses T2D with this."David, nice job, you did it first! :)
Randy, T2D + TSE would be very cool too, yep....
#11
05/05/2005 (7:51 am)
Does this mean we can do the cool 'interactive computer panels' like they have in Doom 3 now?
#12
@David: great work (lol while my imagination was going wild I for got to say that ;)!
btw any comments on working with the early version of TGE 1.4 ? I have an idea I want to use this combination for, so was curious how stable it has been working with it ?
05/05/2005 (8:14 am)
@Joshua: that would be very cool... the T2D Gui Creator I'm working on will make creating those type of panels a snap...@David: great work (lol while my imagination was going wild I for got to say that ;)!
btw any comments on working with the early version of TGE 1.4 ? I have an idea I want to use this combination for, so was curious how stable it has been working with it ?
#13
excellent work! so many possible applications for that! a hacker game would be fun based on terminals.
05/05/2005 (8:32 am)
Amazing! excellent work! so many possible applications for that! a hacker game would be fun based on terminals.
#14
05/05/2005 (11:12 am)
@ Matthew - I used the code for DynamicTextures from 1.4 in a modified 1.3 build. Apart from reading through the code, I havent really used 1.4 much at all yet.
#15
I plan to do an Arcade 3D game with T2D windows on the machines, of course I can only have it renderToTexture the windows that are visible (otherwise it might get way too bogged down).
05/14/2005 (3:36 pm)
Thanks for letting me know that! Got it up and running in a night and a morning, thx to you doing it and telling me what you used lol, otherwise this could've been a lot more messy trying to do. Haven't done widescale tests on it, wonder how many T2D windows it would run with.I plan to do an Arcade 3D game with T2D windows on the machines, of course I can only have it renderToTexture the windows that are visible (otherwise it might get way too bogged down).
#16
I was thinking about multiple T2D windows rendering and wondered whether having several T2D windows as children of a GUIControl would work so you would have one call to the parent control to render all its children and then use the texture coords to get the right bit of the texture for each seperate T2D 'console'. You could then have different groups of parent controls to render (or not) depending where you were looking (or even in what room). If it works then it should cut down some of the render to texture overhead with multiple controls. Choosing the correct T2D console to send your key presses to should be fun as well :)
Interestingly, I have noticed that I only get a 1 or 2 fps drop due to the control rendering in the background - the main drop is due to T2D running (whether its visible or not) - even then its only about 10-15 fps out of 200 :) probably due to the extra processing needed so that may be more of a limiting factor than the texture rendering in a multiple arcade game.
05/15/2005 (2:45 am)
Matthew - glad to hear you got it working - sorry I didnt get round to writing anything up about it - where does time go?I was thinking about multiple T2D windows rendering and wondered whether having several T2D windows as children of a GUIControl would work so you would have one call to the parent control to render all its children and then use the texture coords to get the right bit of the texture for each seperate T2D 'console'. You could then have different groups of parent controls to render (or not) depending where you were looking (or even in what room). If it works then it should cut down some of the render to texture overhead with multiple controls. Choosing the correct T2D console to send your key presses to should be fun as well :)
Interestingly, I have noticed that I only get a 1 or 2 fps drop due to the control rendering in the background - the main drop is due to T2D running (whether its visible or not) - even then its only about 10-15 fps out of 200 :) probably due to the extra processing needed so that may be more of a limiting factor than the texture rendering in a multiple arcade game.
#17
I'd love to see some kind of multiple-window arcade system running with T2D.
- Melv.
05/15/2005 (3:50 am)
@David: One thing you can do is issue a "setScenePause()" command to any scenes you're not displaying or you want to halt. This should remove practically all processing overhead.I'd love to see some kind of multiple-window arcade system running with T2D.
- Melv.
#18
05/15/2005 (4:00 am)
@Melv - Thanks for the pointer - I am going to try and find a little time this week to do some more with this (the only 'free' time I seem to have is when I am asleep at the moment).
#19
My results concur with yours on it not effecting FPS much, though in my case I would probably have 10+ T2D scenes (even when I put the "PlayGui" in the texture and had an infinite mirror effect it didn't effect the FPS as much as I would've thought)...
thx for that pointer Melv, that reallly will end up helping. I was also thinking of having a switchout T2D scene that did a simple 4-5 screen animation (like a start up screen, "Press Start" for consoles, "Insert Coins" for arcade machines) for the machines before you play them (even considered TSE and animated textures, but then again T2D and TSE might be way over my head lol).
@David: have you started on any tutorials/documentation, if not I would gladly do the tutorial end :) Giving credit to you for the initial idea and passing on the objects used.
@Melv: That fxRenderObject is great! Glad I caught it, even if late, the documentation you put in that at the start is really beneficial.
05/15/2005 (8:45 pm)
Np, I know how busy things can get, thanks for directing me in the right direction. In fact I really ended up learning a great deal from the process so in the end it was better doing it myself.My results concur with yours on it not effecting FPS much, though in my case I would probably have 10+ T2D scenes (even when I put the "PlayGui" in the texture and had an infinite mirror effect it didn't effect the FPS as much as I would've thought)...
thx for that pointer Melv, that reallly will end up helping. I was also thinking of having a switchout T2D scene that did a simple 4-5 screen animation (like a start up screen, "Press Start" for consoles, "Insert Coins" for arcade machines) for the machines before you play them (even considered TSE and animated textures, but then again T2D and TSE might be way over my head lol).
@David: have you started on any tutorials/documentation, if not I would gladly do the tutorial end :) Giving credit to you for the initial idea and passing on the objects used.
@Melv: That fxRenderObject is great! Glad I caught it, even if late, the documentation you put in that at the start is really beneficial.
#20
Playgui was actually the first thing I tested when I was tinkering with the code - the infinite mirror effect is quite pretty.
I did a few experiments with frameskipping which could possibly apply more in your scenario with multiple scenes. Depending on the size of the final displays you can quite easily drop the T2D texture update to every other frame or every third frame of your playgui window without making the motion of the T2D scene noticeably jerky. I did this by still calling the background render but not doing the actual texture grab (you start to get key press misses if you are not careful how you do it). Perhaps you could have a variable update rate depending how visible your little consoles were in the scene giving every frame to the main one but only 1 in 3 to the secondary ones.
Another thought I had would be to have only one T2D scene running the "Insert Coin, Press Start" routine and switch all the non active consoles to this one texture which would reduce your T2D overhead (the other scenes being in pause).
05/16/2005 (8:42 am)
@Matthew - feel free to write it up - having seen your tutorials I know you will do a much better job than I could - :)Playgui was actually the first thing I tested when I was tinkering with the code - the infinite mirror effect is quite pretty.
I did a few experiments with frameskipping which could possibly apply more in your scenario with multiple scenes. Depending on the size of the final displays you can quite easily drop the T2D texture update to every other frame or every third frame of your playgui window without making the motion of the T2D scene noticeably jerky. I did this by still calling the background render but not doing the actual texture grab (you start to get key press misses if you are not careful how you do it). Perhaps you could have a variable update rate depending how visible your little consoles were in the scene giving every frame to the main one but only 1 in 3 to the secondary ones.
Another thought I had would be to have only one T2D scene running the "Insert Coin, Press Start" routine and switch all the non active consoles to this one texture which would reduce your T2D overhead (the other scenes being in pause).
Torque 3D Owner Matthew Langley
Torque
will definately have to check that combination out! :)