Skip to main content
1 of 2
John
  • 45
  • 8

How do I create a local server client based game

I've created a VoxelGame but now I want to make it multiplayer.

How would I go about making it similar to minecraft's server-client model where the single player is just a client to the underneath hidden server; But can be configured to connect to multiplayer as well so that the single player and multiplayer code are one and the same.

My spitball ideas:

1.) I was thinking maybe to use a separate thread for the server logic and then share the data between a synchronized point in the code for the client.

2.) Or maybe just send packets to local host from the server thread and collect them from the client thread.

My game is written in C++, OpenGL and SFML.

John
  • 45
  • 8