Stephandler and low framerates

s3660870

20-06-2007 11:40:19

Hi,

Could anyone explain the usage of the different Stephandlers to me? When schould I use which handler?

Actually I use the fixedForwardInterpolationHandler, but my Problem is, that at different framerates, the simulation differs.
I have a moving Ball, at low framerates it moves slow (slow jumps etc) at high framerates it moves too fast.

what does the automatic mode? what is framerate, maxframetime, etc. for?

Thanks for help in advance :)

rewb0rn

20-06-2007 15:46:00

you will not be able to handle the problem with the different frame rates in any physics library. (afaik) Just make sure every frame waits until a given time for that frame is reached, so u have fixed fps and it will work like you want.

I'm not sure about all the other things.

s3660870

21-06-2007 12:56:08

Thak you for your help.
Which time unit do the stepper need (for timeStep)? At the moment I work with microseconds, but is this right?

rewb0rn

22-06-2007 07:22:36

its milliseconds i think.. just use the evt.lastFrameTime from your frameStarted() Function

Tabarn@kdeca.lis

03-07-2007 19:47:22

Would anyone know why my simulation won't work properly at 10 fps, while it's perfect at 85 fps, setting the stepper accordingly to the frame rate?

Running at 10 fps with 1 / 10 is very different from 85 fps with 1 / 85.
At 10 fps, everything happen too fast with too strong forces, so objects will pass through walls bouncing all over the place.

Init after many frame to ensure fps has reach a representative value :

realTimeStep = evt.timeSinceLastFrame;
Real const max_frame_time = 1.0f / 2.0f;
Real const time_scale = 1.0f;

poodeStepper = new OgreOde::ForwardFixedStepHandler(poodeWorld, OgreOde::StepHandler::QuickStep, realTimeStep, max_frame_time, time_scale);
poodeStepper->setAutomatic( OgreOde::StepHandler::AutoMode_NotAutomatic, pRoot );
poodeStepper->setStepListener(this);



Step each frame :

poodeStepper->step(evt.timeSinceLastFrame);
poodeWorld->synchronise();

rewb0rn

03-07-2007 20:19:35

as i said you need a fixed framerate to ensure your application has a stable physics system. ode is not designed so that all framerates bring the same results, 10 fps is really low speed for a simulation, in fact i dont think there is a way to work around that. make sure your application has the desired fps, if not its on the user to decrease graphic details etc. to improve the speed.

Tabarn@kdeca.lis

03-07-2007 22:23:14

I simply can't tell the user : "Your computer suck, sorry"!
Besides, I can't debug the program because Ogre run at 10 fps in debug mode.

rewb0rn

03-07-2007 22:52:26

yes i have that problem too..

I simply can't tell the user : "Your computer suck, sorry"! yes u can, thats what modern games do :P 10 fps is not acceptable in any game. maybe the fact that it is worse than in other games at low frame rates is an ode thing but I am quite sure that you can do nothing about it. besides if objects move through walls often you should maybe think about scaling the scene down, ode works best with small values for forces, sizes etc..

Tabarn@kdeca.lis

04-07-2007 18:56:14

My current player unit is 0.25 width, and forces applied are around 15-30! So I must implement a frame rate detection and refuse to go further if it's too low...

It would cause lots of problems with MMOs since data is loaded at any time, and frame rate will drop very often depending to the quantity of people moving around.

Frame rate often drop below 10 fps in MMOs these days, even with the best computer available.

rewb0rn

04-07-2007 22:21:03

true, but mmorpgs dont use physic libraries and player collision is detected in 2d only for most cases. think about the huge amount of data that has to be send to every player if you have dozens of moving physical objects in your scene. thats much to handle already for small multiplayer games like shooters. id really be interested to see a game that handles thousands of players and in addition ten-thousands of physical objects and simulates it all in real time.

Tabarn@kdeca.lis

05-07-2007 20:03:21

Tested it on an old Nvidia Quadro DCC 64 mo and it ran at 20 fps, the simulation was mostly the same. So I assume the minimum fps will be around 20.

rewb0rn

05-07-2007 21:45:53

for my game (a not yet multiplayer mortal kombat like) i assume a fixed fps of 50, any lower framerates will most probably result in undefined behaviour, so its on the user to mess with any problems.

Tabarn@kdeca.lis

12-07-2007 21:53:54

Using OgreOde::ExactVariableStepHandler helped me a lot. The capsule won't bounce everywhere falling through floor getting crazy orientation, but it's not exactly the same as when you have more than 20 fps.