Re: [xmoto-dev] overall performance improvements

[ Thread Index | Date Index | More lists.tuxfamily.org/xmoto-dev Archives ]


On 12/11/06, Kees Jongenburger <kees.jongenburger@xxxxxxxxx> wrote:
> xmoto 0.1.0 was made from scratch in approximately one month. My guess
> is that half the time was used to prevent the physics from exploding
Did you create the VDraw and GUI also from scratch?

Yup. In hindsight it could have been made much smarter - for instance
like using an external GUI library like cegui instead.
During the first week or so of development, xmoto was just a crude
test framework for a car simulator :)  (vapp = Vector-graphics
APPlication). It was just when I saw how much my simple 2D car test
resembled elastomania, that I decided to hack it into a clone of that
instead. That's the primary explanation why the code is so
unstructered.

I did some additional testing , with a value of 5 the bike can start moving
when I don't touch anything. 7 seams really good enough.

Hmm, you can try tweaking PHYS_SLEEP_EPS and PHYS_SLEEP_FRAMES until
it doesn't move.

It works like this:

"If nothing has moved more than PHYS_SLEEP_EPS units during the last
PHYS_SLEEP_FRAMES updates, then freeze the physics until the user
touches something (or the bike touches a moving block)"

The game currently is trying to perform 100 fps. I don't understand
the code well enough
to understand if those are virtual frames or real frames. Would it be
possible to create a version that aims at about displaying 20 fps?

Currently it needs to update the physics 100 times per second - i.e.
there's no reason to updating the graphics faster than that.
In other words the current physics time step is fixed at 0.01 seconds.
If it's larger than that it gets drastically more difficult to have
stable physics - AND if it's changed, most physics parameters must be
adjust accordingly because they are dependant on the time step.
I think it would be near impossible to get physics that resemble the
current one if the time step size is changed.

--
Rasmus Neckelmann



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/