OnUpdate
by Jemand den es nicht gibt · in Torque Game Builder · 04/02/2007 (11:40 pm) · 9 replies
In one of the behaviours I found something like "onUpdate". I haven't seen that callback before and it seems you have to activate it too... does this make the behaviour called on every scene update or whenever the behaviour's state changes?
#2
04/03/2007 (1:20 am)
This is cool! :) I will dig into the source code when the final version gets released... Something like that exists in TorqueX aswell and I thought it's really useful to have. Thanks!
#3
04/03/2007 (2:34 am)
I'm wondering if onUpdateScene will be ticked also or still per frame based.
#4
04/03/2007 (12:10 pm)
It's still useful to have per frame based stuff, so I suppose OnUpdateScene will stay as it is.
#5
04/03/2007 (4:19 pm)
OnUpdateScene will probably still be called per frame, mostly because of what Benjamin said. Although, this decision hasn't really been finalized (or even thought about, to be honest), so if anyone has compelling reasons one way or the other, feel free to mention it.
#6
While there are not many cases where a per FPS is a must have (or even is an usefull approach), there are a few things that depend on "realtime" and not on simulation time, which would get into trouble when they would be put into a FPS independent state.
Especially as I got used to program FPS dependant (I've been a Dark Basic and Blitz Basic user for years where you have to do your calculations yourself and thus mostly think in "FPS dependant" programming way)
04/03/2007 (11:49 pm)
Please let OnUpdateScene how it currently is.While there are not many cases where a per FPS is a must have (or even is an usefull approach), there are a few things that depend on "realtime" and not on simulation time, which would get into trouble when they would be put into a FPS independent state.
Especially as I got used to program FPS dependant (I've been a Dark Basic and Blitz Basic user for years where you have to do your calculations yourself and thus mostly think in "FPS dependant" programming way)
#7
04/04/2007 (2:04 am)
I only asked if there were changes, nothing else happen or is about to happen. The only problem I find in onUpdateScene is that since it's frame based, the script can bring down the FPS of the game. There are a number of techniques to make per frame smoother, but with the new object callback the job got even easier. That's why I asked, not really looking for a changed in it.
#8
04/04/2007 (2:35 pm)
I'm using onupdatescene for my camera system, and its working perfectly under 1.5 and on any system (I update the camera position only when necessary : at each frame). So please let it be. It's always better to have the choice (between onupdate or onupdatescene).
#9
thanks
04/04/2007 (7:21 pm)
Is there anyway to change the interval of the tick by scripts? or i have to change it through the source??thanks
Torque Owner Adam Larson
It is actually called every tick, which happens every 32 milliseconds, so no need to worry about frame rate dependence.