I’m starting a new project and I’m trying to figure out what approach to take.
These are the criteria:
A persistent world of up to 100 players.
Players can join and leave at any time.
Active players send their position to a server module, which distributes the positions to nearby players.
Players can request to modify objects in the world, via a server module, ie. pushing a rock around. If successful, this modification can be seen by all players, even if they’re new.
What’s the best way of achieving this with Nakama?
Matchmaking isn’t ideal, because it revolves around reaching a maximum amount of players.
Parties seem a nice fit, but they’re deleted when the last player leaves. Maybe the state (and party id) can persist in a server module? Maybe the server itself can join the party, to avoid it being removed.
Maybe a combination of Groups and Parties could work? Players join a group, and each group has the ability to create a party for all its members.
I may be wrong, but according to the docs @csdaraujo linked above, you can manually create a match at any time. It doesn’t look like your need some positive amount of players. Additionally, a match will persist even after all players disconnect:
Match handlers run even if there are no presences connected or active. You must account for the handling of idle or empty matches in your match runtime logic.
By dumping, do you mean storing the state to disk, possibly using Nakama Storage, and reading it back when the server has restarted and the module is initialised?
Yes, there’s no confusion here. They’re simply saying remember to save your data before shutting things down. I think my previous post was misread… nothing I said points to not saving your data.