Ultimate Glove Ball: An Esport Multiplayer Showcase
Alexandre Thivierge
Ultimate Glove Ball (UGB) is a multiplayer esport showcase developed by our VR Developer Technology team using the Unity engine. Originally previewed at Meta Connect 2022, this project demonstrates how to integrate Social APIs and multiplayer libraries to connect players together in an arena. The integration of Meta Avatars makes for customized representation and a better social experience. We also demonstrate how we can build an asymmetric experience with players and spectators in the same arena.
Code available on GitHub.
Demo available on App Lab.
Code, Documentation, and Demo
Ultimate Glove Ball is offered as a complete open source project with source code and documentation. The documentation has information on the setup and the implementation of the different features. Photon has granted us permission to redistribute their SDK with the project, which makes the sample self-contained.
Ultimate Glove Ball Overview
If you like playing dodgeball, you’ll love Ultimate Glove Ball. UGB takes the basic gameplay of dodgeball and transports the game from the playground to a futuristic arena, supercharging each player with robotic gloves to launch balls at opponents. Players can party up and hit the court for a three-minute match of manic 3v3 multiplayer dodgeball. Users can also watch others compete against each other as a spectator in the arena, then join a game when they’re ready to jump in.
Ultimate Glove Ball builds on top of our previous multiplayer showcase, SharedSpaces. We’ve refactored and improved the multiplayer experiences with UGB and extended the feature set to include even more.
Asymmetric Experience
One of the key features we wanted to demonstrate in this showcase is how people can interact together in different contexts. They don’t need to have the same experience to be together.
To demonstrate this, we decided to have a player and spectator experience. The player is on the court playing the main game while the spectator is in the stadium, cheering and encouraging their team.
While it’s a simple difference of experience, it came with some implementation challenges. We needed to add some custom parameters on the photon rooms, which are updated as the players join in order to ensure the correct number of players in each role. Based on the role, we implemented different logic for spawning locations and different input schema since they have different interactions. We also kept the spectator representation simple, with a crowd blob rather than an avatar, to reduce the networking needs and the performance impact on the game.
Users can easily spot spectators in the crowd:
Player’s point of view:
Spectator’s point of view:
Avatars
In the context of social games, it can be important for each player to have their own identity. In Ultimate Glove Ball, players can express themselves by using their own custom Meta Avatars. We integrated the Meta Avatars SDK, which provides the implementation to use the Avatar configured in the Meta Quest Platform.
The avatar follows the camera rig, so it will track the position of the player in its own space. The gloves and the hit collider track the joints, wrist, and chest specifically. We leverage body tracking for a better sense of self and dodging. For Meta Quest Pro, we also integrated face and eye tracking.
Avatars are networked using the Record and Apply stream data functionalities. Once recorded, the data stream is sent over the network and received by the other users. The users then apply the data stream. We use different levels of details (LOD) for the stream to reduce bandwidth. We send the lower LOD at a higher frequency to get constant input of the state of the avatar, and we infrequently send a higher LOD of data to ensure we stay in sync more accurately and avoid drifting. You can find LOD best practices by checking out the data streaming documentation.
Custom Avatar Shader
In this project, we have an example of how we modified the original avatar shader that comes with the Meta Avatars SDK to add new effects. We integrated two effects to the shader:
Our Social APIs help you develop applications to get people together very easily. In Ultimate Glove Ball, we used five of these APIs:
Destinations: We set up destinations which are used for people to navigate to the same arena based on region. For players to be able to join each other, we need to have destinations.
Group presence: This will update the platform with the current user’s destination as well as the room they’re currently in. Once the group presence of a user is set, they can invite others to their destination and other users can join them directly.
Invite: The invite API will open the invite panel so the current user can invite friends to their current destination. In Ultimate Glove Ball, it would invite another user to your current arena, where they can play with you once joined.
Roster: This API will open the roster panel, which shows all current users in the arena. This makes it easy to display all users in the same Arena.
Blocking: This API triggers the blocking flow, which can help the user feel safe while playing. In our project, we fetch the ID of all the users blocked by the current user to ensure we can limit their interaction. Ultimate Glove Ball mutes the blocked users. When the current user blocks or unblocks another user, we toggle their mute status.
We used the Photon Realtime SDK as our transport layer since it’s a popular solution. To connect users, they need to be in the same photon room in the same region. Since we needed our game to have low latency, we selected a handful of regions to support. As mentioned above, we created a destination to represent the arena for each region. Therefore, users will be joining the appropriate region and the Photon room ID will be the group presence ID. When following an invitation, the user will join the same region and room as the inviter.
Build Your Own VR Esports Game
Like all our showcases, Ultimate Glove Ball offers foundational code, best practices, and inspiration on which to develop your own VR experience. If you’re starting a game from scratch, our integration of Meta Avatars, Social APIs, and multiplayer networking makes it easy to bootstrap your esports titles. Or if you have an existing game and want to add spectator mode, take a look at our implementation and add it to your scene to bring more users into your game. We look forward to seeing what you build on top of Ultimate Glove Ball.
Avatars
Quest
Unity
Did you find this page helpful?
Explore more
New to the Meta Horizon Store from App Lab? Here are Tips for Overcoming 5 Key Challenges
Explore the top five issues developers encounter when making the switch from App Lab to the Meta Horizon Store and gain solutions to navigate these challenges successfully.
Build Faster and Smarter with GenAI Tools in Meta Horizon Worlds
GenAI tools in the Meta Horizon Worlds desktop editor are now available to creators in the US, UK and Canada. Explore how new features like Mesh Generation can greatly reduce the time it takes to build worlds for mixed reality and mobile.