Lua server architecture (small-scale mmo)

Hi there, again! :smiley:

Im currently working on a small-scale MMO using nakama and godot! The game is a 2d game with grid movement, more or less tibia back in the early days! My aim is to be able to support around 500 concurrent players in the game world.

So, now to the topic of this post: What is the best approach to achieve this?

  1. First and foremost, is nakama designed to handle this many users?

  2. Whats the most efficient way to handle the game state between all the connected clients? I was thinking about splitting the world into chunks, and only update the state from a specific player to its neighbouring players (in the nearby chunks). Im currently using Lua.

Would i benefit anything from various calculations and table operations on the server to minimize the broadcast receivers? (instead of just sending it to everyone) Or is there a better way of dealing with this?

Thats all for now, thanks in advance :slight_smile:
/G

I’ll answer your questions below;

  1. First and foremost, is nakama designed to handle this many users?

Yes Nakama can handle many hundreds af thousands of players in a single match or many matches. We’ve benchmarked Nakama for up to 970,000 CCU in a single match.

  1. Whats the most efficient way to handle the game state between all the connected clients? I was thinking about splitting the world into chunks, and only update the state from a specific player to its neighbouring players (in the nearby chunks). Im currently using Lua.

Yes that’s one way that we’ve seen developers send delta-based (diff-based) updates to all clients.

Purely from performance perspective, you may want to look at doing some of the calculation-intensive code in Go (because it’s native, rather than Lua which is interpreted).

1 Like

Thank you for ur reply! :slight_smile:

Well then, my journey continues! Ill dig my teeth in some Go aswell. Is there any examplecode och documentation on how to use both Go and Lua together?

have a nice day! :slight_smile:

EDIT: found: GitHub - heroiclabs/nakama-project-template: An example project on how to set up and write custom server code in Nakama server.