Download

Multiplayer AI movement

I am creating an RTS game and I am currently finishing my first Version that combines Camera, Movement, Selection etc… and I want to make it multiplayer ready from the start.

While creating the character movement I did all of the calculations Pathfinding, Steering etc in the character class but with multiplayer in my mind should I move all this calculations to the controller?

For example my Character contains some variables
velocity, maxVelocity, health, etc…

and my own Movement code that updates the velocity and sets the actor to a new location
MoveUnitTo();

should I move all this variables and calculations to the AIController or leave them in the character class.

Dear Denozone,

All you need to do is ensure that all of your AI code runs off of a HasAuthority switch, so that it only runs on the Server :slight_smile:

In fact, wherever your AI code is, the the most important thing is that it only runs on the Server, since there’s no point in every client doing the calculations as well :slight_smile:



if(HasAuthority())
{
   //Do AI Calcs here
}


:slight_smile:

Rama

ok thank you :slight_smile: