Hi,

Le 05/09/2010 20:54, Mikko Vartiainen a écrit :
> On Sun, Sep 5, 2010 at 7:31 PM, Mikko Vartiainen <mvartiai...@gmail.com> 
> wrote:
>   
>> Animation seems to be the big obstacle on 4x10 case. I made crude test
>> (see below) with animations, and this alone changes completely
>> unplayable game to about 10 fps game.
>>     
> 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.
>   
When a character changes its animation (see Character::SetMovement or
Character::SetMovementOnce), it calls :

uint l,r,t,b;
body->GetTestRect(l,r,t,b);
SetTestRect(l,r,t,b);

SetTestRect is a method from PhysicalObj.

So, the physic is directly relying on the body's internal state.

*That means that we must be very careful about such optimization because
it may break consistent state in network game.*

For this optimisation to be ok, we must be sure, that when we change the
movement, at least, body internal state is recomputed. And we must be
sure also, that when characters will be displayed on all computers, it
will be synchronized, else, it may create some big problems, when a
character is shooting for instance. (The shoot will be different
depending each frame of the animation is displayed), and yes, you can
shoot with an invisible player (but MustBeDraw returns always true for
the ActiveCharacter).


Regards,

Matt (gentildemon)

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

Répondre à