Custom authoritative server vs Unity headless authoritative server

I have been discussing with my team the advantages and disadvantages of having the server coded in Go or Typescript versus having a Unity headless instance.
My thinking is that having a Unity headless will consume a lot more CPU and RAM on the server than coding it directly on the server, but I have no hard data about this and haven’t found how I can test it, anyone have any experiments on how much performant is one approach vs the other?

The server code we currently have only manages timers, scores and ownerships for objects.

@LucasGaspar This is a complex topic which goes beyond just a consideration on the language that the code is written in. You’ll need to consider the Total Cost of Ownership (TCO) to weigh up the decision between where you maintain your server logic for timers, scores, and object ownerships. For example, if your team is more experienced in C# they will be more productive than with code written in Go or TypeScript (at least initially).

While on the other hand you’ll definitely see significantly better performance with Nakama’s multiplayer engine than the overhead of the Unity headless instance(s). This is because Unity is optimized for session-based multiplayer whereas the Nakama multiplayer engine is aimed at gameplay more like Clash Royale or similar. You’ll also benefit with Nakama because it will be one less piece of infrastructure to compile and manage for your game project.

I think questions you should ask the team internally are:

  • How often do you think the code will change that’s already been written for the game to maintain timers, scores, and object ownership?
  • Has anyone in the team written JavaScript code (and therefore will be familiar with TypeScript) before?
  • How many players will be in these multiplayer matches handled by the Unity headless instance?
  • Does the multiplayer logic utilize the physics engine in Unity or its collision detection support?
  • Based on the progress towards a launch date you’re at in the development process for the game is it worth a change to what’s already been developed? Is there time to make that change?

Hope this helps you make your decision :slight_smile:

1 Like

Thank you a lot @novabyte for your continuous support and great answers!

1 Like