I've been pondering about different approaches that a multiplayer game server can be managed and programmed.

For instance some of the big engines like UE4 & Unity provide a 'build' flag that can enable them to run headless meaning it'll just be the calculations that are enabled for that mode and will handle a ton of the game state sync, object references, hit detection, cool downs etc..But what I'm wondering is if this is the best approach? From my current understanding for each game running there would need to be a new instance of the headless game.exe running that will then create new connections for users into the game, sync up the players and start. This sounds very resource heavy (I might be overthinking it).

EDIT: In the case of custom game server what would be a good approach into integrating the map data so that UE4 client map can be simulated on the back-end?

I can think of a simple solution looking at it from a 2D prospective, since it's just X,Y we can create a bitmap/grid of position that are available, where walls are etc via simple tile tools that can be easily mapped 1:1 to the client and use that information. However when it comes to 3D I don't see a solution on how to have a 3D map, collision detection and physics simulation.

  • 2
    \$\begingroup\$ "This sounds very resource heavy (I might be overthinking it)" You might well be overthinking it, yes. It depends on your project. For some games, writing a separate lightweight server process makes sense and is scalable enough to meet their needs. For other games, the complexity is such that this would mean maintaining two parallel copies of the game's codebase, a major nightmare. For some games, the overhead of the headless client is entirely acceptable. For others, it's a significant cost. Which group your game falls into is something you figure out by writing tests and profiling them. \$\endgroup\$ – DMGregory May 29 at 15:50
  • \$\begingroup\$ @DMGregory Appreciate the insight, do you have any resources or explanations regarding solutions for server side map management/sync. If I built something in EU4 how would I manage the users location / walls etc on the server for a 3D environment? I'm wondering if there's a few solutions on the market that have avoided my search. (in regards to a custom server) \$\endgroup\$ – Andrei May 29 at 16:08
  • 1
    \$\begingroup\$ Sounds like you should edit your question to ask that specifically. Focusing on a narrow problem like that tends to get good, actionable answers. Be sure to frame it as "how do I solve this problem" not "give me some links to documents/software about solving this problem". \$\endgroup\$ – DMGregory May 29 at 16:15
  • \$\begingroup\$ Please be sure to focus your post on one single question. Right now you have two questions: 1) "Should I use a headless mode of my game executable or a separate server?" (We can't tell you what's right for your project: profile and find out if the headless version is really a problem for your game that's worth the engineering investment of writing your own separate server) and 2) "If I write my own server, how do I do collision detection and physics?" (Well, how does Unreal do it? There's nothing that Epic can program into Unreal that you can't program into your own server, given enough time) \$\endgroup\$ – DMGregory May 29 at 16:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.