Hi!

> > - Run the game loop at a constant rate by refreshing the main clock (the
> > Time class) at a constant rate, instead of having the physic engine do
> > it.
> 
> I'm not sure to understand what you speak about. How can you be sure that you
> ran the game loop at a constant rate ? On my computer, Wormux runs with about
> 20fps and is playable BUT sometimes, big explosion make it fall to about 6 
> fps.
> In my case, the only way to be sure that game loop is running at a constant 
> rate
> is too ran it about 5 times by second making the game totally impossible to
> play.
What I mean is, the game loop would run at a fixed rate, but independently of 
the 
displaying rate.
Practicaly, the class Time would store the current time in a member variable, so
each call to Time::GetTime() would give the same value for a same frame, 
independently
of the time elapsed since the last frame.
In the game loop, we would put a Time::Refresh() that increase the value of the 
time by
20ms or something like that (it limits the max frame rate to 50 fps, the same 
limit
we have currently in the physic engine). Then we compare the time variable to 
the time
reported by SDL, and there we decide wether we have enough time to display the 
frame, or
just skip it.
The difference with the current main loop, is that we will run more often the 
Refresh methods and check for keyboard and mouse interaction. Most of the 
current Refresh 
methods is to call the physic engine loop, so the impact there is null, the 
loop is just at 
an other place. So the main difference is that we'll check more often for user 
interaction, 
which is negligeable I think.

Also I forgot to tell, it's a future work, I don't intend to do any of this 
before 0.8!! :)

Lodesi
-- 

_______________________________________________
Wormux-dev mailing list
Wormux-dev@gna.org
https://mail.gna.org/listinfo/wormux-dev

Répondre à