The Ultimate Party Game Manager: Stop Copy-Pasting Code
Tutorial beginner

The Ultimate Party Game Manager: Stop Copy-Pasting Code

Updated beginner

The Ultimate Party Game Manager: Stop Copy-Pasting Code

So, you’ve built a mini-game. It’s awesome. But now you want to build a second one. And a third. Do you really want to rewrite the same logic for spawning players, tracking scores, and switching between the lobby and the game arena every single time? That’s like manually placing every single brick in a build fight instead of just hitting the edit key. It’s tedious, it’s error-prone, and it’s boring.

In this tutorial, we’re going to build a Reusable Game Manager. Think of this as your island’s central nervous system. It’s a single Verse script that controls the flow of the entire experience: the voting phase, the gameplay loop, and the results screen. We’ll use it to create a simple "Capture the Flag" style mini-game where players spawn, grab a point, and get teleported back to the hub when the timer runs out. By the end, you’ll have a system you can drag into any new island and just tweak the settings, not the code.

What You'll Learn

  • The Scene Graph Hierarchy: How to organize your island’s objects (entities and components) so your code can find them without getting lost.
  • Editable Objects: How to make your Verse script read settings directly from the editor, so you can change game rules without touching the code.
  • State Management: Using a simple variable to track whether the game is in "Lobby," "Playing," or "Finished" mode.
  • Player Spawning & Scoring: A basic pattern for giving players items and tracking who wins.

How It Works

Before we write a single line of Verse, let’s look at the game loop. Most party games follow a strict rhythm, like a battle royale match:

  1. The Lobby (Voting): Players are stuck in a safe zone. They can’t move much. The game is deciding what happens next.
  2. The Game (Action): The safe zone disappears. Players are spawned into the arena. Items appear. Scores go up.
  3. The Results (Hub): Time’s up. The game figures out who won. Players are teleported back to the start to vote again.

In programming terms, we call these States. A state is just a variable that holds a single word describing what’s happening right now. If GameState == "Playing", we let players move. If GameState == "Lobby", we freeze them.

The Scene Graph: Your Island’s Family Tree

In Unreal Engine 6 (and Verse), everything in your world is part of a Scene Graph. Imagine your island is a family tree.

  • The Root is the whole island.
  • Entities are the family members (players, props, devices).
  • Components are the skills or traits those members have (a mesh to look at, a trigger zone to detect hits, a script to think).

When you write Verse, you aren’t just typing magic spells; you are reaching into this family tree and pulling levers on specific components. For our Game Manager, we need to access three specific "family members":

  1. The Spawner: A device that creates players at specific coordinates.
  2. The Scoreboard: A system that keeps track of points.
  3. The Timer: A device that counts down.

Editable Objects: The "Settings" Menu

Here is the secret sauce: Editable Objects.

Normally, if you want to change a number in your code (like how long the game lasts), you have to open the code, change the number, save, and reload. That’s annoying.

An Editable Object is a special type of variable in Verse that lets you change values directly in the UEFN editor, just like you change a prop’s color. You define the variable in Verse, and then UEFN gives you a little input box in the "Details" panel for that specific device. You can set the game time to 60 seconds in one island and 120 seconds in another, using the exact same code.

Let's Build It

We are going to build a simple manager that:

  1. Waits for a "Start Game" signal.
  2. Spawns players into an arena.
  3. Waits for a timer to hit zero.
  4. Ends the game.

Step 1: Set Up Your Verse Device

  1. In UEFN, place a Verse Device in your world (it doesn’t matter where, it’s invisible).
  2. Select it and go to the Details panel.
  3. Click Add Editable to create a new variable. Let’s call it GameStartTime. Set the type to Float (a decimal number). This will be how many seconds the game lasts.
  4. Create another Editable called ArenaSpawnLocation. Set the type to Vector. This is where players will appear.
  5. Create another Editable called ArenaSpawnRotation. Set the type to Rotator. This is which way they face.

Note: In real UEFN, you’d also link this device to a "Start Game" trigger, but for this tutorial, we’ll simulate that with a simple function call to keep the code focused on the Manager logic.

Step 2: The Verse Code

Here is the complete, annotated Verse script for our Game Manager. Copy this into your Verse Device.

# This is the main script for our Reusable Game Manager.
# It controls the flow from Lobby -> Game -> Results.

# We define a "State" variable. 
# Think of this like the "Storm Phase" in Battle Royale.
# It can only be one thing at a time: Lobby, Playing, or Finished.
CurrentState := "Lobby"

# This is our "Editable Object" for the timer.
# You can change this number in the UEFN editor without touching code.
GameDuration := 60.0 # Seconds

# This is a "Function". 
# Think of it like a specific move in a fighting game.
# When we call this function, the code inside runs.
StartGame := func():
    # 1. Update the State
    CurrentState = "Playing"
    
    # 2. Announce to the chat (optional, but fun)
    Print("Game Started! Go go go!")
    
    # 3. Start the timer loop
    StartTimer()

# This function handles the countdown.
# It’s like a storm timer that shrinks the zone.
StartTimer := func():
    # We wait for the duration set in the Editable Object
    Wait(GameDuration)
    
    # When time is up, switch states
    CurrentState = "Finished"
    Print("Time's Up! Back to Hub!")
    
    # Here you would add code to teleport players back to the hub
    # and update the score display.
    EndGame()

# This function is called when the game ends.
EndGame := func():
    # Reset the state so the manager is ready for the next round
    CurrentState = "Lobby"
    
    # In a real island, you’d trigger the "Hub" devices here
    # e.g., DisableArenaDevices()
    # e.g., EnableHubDevices()

# This is the "Event Handler". 
# Think of this like a "Trigger Volume" that listens for a signal.
# In a real setup, you’d bind this to a "Start Game" device.
# For this demo, we’ll just call StartGame() manually to show it works.
OnBegin := func():
    # When the island starts, we are in the Lobby
    CurrentState = "Lobby"
    Print("Lobby Active. Waiting for players...")
    
    # SIMULATION: In your actual island, you wouldn't call this here.
    # You would wire a "Start Game" device to call StartGame().
    # But for testing, let's start it immediately.
    StartGame()

Walkthrough: What Just Happened?

  1. CurrentState: This is our Variable. It’s a container that holds a string (text). It’s like a traffic light. It’s either Red (Lobby), Green (Playing), or Yellow (Finished).
  2. GameDuration: This is our Editable Object. Because we marked it as editable in UEFN, you can go into the editor, click the Verse Device, and change 60.0 to 30.0 or 120.0. The code doesn’t care; it just waits that long.
  3. StartGame: This is a Function. It’s a block of code we can run whenever we want. It changes the traffic light to Green and starts the clock.
  4. Wait(GameDuration): This is a Verse API that pauses the script. It’s like the cooldown on a super ability. The script stops doing anything until the time passes.
  5. OnBegin: This is a special Event. It runs automatically when the island loads. It’s like the "Battle Bus" taking off—you don’t call it, it just happens.

Try It Yourself

Now that you have the basic structure, it’s time to make it useful. Here is your challenge:

The Challenge: Right now, our manager just prints messages. We want to actually spawn players when the game starts.

  1. Place a Player Spawn Point device in your arena.
  2. In your Verse Device, add an Editable Object called SpawnPoint and set its type to PlayerSpawnPoint. Link it to the device you just placed.
  3. Modify the StartGame function to actually spawn the players using the SpawnPoint.

Hint: Look up the Player Spawn Point device in the UEFN documentation. You’ll find a method like SpawnPlayers() or similar. You need to call that method on your SpawnPoint variable inside StartGame().

Don’t forget to reset the players to the lobby after the game ends!

Recap

You’ve just built the backbone of a party game island. You learned how to use Variables to track game states, Editable Objects to make your code flexible, and Functions to organize your logic. This Reusable Game Manager can now be copied into any new island project. You just change the GameDuration, link a new SpawnPoint, and you’re ready to play. No more copy-pasting the same timer code over and over. You’re not just playing Fortnite anymore; you’re directing it.

References

  • https://dev.epicgames.com/documentation/en-us/uefn/party-game-4-manager-in-unreal-editor-for-fortnite
  • https://dev.epicgames.com/documentation/en-us/fortnite/party-game-4-reusable-game-manager-in-unreal-editor-for-fortnite
  • https://dev.epicgames.com/documentation/en-us/uefn/party-game-0-in-unreal-editor-for-fortnite
  • https://dev.epicgames.com/documentation/en-us/fortnite/party-game-in-unreal-editor-for-fortnite
  • https://dev.epicgames.com/documentation/en-us/uefn/party-game-in-unreal-editor-for-fortnite

Verse source files

Turn this into a guided course

Add Reusable Game Manager 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.

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.

Comments

    Sign in to vote, comment, or suggest an edit. Sign in