Skip to main content
Tweeted twitter.com/#!/StackGameDev/status/589034742990929920
Fixed formatting. Reordered and retitled for clarity.
Source Link
Anko
  • 13.5k
  • 10
  • 56
  • 82

How do I create a localmultiplayer server client based gamealso suitable for local single-player?

I've created a VoxelGame but nowvoxel game in C++, OpenGL and SFML, and I want to make it multiplayer.

How would I go about makingI'd like to make it similar to minecraft's serverMinecraft's client-clientserver model where the: The single player-player is just a client to the underneath hidden server; Butserver underneath; 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 ideasSpitball-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.

  • Use a separate thread for the server logic and then share the data between a synchronized point in the code for the client.
  • 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.How should I do this?

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.

How do I create a multiplayer server also suitable for local single-player?

I've created a voxel game in C++, OpenGL and SFML, and I want to make it multiplayer.

I'd like to make it similar to Minecraft's client-server model: The single-player is just a client to the hidden server underneath; but can be configured to connect to multiplayer as well so that the single player and multiplayer code are one and the same.

Spitball-ideas:

  • Use a separate thread for the server logic and then share the data between a synchronized point in the code for the client.
  • Just send packets to local host from the server thread and collect them from the client thread.

How should I do this?

Source Link
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.