Licensed
Battles are only available with the licensed model. Contact us to know more.
Battles are real-time matches between 2 to 5 players. If you instead want to run time-bound competitions with a leaderboard, open to all your users, see Tournaments.
Set up your Battles integration
1
Enable your games and Battles
Select the games you want to use, along with your Gamezop Account Manager. They enable those games and Battles for your Property ID.
2
Create Battle game links
Add a
roomDetails parameter to each game URL so that Gamezop can match your users. See Create a Battle game link below.3
Set up client-side callbacks (optional)
To receive Battle events in your app or website, ask your Gamezop Account Manager to enable client-side callbacks, then follow Client-side callbacks for Battles.
4
Receive match results on your server (optional)
To save Battle results or reward players from your backend, set up the match outcome APIs.
5
Add bots (optional)
To match users with bots when no opponent is found, see the bot fields below.
Create a Battle game link
A gameurl from the All Games API opens a single-player game by default. To open it as a Battle, add a roomDetails parameter to the URL.
1
Create a "roomDetails" object
The To customise the match, add any of the optional fields before you encode the object.
roomDetails object tells Gamezop which users to match together. roomId is the only required field; all other fields are optional.Users who open a game with the same roomId are matched together. You can use a different roomId for each group, skill level, or other matchmaking pool.2
Encode the "roomDetails" object
Convert the object to JSON, Base64 encode it, then URL encode the result. In JavaScript:For the example above,
encoded is:3
Add it to the game URL
Add the encoded value to the game’s If you pass player details or use different
url as the roomDetails query parameter:roomId values, build the link separately for each user. If all your users share the same roomDetails, you can create one link and send everyone to it.4
Users open the link
When a user opens the link, Gamezop looks for other users from your Property ID with the same
roomId and matches them in a Battle.Optional roomDetails fields
Add these fields toroomDetails before you encode it, to customise the Battle.
Identify your players
Configure matchmaking
Add bot opponents
Customise gameplay and the result screen
Complete example
Next steps
Track Battle match outcomes
Receive each match’s result on your server.
Client-side callbacks
Respond to Battle events in your app or website.