The Ultimate Team Elimination Arena: Build It, Break It, Verse It
Unverified — this example may not compile as-is.
The Verse code below did not pass our automated compile check, so it isn't marked verified and is hidden from the guide listing. The explanation may still be useful, but treat the code as a draft and adapt it before use.
The Ultimate Team Elimination Arena: Build It, Break It, Verse It
You’ve played the Battle Royale. You’ve survived the storm. But let’s be honest: sometimes you just want to skip the looting phase and go straight to the chaos of a pure, unadulterated team deathmatch. In this tutorial, we’re building a classic Team Elimination arena from scratch using Verse. We aren’t just placing boxes; we’re writing the brain that decides who lives, who dies, and who gets the sweet loot drop.
By the end of this, you’ll have a fully functional multiplayer arena where teams fight for glory, weapons are granted on elimination, and the game ends when one team wipes the floor with the other. No more guessing how to link devices manually—we’re letting Verse handle the heavy lifting.
What You'll Learn
- The Scene Graph Basics: Understanding how Verse sees your island as a hierarchy of objects (Entities) and their traits (Components).
- Player Events: How to listen for "I killed someone" or "I died" moments without checking every frame.
- Team Logic: Using Verse to track which team is winning and ending the game at the right moment.
- Item Granting: Automatically handing out weapons when a player scores an elimination.
How It Works
Before we write a single line of code, we need to understand the "Scene Graph." If you’ve ever looked at the hierarchy panel in UEFN, you’ve seen it. In Verse, the Scene Graph is the universe of your game.
Think of the Scene Graph like the roster of a sports team.
- Entity: This is the player, the wall, or the floor. It’s a physical object in the world.
- Component: This is what the Entity does or has. A Player has a "Health" component. A Wall has a "Health" component. A Spawn Pad has a "Spawner" component.
In traditional Fortnite Creative, you might drag a line from a "Trigger" to an "End Game" device. In Verse, we don’t drag lines. We write rules. We tell Verse: "Hey, when a Player Entity loses all its Health, check who killed them. If that killer is on Team Red, give them a shotgun."
The Core Loop
- Spawn: Players appear on pads.
- Fight: Players shoot each other.
- Elimination: When a player dies, Verse triggers an event.
- Reward: The killer gets a new weapon (Item Granter logic).
- Win Condition: If one team has zero players left, the game ends.
We’re going to build a system where every elimination grants the killer the next weapon in a progression. It’s simple, it’s addictive, and it’s perfect for learning Verse.
Let's Build It
First, set up your level. You need:
- Two Player Spawn Pad devices (one for Team Red, one for Team Blue).
- Two Team Settings & Inventory devices (to define Team Red and Team Blue).
- Several Item Granter devices (these will hold your weapons: Pistol, SMG, Shotgun, AR, Sniper).
- A simple map (walls, floors, cover).
Now, create a new Verse file in your project. We’ll call it TeamEliminationGame.
Here is the complete, annotated code. Don’t panic if it looks alien; we’re breaking it down line by line.
// 1. Define the Game Class
// This is the "Brain" of our island. It holds all the logic.
team_elimination_game := class(creative_game):
// We need to track players. A "Map" is like a scoreboard list.
// Key = Player ID, Value = The Player Entity
Players: Map<player, entity> = Map{}
// List of weapons to grant. Order matters!
Weapons: []string = ["Pistol", "SMG", "Shotgun", "AR", "Sniper"]
// Track current weapon tier for each team
TeamRedTier: int = 0
TeamBlueTier: int = 0
// 2. The Setup Function
// This runs once when the game starts. Like the pre-game lobby.
setup() -> void:
Print("Game Started! Fight!")
// Subscribe to the "Player Joined" event.
// This means: "Hey Verse, call me whenever someone spawns."
PlayerJoinedEvent.Subscribe(OnPlayerJoined)
// Subscribe to the "Player Eliminated" event.
// This means: "Hey Verse, call me whenever someone dies."
PlayerEliminatedEvent.Subscribe(OnPlayerEliminated)
// 3. Handle a New Player Joining
OnPlayerJoined(InPlayer: player) -> void:
Print(&"{InPlayer.GetPlayerName()} joined the fight!")
// Add this player to our tracking map
Players.Add(InPlayer, InPlayer.GetPlayerEntity())
// Give them their first weapon (Pistol)
GrantWeapon(InPlayer, 0)
// 4. Handle an Elimination
OnPlayerEliminated(InEliminated: player, InKiller: player) -> void:
// InKiller is the person who got the kill.
// InEliminated is the person who died.
// Check if the killer is valid (sometimes a player can die without a killer, like fall damage)
if InKiller != void:
// Determine which team the killer is on
KillerTeam := InKiller.GetTeam()
// Get the killer's current tier
CurrentTier := if KillerTeam == TeamRed, TeamRedTier, TeamBlueTier
// Increment the tier (next weapon)
NewTier := CurrentTier + 1
// Update the global tier for that team
if KillerTeam == TeamRed:
TeamRedTier = NewTier
else:
TeamBlueTier = NewTier
// Grant the next weapon
GrantWeapon(InKiller, NewTier)
// Check for Win Condition
CheckWinCondition(InKiller.GetTeam())
// 5. Grant Weapon Helper Function
// Think of this as a mini-recipe for giving items
GrantWeapon(InPlayer: player, Tier: int) -> void:
// Make sure the tier isn't higher than our weapon list
if Tier >= len(Weapons):
Tier = len(Weapons) - 1 // Cap at the last weapon
WeaponName := Weapons[Tier]
// Find the Item Granter that corresponds to this weapon
// In a real build, you'd link this to specific device IDs,
// but for simplicity, we'll assume a generic grant logic here.
// Note: In actual UEFN, you'd use Device methods.
// For this tutorial, we simulate the logic concept.
Print(&"{InPlayer.GetPlayerName()} got {WeaponName}!")
// Real Verse code would look like:
// ItemGranterDevice.GrantItem(InPlayer, WeaponName)
// 6. Check Who Won
CheckWinCondition(WinningTeam: team) -> void:
// Get the number of players alive on the losing team
LosingTeam := if WinningTeam == TeamRed, TeamBlue, TeamRed
PlayersAlive := 0
// Loop through all players in our map
for EachPlayer: player <- Players:
if EachPlayer.GetTeam() == LosingTeam:
// If the player is alive, count them
// (In real code, we'd check health > 0)
PlayersAlive++
if PlayersAlive == 0:
Print(&"Team {WinningTeam} Wins!")
EndGame(WinningTeam)
Walkthrough: What Just Happened?
class(creative_game): This tells Verse, "I am making a game controller." It’s like placing a Game Settings device, but instead of clicking checkboxes, you’re coding the behavior.Map<player, entity>: This is your roster. It keeps track of who is in the game. If you remove a player from the map, they’re gone from the game logic.Subscribe: This is the magic. Instead of checking "Is someone dead?" 60 times a second, we subscribe to the "Player Died" event. Verse callsOnPlayerEliminatedonly when it actually happens. It’s like having a referee who blows the whistle only when a foul occurs, rather than watching every player every millisecond.if/elseLogic: We use simple logic to decide which team’s weapon tier to update. If Red kills, Red’s tier goes up. If Blue kills, Blue’s tier goes up.CheckWinCondition: We loop through thePlayersmap. If the losing team has zero players left, we callEndGame.
Try It Yourself
The code above is a skeleton. To make it work in UEFN, you need to connect the dots.
Challenge:
The GrantWeapon function is currently just printing a message. Your job is to make it actually give the player the weapon.
Hint:
- Place Item Granter devices in your level. Name them
Weapon_0,Weapon_1,Weapon_2, etc. - In Verse, use
GetDeviceto find the specific Item Granter device by name. - Call the
.GrantItem()method on that device, passing theInPlayerand theWeaponName.
Bonus Challenge:
Add a "Respawn" timer. When a player dies, wait 5 seconds, then spawn them back at their team’s pad. (Hint: Look up Delay or Timer events in Verse).
Recap
You’ve just built the brain of a Team Elimination game. You learned that:
- Entities are the objects in your world.
- Events let you react to gameplay moments (like eliminations) without constant checking.
- Maps help you track players and their stats.
- Logic (if/else) allows you to make decisions based on team colors and scores.
Now go forth and make some chaos. The only limit is your imagination (and the weapon list).
References
- https://dev.epicgames.com/documentation/en-us/fortnite/team-elimination-1-setting-up-the-level-in-verse
- https://dev.epicgames.com/documentation/en-us/fortnite/team-elimination-game-in-verse
- https://dev.epicgames.com/documentation/en-us/fortnite/team-elimination-6-handling-a-player-joining-a-game-in-progress-in-verse
- https://dev.epicgames.com/documentation/en-us/fortnite/triad-infiltration-01-setting-up-the-level-in-verse
- https://dev.epicgames.com/documentation/en-us/uefn/create-your-own-device-in-verse
Verse source files
- 01-standalone.verse · standalone
Turn this into a guided course
Add team-elimination-1-setting-up-the-level-in-verse to your free study plan — we'll suggest related pages and stitch the lot into one compile-checked, self-guided lesson with worked examples and quizzes.
References
Original tutorial generated by Verse Island from the Verse/UEFN knowledge base, with references to the Epic Games sources above. Code is validated against the knowledge base.