Game Development Community

Schedule events from scenegraph time

by Jason McIntosh · in Torque Game Builder · 09/17/2005 (2:06 pm) · 7 replies

I want to make it possible to schedule events that get their timing from a scenegraph instead of the sim time. This avoids a bunch of serious problems, not the least of which is that you could pause the game without being unable to schedule any new events (for things like animated menus etc). It also solves issues related to low framerates.

Something like
%myObject.sceneSchedule( %scenegraph, %time, %function, %params );
sceneSchedule( %scenegraph, %time, %function, %params );
would be ideal. Then if you pause the scenegraph, it would pause events pending, too. If fps drops low, events will fire proportionately slower so you don't have piles of events choking performance even more.

I admit I have not looked at the code much at all, but I figured there might be some folks who would have a good idea of how to accomplish this through more intimate knowledge of the engine than I have. So, anybody got some ideas of where to start with this?

(Unless Melv already added this to the 1.1 update? Which would be incredibly incredible!) :)

#1
09/17/2005 (5:15 pm)
I think he might have...

-Peter
#2
09/18/2005 (4:52 am)
No matter what, it would be incredibly incredible if 1.1 realease went out the door.
Sorry to sound a bit irritated or even rude but I for one hope Melv WILL NOT ADD MORE FEATURES NOW. I know it's more fun to add cool features than to fix things but adding features tend to create more problems etc. I've been waiting since the last release for a solution to the flickering problem for tiles. This was to be fixed in the update we got but instead I got it worse. Then once every month or so we hear about another group of really cool features to be added in the fabulous 1.1 release.
Please, do release the 1.1 and let us users (and paying customers) test things and discover bugs.

Yes, I feel much better now. Yes, I will take my medicine now. What, why should I wear that shirt? The straps look cool, but the sleeves are way too long and... what's with all the cushions on the floor. And on the walls too. Hey, unlock that door will ya!
#3
09/18/2005 (5:12 am)
@Bucko

Make sure this isn't what's causing the flickers.

On another note, I don't really see anything wrong with feature requests and such.

--
Hans
#4
09/18/2005 (8:57 am)
Well, adding this functionality resolves issues that you will run into if you do anything more than a tech demo with the engine. Especially if you distribute to a wide audience with less than bleeding edge hardware. :)

Besides, I wasn't directly asking Melv to add it to 1.1. I want help adding it myself, and if Melv adds it that's icing on the cake for everyone.

So, back to the original post, how shall I go about adding this?
#5
09/19/2005 (12:38 pm)
Quote:So, back to the original post, how shall I go about adding this?

It should be easy enough. Remember this post about the T2D main game loop in DemoGame::processTimeEvent()? That's where you need to add your code.

You need to add your own process that happens just after the scene update (probably after scene callbacks if that is a separate process). This process runs through the particular scheduled events that have been added and makes a call if their time is up. You can even look at how the current scheduling system handles setting, storing, and firing scheduled events to make sure it does what is needed.
#6
09/19/2005 (1:43 pm)
Thanks for the suggestions, Smaug. :)
#7
09/23/2005 (7:18 am)
And if you pull it off make sure you give the rest of us a copy ;)

-Peter