So I’ve been reading up on the NetworkManager, and it makes sense for a game where each player has an avatar that represents the player, but my game is more like chess, where each player takes a turn moving his pieces on a board.
The player prefab seems to be a necessary part of this scheme, but I don’t know what I should put there since there is no visible ‘player’ in my game. What exactly is a ‘player’ in regards to the network manager? What does it have to do? Can it do nothing?
Basically there is a game board that will be shared with all clients, and the client will display the board differently depending on which player or client is looking at the board, i.e. fog of war effects, friend or foe etc. Can I use the HLAPI for such a game?
Definitely. You don’t HAVE to do it like this, but having thought about it for a few minutes, i’d probably make your player prefab have no visual representation in the game, its just a means to send inputs to the server. You could have code on it that processes input and sends commands to the server to spawn units with NetworkServer.SpawnWithClientAuthority() that the server would give you authority over, and then you could send per-unit commands because you own the new units as well (if necessary, or you could do it all with commands on the original player prefab, so long as the server has some system in place to keep track of what units you own).
Hmm, so the player prefab doesn’t necessarily have to do any specific thing? In my case, the player is the same as client, as it is a 2 player game. The only case where that’s not true is in the case of hotseat play, which is something I’m going to have to figure out. All I really need to do is send the status of the board to the clients, and send input to the server from the clients.