We’ve introduced match making features to AppWarp in our latest release. This feature significantly enhances the usability of AppWarp as it allows the developers to easily support quick play modes and reduces the amount of time spent scanning for the desired game rooms.
AppWarp supports match making in two ways.
First way is: Matching based on the properties of a room. Let’s say you want to support a scenario where players only play against other players with the same skill level. You would then create rooms and add a property to all of them with a value of either beginner, intermediate or advanced. Now when a player logs in and you determine that it’s a beginner level player, you will need to do the following:
- Get a list of all rooms
- Get information of each room one by one
- For each room; check the level property and its availability to join.
- Continue till a room with property beginner and number of active players less than allowed is found.
- Join the room
Coding the above algorithm can be buggy as each step involves a round trip to the server and requires some state management. Not to mention it being slow. To solve this; match-making APIs allow you to do the above process in a single API call by passing the desired table of properties i.e.
Hashtable<String, Object> properties = new HashTable<String, Object>();
properties.add("level", "intermediate");
WarpClient.JoinRoomWithProperties(properties);
That’s it!
Second way is: Matching based on the number of players in a room. Let’s say you are developing a 4 person game and the game can only start once all 4 players have joined the game room. To support a quick-play mode in which users can immediately join a game with random players, you will need to do the following:
- Get a list of all rooms
- Get information of each room one by one
- For each room; check the number of players in the room.
- Continue till a room with 3 users is found.
- Join the room so that the room has 4 players now and the game can start.
This too can be solved using a single match-making APIs call
WarpClient.JoinRoomWithNUsers(3);
That’s it! You can easily match the players of your game in few simple steps with AppWarp. In case if you have any further queries about how to extend it, please feel free to contact us at support@shephertz.com
Leave A Reply