Architecture advice for a physics-based arcade racer

Hi there,

I’m new to game networking so was looking for some advice on how best to structure the networking side of a project I’m prototyping in Godot. While the specifics aren’t set in stone just yet, a rough outline is:

  • A local + online arcade racer along the lines of Mario Kart, Micro Machines, etc
  • The vehicle movement is (at least partially) physics-based
  • Multiple races can occur at the same time with different tracks
  • Each race will have a max of around 8-12 players
  • Players can’t hot join a race once it’s begun
  • At the moment it’s only a hobby project so it’s not likely to be under heavy load any time soon, but I would like the design to be scalable in case I end up commercialising it down the line

My current thinking is a server authoritative approach, since that’s meant to be easier to prevent cheating than client-relayed, with a room per lobby/race. What’s stumping me though is the physics element.

My understanding is that it’s best to have the server simulate physics rather than the clients, both in the interests of reducing cheating and keeping simulation results consistent between players. Because of that I was thinking of something like:

  • Player provides input to the client
  • The client sends that information to the server
  • The server validates that input and applies it to rigidbody versions of the vehicles
  • The server sends the transform info of the vehicles back to the clients
  • The client applies that transform info to kinematic “puppet” versions of the vehicles

Does that sound like the right sort of approach for this type of scenario? It also suggests I would be better to have running Godot instances (one per room / race I assume) on the server side to do the simulations.

I would also like to take advantage of Nakama wherever I can, particularly when it comes to authentication and matchmaking. Would this sort of design be suited to Nakama? And if so, which multiplayer engine would I be best suited to go with? Would using a modified client-authoritative approach (server joins the game as a host / ‘shadow client’ and all clients send RPC calls to it) make sense?

Would appreciate any help / guidance you can give.