More then one scenegraph?
by Tyler Slabinski · in Torque Game Builder · 07/30/2009 (7:51 pm) · 16 replies
These aren't urgent questions, since I am not using them for my game... But they are questions that has been bothering me for a while.
1. What is the point of multiple scenegraphs?
2. How do you make more then one scenegraph?
3. If there is no point to multiple scenegraphs, then why do we need to tell something what each scenegraph it should load into... Like we need to do something like this:
1. What is the point of multiple scenegraphs?
2. How do you make more then one scenegraph?
3. If there is no point to multiple scenegraphs, then why do we need to tell something what each scenegraph it should load into... Like we need to do something like this:
%this = new t2dSceneObject() {
scenegraph = SceneWindow2D.getSceneGraph();
};
#2
Can also be useful if you want to split screen a game or set up a minimap etc.
07/31/2009 (5:58 am)
I use multiple scenegraphs because after wrestling (and succeeding in wrestling it into submission) with the GUI implementation that TGB offers, I finally threw up my hands and decided that I would rather script my own from scratch. Little things like the GuiTextObjects only being able to display one line at a time threw me over the deep end.Can also be useful if you want to split screen a game or set up a minimap etc.
#3
basically, i use multiple scene graphs right now, to replace the GUI with animated buttons, icons and shit... i found the default GUI way to static and limiting, and with this other method, theres quite a lot of flexibility... but there are also some hurdles to jump on.
07/31/2009 (10:54 am)
what eric said.basically, i use multiple scene graphs right now, to replace the GUI with animated buttons, icons and shit... i found the default GUI way to static and limiting, and with this other method, theres quite a lot of flexibility... but there are also some hurdles to jump on.
#4
For that, I use multiple scene windows as well. I define the scene windows in the gui and load scene graphs into each window as needed.
08/05/2009 (1:36 pm)
I use a second scene graph for backgrounds. I can have all sorts of particle effects back there without interfering with the forground. I can also load different levels without interrupting the background. And, I have my own GUI system that I use in a foreground window.For that, I use multiple scene windows as well. I define the scene windows in the gui and load scene graphs into each window as needed.
#5
thats a nice approach, but it doesnt work with every game design... at least, it wouldnt work with the 2 games i recently made.
08/05/2009 (2:59 pm)
@Nikos:thats a nice approach, but it doesnt work with every game design... at least, it wouldnt work with the 2 games i recently made.
#6
08/05/2009 (4:02 pm)
Could the multiple scenegraphs be used for level streaming? The player would exist in 01.t2d and hit a trigger which would load 02.t2d in another scenegraph. Perhaps at some later point, the player-character would hit another trigger that would transfer him into that other scenegraph. ...Maybe?
#7
08/05/2009 (9:12 pm)
i think its possible (playing with the cameras of every scenewindow and all that, could give you awesome results)... but you must have your design ideas pretty clear, and the implentation must be flawless, cuz the way i see it, can be a lil troublesome... maybe im wrong.
#8
08/06/2009 (6:28 am)
I started playing with this last night for level streaming. I think it'll work. But you're right. It'll take a little time and thought to get right.
#9
08/06/2009 (8:46 am)
i'd like to see your idea in action... in my designs i dont really need level streaming now (i go with the classic design, you completed all the objectives, you access a new level), so i cant really imagine it in action and all that, but i know its gotta be cool.
#10
08/09/2009 (3:51 pm)
So when using multiple t2dSceneWindows for GUI, how do you control what renders on top of what, which gets mouse clicks, etc?
#11
lets hope that in the next version, that topic is actually covered, cuz its not really clear in the docs how can you achieve that.
08/09/2009 (6:07 pm)
i've really no idea... thats why, to prevent exactly THAT to happen, or to affect my design, i usually put the one with mouse interaction ontop of everything else (by calling it last)...lets hope that in the next version, that topic is actually covered, cuz its not really clear in the docs how can you achieve that.
#12
For for render order, that's simply a matter of ordering the t2dSceneWindows. The ones further down the list are rendered on top.
08/09/2009 (6:43 pm)
While I haven't tested it on a t2dSceneWindow, the other GUI objects take a modal flag in their gui profile that passes the mouse events down to lower objects.For for render order, that's simply a matter of ordering the t2dSceneWindows. The ones further down the list are rendered on top.
#13
i tried some stuff when i was messing around with the SceneWindow2D methods, and wasnt really able to come up with something usefull... so i ended up resorting to setting certain windows invisible or inactive, but that can give you undesired results...
08/10/2009 (7:17 am)
thats why i said "by calling it last...".i tried some stuff when i was messing around with the SceneWindow2D methods, and wasnt really able to come up with something usefull... so i ended up resorting to setting certain windows invisible or inactive, but that can give you undesired results...
#14
Is this correct? Would the zoom not effect both? How can I have it so that zoom only effects one?
04/01/2011 (6:20 pm)
Would it be ideal to say have a HUD, in one, the level behind. My level I can zoom in and out, but I need my HUD to stay constant. My thinking is that I can create two scenegraphs in a single .t2d. I have my HUDS in one scenegraph and my "level stuff" in the other. Is this correct? Would the zoom not effect both? How can I have it so that zoom only effects one?
#15
04/04/2011 (4:33 pm)
That is exactly the way I use it. In one project I uses a background fade as a transition while the front sceengraph is hidden, a new level loaded, then unhidden. The player sees a smooth transition even though I'm explicitly loading and unloading levels.
#16
04/05/2011 (12:21 pm)
Nice!
Associate William Lee Sims
Machine Code Games
I usually create a new SceneWindow-SceneGraph pair through script and load in a .t2d file into the new SceneWindow.
It can be used to make interesting popups windows or a GUI interface over an existing scene graph.
(Almost) needless to say, I need to specify the scenegraph for any dynamically created objects I create after the second window is open.
Hope that makes since and is something you can use in the future. Later!