Regarding the matchmaking, is there anyway to implement a bot matchmaking system fully using the matchmaker?
Lets say a player has not found a match with another player after 10 secs, I create a new ticket with loosen constraints which would allow the player to match against a bot, since the bot doesnt have a ticket the player would never get matched with a bot, is there anyway to implement this?
Current problem is, bots are not really users, so we cant create tickets for bots or make bots join matches (which would be created authoritatively). So right now we also have matches on storage tables and if the match is against a bot we have all that setup outside the matchmaker pretty much.
Hi @BernardoSantos, as you mentioned, since bots are not real users there is no way to add them to the matchmaking pool to be matched with other players.
Typically a matchmaking flow with bots would look as follows:
- Player A joins matchmaking pool with specific criteria (e.g. 4 players, survival mode, desert map)
- If no match is found, Player A rejoins with looser critera (e.g. 4 players, any mode, any map)
- If no match is found at this point you can create a new authoritative match for the player on their own. You can pass this new match some parameters to indicate that it should be filled with bots. See the MatchCreate function reference.
- Your match handler will then need to read these params and “populate” the match with bots. Since these bots won’t actually be connected presences in your match handler, and since bot logic is very game specific, you would need to handle the behaviour of these bots in your match handler code yourself.
I hope this helps.
Thanks, that is how I have it implemented currently, just wanted to make sure I couldnt like matchmake players with bots automatically.
No problem. No, only Nakama users can enter the matchmaking pool.
By the way, is the matchId accessible in any way in the match handler? Or can I pass it to the match handler?
You can grab it from the context from within your match handlers: Heroic Labs Documentation | Runtime Context.