I'm working on a small multiplayer game. I would like to keep the design as clean as possible.
Currently, however, I'm concerned about decoupling the networking system. I'm curious to how this is usually done. For example, the networking system needs to:
- create, remove and modify entities,
- change variables like the health of the player, etc.
- and send input, position data and events.
This leads to a few questions:
- Obviously, the network system needs access to a lot of information, how do people usually decouple this?
- Should events be send somehow to the network system, or should the system poll for data and events itself?
I would like to know how other people handle this.
As can be seen in the label, the game is made using C++.