Things to do Before Creating a Multiplayer Game

Hey everyone! I was thinking about creating a networked, multiplayer game. I was wondering, is there anything that I should do before anything else to help the workflow go more smoothly? Are there any tips about creating networked games? Any advice you all have is appreciated! Thanks! :smile:

Planning and testing are HUGE priorities. Don’t just start coding and make sure to understand what you are actually coding.

like JRavey says, good planning and knowing what you want/need in networking is somehting that you should do.

I think the most important thing you could do if you plan on adding multiplayer later, is to add a middle layer that delegates between the players input, and the objects the player is controlling. By adding separation between the player and controlled objects your controller can delegate whether or not the input should go to some network function or the object directly, or even both. If you are directly connecting your player with the objects its controlling, later on when you attempt to add networking functionality you will find that you need to completely rewrite your code as your objects and player are directly tied in with each other.

For example in the current mp game I am working on the clients input is parsed by my InputController, my input controller sends its input to the NetworkClientController. There is only 1 network client controller per person at any time. The network client controller decides what it should do with that input. I have made my game so that it supports both Authoritative and Non-Authoritative setups, so in the authoritative setup the client controller will send the input to both the server and the object its controlling directly. The server runs its own simulation of what should happen with that input and when the client receives the positions of the object it was controlling back from the server, it will compare and correct any discrepancies. Of course if I make a single player mode, all I have to do is tell my network client controller to only send input directly to the object its controlling and I’m set. With this level of separation I can have both networked and non-networked gameplay with the same code.

Thanks everyone! I’ll keep all that in mind when I start. :smile: