Hi guys
I am working on an Asteroids clone. But when moving my objects they are really jumpy as if the FPS jumps up and down or there is something wrong with the FPS counter.
Does anyone have the time to try out the code and see if they have the same problem and if why then?
The source and objects are only like 20k so I can mail it.
Thanks
Really jerky performane
-
Gorgon Zola
- Posts: 118
- Joined: Thu Sep 18, 2003 10:05 pm
- Location: switzerland
Hi exal,
nice code so far
I guess there's a problem with the clock.
the resolution of GetTickCount() might be too low try to use
the irrlicht internal timer object ( ITimer* timer=driver->getTimer(); )
this function uses the highperformance timer if availble...
Then, try to multiply your movement units with a frame-timefactor in your case this would be:
There's a nice tutorial in the FAQs Forum about FPS independent movement.
T see you don't like the event-receiver stuff, well, if i may give you a hint there:
try to pack the things in GameMain into a class and let that class extend the IEventReceiver this way you'll have it easier to handle events with irrlicht.
cheers
Gorgon
nice code so far
I guess there's a problem with the clock.
the resolution of GetTickCount() might be too low try to use
the irrlicht internal timer object ( ITimer* timer=driver->getTimer(); )
this function uses the highperformance timer if availble...
Then, try to multiply your movement units with a frame-timefactor in your case this would be:
Code: Select all
float frameWeight=ourTickCounter/1000.0; // units per seconds
// provided 'ourTickCounter' are milliseconds not too shure about that
...
// example for playerclass
//Call superclass move to actually move the object
MoveOSZ(myCurrentSpeed * frameWeight);
T see you don't like the event-receiver stuff, well, if i may give you a hint there:
try to pack the things in GameMain into a class and let that class extend the IEventReceiver this way you'll have it easier to handle events with irrlicht.
cheers
Gorgon