Game modes that advance players through weapons are a staple of the action genre. By forcing players to react to each weapon they’re given, they create intense, varied, and exciting experiences where no game plays out the same. However, these experiences are highly dependent on the order players are granted weapons. If a player gets stuck on the same weapon for a significant amount of time, this can lead to frustration.
This example adds a cooperative spin on the idea, where players advance through weapons as a team, and skilled players can advance their teammates up the tiers, helping them through weapons they might struggle with.
By completing this guide, you’ll learn how to create a game mode where players advance through a series of weapons, with each elimination granting them or their teammates the next weapon.
Verse Language Features Used
map: This example uses the map container type, which provides handy key-value associations of players and their stats to track a player’s current weapon tier as well as team assignment.
Type Aliasing: Type aliasing allows you to give a type a unique name without creating a new type.
option: This device uses options to determine which player should be assigned a weapon when a player scores an elimination.
array: This device uses multiple arrays to store references to other devices and teams of players.
for: With the for expression expression, you can iterate over the arrays the device uses.
if: The if expression is used to check whether players have a higher weapon tier compared to their teammates, and if players have achieved the correct number of eliminations to end the game.
failure: Failure contexts are used to access arrays and to control the flow of the program.
Verse APIs Used
Subscribable: You’ll subscribe to multiple events, such as players spawning, player eliminations, players joining the game, and more.
Playspace: The playspace tracks subscribable events related to players joining and leaving the game. It also handles retrieving lists of players and teams, and finding the team for a given player. In this tutorial, you’ll subscribe to multiple playspace events, and retrieve players and teams using playspace methods so you can manipulate them directly.
Teams: The team class removes and retrieves players from teams. You’ll use the team class in this tutorial to manipulate teams directly and compare weapon tiers of players.
Steps
Follow these steps to learn how to create a multiplayer competitive game mode that advances teams through a series of weapons. The complete script is included in the final step for reference.
1. Setting Up the Team Elimination Level
Use Verse to create a multiplayer competitive game mode that advances teams through a series of weapons.
2. Finding Devices at Runtime
Use Verse to create a multiplayer competitive game mode that advances teams through a series of weapons.
3. Subscribing to Player Events
Use Verse to create a multiplayer competitive game mode that advances teams through a series of weapons.
4. Tracking Players Using Maps
Use Verse to create a multiplayer competitive game mode that advances teams through a series of weapons.
5. Granting Weapons on Eliminations
Use Verse to create a multiplayer competitive game mode that advances teams through a series of weapons.
6. Handling a Player Joining a Game in Progress
Use Verse to create a multiplayer competitive game mode that advances teams through a series of weapons.
7. Testing Multiplayer Using the Sentry Device
Use Verse to create a multiplayer competitive game mode that advances teams through a series of weapons.
8. Final Result
Use Verse to create a multiplayer competitive game mode that advances teams through a series of weapons.