Chapter XV
NPC's and Multiplayer AI
I decided not to cover AI in this tutorial. Perhaps in the next one? There isn't much difference from what we did for the player code really. Some key points would be.
Do AI on Single Player, Host, or Server's computer.
Do NPC animation locally like we did for player's.
If the NPC's have weapons, create them locally like we did for players.
Do effects of NPCs locally on clients, just like we did for the projectile explosions.
AI is a bit easier than the player code as far as multiplayer coding goes, because you don't have to worry about transfering the key input like you do for players. Of course, writing the AI code itself is not an easy task. Feel free to write a tutorial on AI, it would be much appreciated by the community. Or better yet, add some to this tutorial.