I've been doing a fair bit of research on the best approach for putting networking play into a game im working on, and I've read that many games today are developing their singleplayer gameplay just as a local hosted network game.
Does anyone have experience in this, or have any articles on the best approach for this?
I am conflicted with the idea of how to handle game logic for this, because if your "client" is running predictive logic that the server is master over (client predicts, server validates), then are you not leading to running the same logic checks twice on the same machine?
Is there a better way to look at this? A better way to separate or even merge the logic depending on the type of game you're playing (singleplayer or multiplayer) and keep the simple design of only having to develop one core part of the game that can be shared by both the single and multiplayer aspects?
An example of this would be:
- Client moves, sends input to server.
- Client hits a wall, has client logic to handle collisions.
- Server handles the input and it too detects the collision, sends result back to client.
- Client reads server response and if needed corrects.
I've love to hear other peoples experience of this sort of idea/problem and how they've gone about it.