I’ve been working on an RTS core lately and recently began to implement networking features. Spent some time researching and found that a LockStep networking model is the way to go. I’m going to begin implementing unit movement, damage, attack, etc., into the network but I’m curious just how much data should be passed through to the network? LockStep keeps all players in sync as far as I know.
Currently my plan is something like this… when a unit is commanded to walk towards an enemy and begin attacking I’ll network once to all clients the attacking unit’s ID and target’s location. When this data is received, the unit will build a path to its target and begin moving on the client side. Assuming all data remains in sync between each client, on the client’s side the attacker will eventually come within attacking range and begin attacking without requiring any extra data from the network.
When the target being attacked is commanded to run away the attacker on the client side should know that it can’t attack any longer and needs to start chasing again, resulting in networking movement data to each client, updating paths and beginning movement on the client’s side.
My question is, should I be networking every action that takes place between the units? i.e. when the unit begins attacking, when the unit finishes attacking, when the unit needs to chase down its target again, etc., or will it be sufficient to network just the movement and let the client handle the rest?
Hopefully this wasn’t too hard to understand, I’m a complete newbie to networking ![]()