On Mon, Sep 6, 2010 at 11:59 AM, Kurosu <kur...@free.fr> wrote: > Hi, > > > ----- Mikko Vartiainen <mvartiai...@gmail.com> a écrit : >> I made more refined test. Here we simply stop animation if character >> is not visible. It makes a huge difference when there is lot a >> characters. > > The patch by itself seems fine, except that applying movements are /probably/ > needed for the game to update the physical state, I think. So at worst, the > condition also checks IsMoving() or IsImmobile(), whichever is the actual > implied (first I think). I look more into that tonight.
If I disable these functions completely, only implication I could see is that characters just stop yoyoing and "jumping" around. Characters still move and walk (without animation). But of course there can be hidden traps. > On the other hand, I'm not sure if more shortcuts can be taken. For instance, > the collision rectangles of all movements are identical in the xml files. Huge saving with exactly same method can be made in Body::RefreshSprites() which is using in total 21,7 % of time and after the change about 7 %. PhysiCalObj::FootsInVacuum() (>20 % of time) is calculated at least twice for each frame. Calculating it only once gives big benefit. According to call graph more than half of the f2ulz calls are originating from PhysiCalObj::FootsInVacuum() function through PhysiCalObj::FootsInVacuumXY(), PhysiCalObj::CollidedObjectXY() and fixedpoint::float2fix() functions too. I have tested above changes and it changes 0 fps game (4x10 worst case scenario) to 10-20 fps game. -- Mikko Vartiainen _______________________________________________ Wormux-dev mailing list Wormux-dev@gna.org https://mail.gna.org/listinfo/wormux-dev