I am writting a real time game which contains Enemy AI I need write Enemy AI on server to send action( move, attack, .. ) to clients? or any way to do that? If i write Enemy AI on client? how to be authoritative enemy's actions?
1 Answers
Enemy AI is one of those things which should always be handled on the server.
Remember that anything which happens on the client can be manipulated by a hacked client. If you let the client handle enemies, the client can just claim that the ultimate raid boss just committed suicide and dropped the rarest item in the game.
But even if you assume that all your clients play fairly (you can't), that you can just slap an anti cheat tool on it and it will fix any cheating problems (it won't) or that you can detect cheating heuristically (will cause you more problems than it solves), you still need to deal with synchronization problems. What do you do if multiple clients fight the same monster and they come to different conclusions about how the fight turned out? Due to network latency, this is quite likely to happen.

- 119,250
- 27
- 256
- 336
-
-
@Lenon When this answer answered your question, please accept it by clicking the checkmark-icon next to it. – Philipp Jul 31 '18 at 08:10
i want to know some Physic engines which support move, collision
makes it sound like a software recommendation question. – Charanor Jul 30 '18 at 13:38