Offline Matchmaking #
Offline matchmaking is a way to find matches for users who are not currently connected to the server. This can be useful in many aspects, such as:
Asynchronous multiplayer games where players don’t need to be online at the same time, such as turn-based strategy games or puzzle games. Offline matchmaking can be used to pair players based on their skill level, game preferences, or other factors. Players can then take their turns at their own convenience.
Scheduling matches for specific times, where offline matchmaking can be used to find suitable opponents in advance. This can be particularly useful for competitive games with large player bases.
Match Suggestions can be used to suggest potential matches to players when they log in. This can help to engage players and encourage them to play more matches.
Player retention can be improved by providing players with suitable matches even when they’re not online. Players are more likely to return to a game if they know they have a match waiting for them.
Nakama supports offline matchmaking by enabling developers to query specified indices in the storage engine using the same query syntax as the Matchmaker. This way it is possible to lookup matches based on any player criteria from the collections they elect to index, even when the players are not online.
Configuration #
Offline matchmaking is implemented via the server framework. As part of your custom logic, whether written in TypeScript, Lua, or Go, you can configure your desired indices and the filters used for writing to them.
RegisterStorageIndex #
|
|
|
|
|
|
RegisterStorageIndexFilter #
It is possible to register a custom filtering function per index to be called for every eligible object.
See the storage indices documentation for more details.
Usage #
Unlike the Matchmaker, offline matchmaking is accomplished via the server framework, specifically the storageIndexList function.