What do you mean, "bewtween 0 and 1"?
What do you mean, "bewtween 0 and 1"?
0..1 means the multiplicator of time since last frame, where 1 is one second and 0.5 is half a second, 0.25 is a quarter of a second etc....
<a href="http://www.greatgamesexperiment.com/game/Valgard/?utm_source=gge&utm_medium=badge_game"><img border="0" alt="GGE" title="GGE" src="http://static.greatgamesexperiment.com/badge/game/valgard/gge400x56.png"></a>
That doesn't work at all.
I think that is what you were thinking of, right?Code:NewtonUpdate(NewtonWorld, (1/100)*(deltatime/1000));
Well, that's way too slow. My objects are hanging in the air, as they should not.
deltatime / 1000?
What happens if you use just deltatime?
<a href="http://www.greatgamesexperiment.com/game/Valgard/?utm_source=gge&utm_medium=badge_game"><img border="0" alt="GGE" title="GGE" src="http://static.greatgamesexperiment.com/badge/game/valgard/gge400x56.png"></a>
Deltatime is in milliseconds.
Anyway, I tried it out. They fall faster, but still not fast enough in fullscreen mode. Which means, there is still a speed difference between low FPS and high FPS.
If you want to free your physics calculation from rendering use accumulative time stepping, as it's the way to go for doing fps-independent physics. Do a search on the Newton forums, there is a thread about this topic which includes all necessary information.
I'm using that method too in my newer newton demos like the NewtonPlayGround and my physics calculation run always at the same speed no matter at what FPS the application runs at.
Just seconds before you wrote your post, I stumbled upon this: http://walaber.com/newton_wiki/index...ewtonUpdate%3F
I now do it like this:
Works fine. Thank you two.Code:inc(FTimeSlices, DeltaTime); while FTimeSlices>16 do begin NewtonUpdate(FNewtonWorld, 16/1000); dec(FTimeSlices, 16); end;
(Posting here, cause 3_of_8 isn't online on ICQ, and people might want to know in general)
If you've got your framerate stuck at 50/60/85 fps, watch out for VSync! the graphics card will then sync the render loop with the screen's frequency.
What happens if its not the video card which is the reason for low FPS but the processor, because your AI, pathfinding, physics etc are too complicated to achieve good results on slow CPU's?Originally Posted by 3_of_8
In my opinion, your code would let the game stall very soon, because you "punish" the CPU for being slow by giving it more physics to do
So every cycle the CPU would call NewtonUpdate more often, which results in higher Deltatime, resulting in more NewtonUpdate-calls... is this the way to go? I don't know... just my thought... or am I wrong?
<a href="http://www.greatgamesexperiment.com/game/Valgard/?utm_source=gge&utm_medium=badge_game"><img border="0" alt="GGE" title="GGE" src="http://static.greatgamesexperiment.com/badge/game/valgard/gge400x56.png"></a>
I know what you mean.
I have no idea if this is right or not.
Bookmarks