Implementing Round Logic and Game Flow
In this lesson you'll learn to
- Explain what a round is in a Fortnite island and why round logic matters
- Create a persistable class to store player round data across rounds
- Use a weak_map to connect each player to their round information
- Write functions to record player finish order and reset data between rounds
🏁 What Is Round Logic?
Imagine you are playing a racing board game. After each lap, you write down who finished first, second, and third. Then the next lap starts — and whoever won gets to start ahead of everyone else. That's round logic!
In Fortnite islands, rounds work the same way. The game needs to remember:
- What round are we on right now?
- In what order did players finish the last round?
We use Verse code to track all of this — and that's exactly what this lesson is about! 🎉
📦 New Word: Class
A class is like a lunchbox. It holds several pieces of information together in one neat container. For example, a player_circuit_info class (circuit = racing track) holds:
- Which round the player last finished
- What place they finished in (1st, 2nd, 3rd…)
💾 New Word: Persistable
Persistable means the data sticks around between rounds — like writing something in permanent marker instead of dry-erase marker. If something is not persistable, it gets erased when a new round starts.
We use <persistable> to tell Verse: "Don't erase this data when the round resets!"
🗺️ New Word: Weak Map
A weak_map is like a hall of lockers at school. Each locker belongs to one player. Inside the locker you store that player's info. When you need to check someone's round info, you look up their locker.
In Verse, a weak_map(player, player_circuit_info) maps (connects) every player to their own player_circuit_info lunchbox.
🔢 What Does -1 Mean?
When a player first joins, they haven't finished any round yet. We set their finish order and round number to -1 as a placeholder — like an empty locker. It means "no real data yet." When the player finishes a round, we replace -1 with a real number.
🔄 New Word: Constructor
A constructor is a helper function that builds a new copy of a class. Think of it like a photocopier for lunchboxes — it copies all the contents, and you can swap out just one item before sealing the new copy. This is handy when you want to update only one field (like finish order) without losing everything else.
🏎️ How the Round Flow Works
Here is the big picture, step by step:
- 🟢 Round Starts — Players spawn at positions based on last round's finish order.
- 🏁 Players Race — The first one to cross the finish line gets recorded as 1st place, and so on.
- 📝 Record Results — We call
RecordPlayerFinishOrderto save each player's place in their locker. - 🔁 Round Ends — We update each player's "last completed round" number.
- 🧹 Next Round Begins — Spawn positions are set using last round's saved finish order. Repeat!
🌳 Scene Graph Tip
In Verse and Unreal Engine, everything on your island is part of a scene graph — a giant family tree of objects. Each device (like a Trigger or a Checkpoint) is a node (a dot on the tree). When you attach a script to a device, that script becomes a component of that node.
Your round-logic script sits at the top of this tree — it watches over ALL the checkpoints and players like a game referee. When a player hits a checkpoint (a child node), it reports up to your script (the parent node), which updates the player's locker in the weak map. This parent-child flow is the scene graph in action! 🌲
Keep going — free
You've read the intro. The rest of this lesson — the worked example, the hands-on exercise, the quiz, and the recap — is free for members. Sign in to continue and track your progress.
New here? The whole Verse Basics track is free with a free account — sign in to start.
© Biloxi Studios Inc. — original Verse Island content.
Turn this into a guided course
Add Implementing Round Logic and Game Flow 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.
🧭 The Keeper's log
Quest complete? Chart your next heading from the Build Your First Game expedition.