Jump to content
Ganvai84

Ambient Animation MP Performance Impact

Recommended Posts

Hey guys,

another really Nooby question but I would like to know a bit more about the Performance Impact that ambient Animations have on Multiplayer Servers.

I was told to not use / rarely use ambient Animations because the Animation creates an Instance on the Server for every player logged in but no one could elaborate more on the topic so I am trying my luck here.

For instance, is that true for Idle Animations as well. For example, I would place units with "doStop this;" which switches Units into an idle Animation until they are in Battle. Would they also be instantiated for every player until they switch to combat?

If not, why don't these animations effect the server in the same kind. Is there another command / way to setup animations that is more performant? Or does it depend on the kind of animation one would choose?

So you see, that is not an actual problem, but more a desire to understand more about the whole topic.

Thanks for sharing all your knowledge.

Cheers, Jan

Share this post


Link to post
Share on other sites

1 - doStop this  ... is not an animation, rather a native FSM status for the unit

2 - using it with this means you're writing the code in init field of the unit (where this a magic variable working here). So, yes, this code will run at each JIP in MP, and, as doStop command is Argument Global, Effect Global , you will stop the unit everywhere (PCs), every JIP.

3 - You can just write : if (isServer) then {doStop this}; // if it's the desired effect you want at start, and no more.

4 - you can brake the doStop by another order, at chosen condition. Something like:

if (isServer) then {doStop this; this spawn {params ["_unit"]; waitUntil {sleep 1; behaviour _unit isEqualTo "COMBAT" }; _unit doFollow leader _unit}};

 

Such commands are not resource consuming. Elaborated condition (waitUntil), too often checked, may be.

 

5 - ambient animations are more "specific animations" you can script with: BIS_fnc_ambientAnim Or BIS_fnc_ambientAnimCombat

These functions are not optimized for MP (multiple logic creations, JIP weird result). If you need to anim an edited unit,  use:

if (local this) then { [this, "SIT2"] call BIS_fnc_ambientAnim; };
If you spawn it (_unit), just run the function where you spawn:  [_unit, "SIT2"] call BIS_fnc_ambientAnim;

 

Of course, these functions are complex and a little bit resource consuming if used in large scale.

  • Like 3

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×