Once you understand the basics of the SMP system, the matchmaking class can help skip some of the trouble of filling game rooms efficiently. The system comes with a auto join room function that will rank a player’s skill and find the best game room for them.
Decide on the best ranking for your game. Note only one can be used at a time.
- Fill rooms without any player ranking. (default)
- Rank players based on a score in an advanced leaderbaord table.
- Rank players based on the amount and difficultly of achievements unlocked.
Once the multiplayer code is initalized, we must then initialize the matchmaking code. This happens in the smp callback. In the below example, a high score table named ‘Farthest Distance’ is used for ranking.
The following is a list of properties available in the matchmaking class:
Remember to set the min and max players per a room if they are different from the defaults. Also, choose a ranking option using one of the above properties.
Auto Game Joining
Once the multiplayer class is initialized and matchmaking is ready, make the autoJoinGame function available to the player.
A working game was made to test the matchmaking code. Download the example and run it with Flash CS6+ or see the main.as and swf.