How to architect a real-time multiplayer game?

Hola!
This topic exists because i’m really confused on how services like Colyseus or Nakama work, and it’s not strictly Defold-related.

Let’s talk about multiplayer authority.

In a past experience i developed a game with Godot, and i learned this: when you “shoot a bullet” in a multiplayer game, you only communicate to the authority the fact that you have pressed the trigger. It’s the authority then (a headless instance of the game that functions as server) that instantiates the bullet, moves it, broadcasts the position to other players.

Now, I know that also in defold games can be launched headless, however i also see that generally it’s preferred the usage of services like Colyseus, which have one single big problem: they don’t know anything about the game.

Say i can shoot bullets with physics in my game. I communicate to Colyseus that i have shot, then what? How can colyseus know how to track bullet movement without having the game’s physics engine?

The bottom line is that i am interpreting that these services work purely for card games, or strategy turn-based games, which leave me with the question: how do i treat a real-time multiplayer game in defold, if these services cannot work as authority?

I hope to hear your experience! Thanks everyone

At least Nakama can be used for both. Nakama does for instance interface with Amazon GameLift to deploy and scale game servers using the GameLift API. GameLift can be used together with headless Defold servers. So you’d use Nakama for authentication and matchmaking and once you have a group of players you use GameLift to provision and launch a server for the players.

You can also use Nakama for server authoritative game logic (written in Lua, Go or TypeScript) to create games such as Among Us where you don’t need the very tight simulation that you find in a first person shooter.

1 Like