The Debugging Bus: How to Stop Guessing and Start Seeing in Verse
Tutorial beginner

The Debugging Bus: How to Stop Guessing and Start Seeing in Verse

Updated beginner

The Debugging Bus: How to Stop Guessing and Start Seeing in Verse

So, you’ve built a trap that’s supposed to launch players into the stratosphere, but instead, nothing happens. Or worse, it crashes the island every time someone steps on it. You’re staring at your code, wondering if you’re missing something obvious.

In traditional game dev, you might use a "console" to see what’s happening. In Verse, we have Logging. Think of logging as the in-game chat that only you can see. It’s your secret backchannel with the engine, telling you exactly where your logic is breaking, what values your variables hold, and whether your code is even running. No more guessing. No more hoping. Just raw, unfiltered truth.

What You'll Learn

  • What a Log is and why it’s better than yelling at your screen.
  • How to set up a Log Channel (your personal debug folder).
  • How to Print messages to see what’s happening inside your functions.
  • How to use logs to debug a simple "Revenge Trap" scenario.

How It Works

Imagine you’re playing a match. You have a teammate who is constantly giving you updates: "Enemy at 12 o'clock," "Low on shields," "Bus is landing here." Without those updates, you’re flying blind.

In Verse, your code runs silently. If a variable is 0 when it should be 100, the code doesn’t scream. It just keeps going, doing the wrong thing perfectly. Logging is that teammate. It’s a way to pause the action for a split second and print a message to a special window (the Output Log) so you can check your work.

The Key Concept: log_channel

Before you can send messages, you need a "channel." Think of a log_channel like a specific radio frequency. If you have a complex island with a trap system, a score system, and a loot system, you don’t want their debug messages mixed together. You want your trap messages on one channel and your score messages on another.

By creating a custom class that inherits from log_channel, you create a dedicated folder for your debug notes.

The Key Concept: Logger.Print

Once you have a channel, you create a Logger object and tell it to Print. This is like hitting the "Send" button on a message. You can print text, variable values, or error messages. The engine takes that text and dumps it into the Output Log window in UEFN, where you can read it while the game runs.

Let's Build It

We’re going to build a simple "Revenge Trap." When a player steps on a trigger, the trap should activate. But right now, we suspect the trigger isn’t working. We’ll use logging to prove whether the code is even being called.

Step 1: Set Up the Channel

First, we need to import the Diagnostics library and create our channel. This goes at the top of your Verse file.

using { /UnrealEngine.com/Temporary/Diagnostics }
using { /Fortnite.com/Devices }
using { /Verse.org/Simulation }

# This creates our dedicated "debug radio frequency"
class RevengeTrapLog<public>(log_channel)

Step 2: The Trap Logic with Logs

Now, let’s look at the device. We’ll use a Trigger device. When a player enters it, we want to print a message to our log channel.

Walkthrough: What Just Happened?

  1. using { /UnrealEngine.com/Temporary/Diagnostics }: This is like picking up the radio. It gives us access to the logging tools.
  2. class RevengeTrapLog<public>(log_channel): We defined our channel. It’s empty, but it exists. It’s our dedicated debug folder.
  3. Logger := log{Channel := RevengeTrapLog}: We created a specific logger instance attached to our channel.
  4. Logger.Print("..."): We sent a message. When you run this in UEFN, open the Output Log window (View > Output Log). You’ll see:
    • Revenge Trap: System Armed. Waiting for victims...
    • (When you step on the trigger) Revenge Trap: Target Acquired! Boom!

If you don’t see "System Armed," your code isn’t even starting. If you don’t see "Target Acquired," your trigger isn’t firing. The logs tell you exactly where the problem is.

Try It Yourself

Challenge: Modify the RevengeTrapDevice to print the player’s name when they trigger the trap.

Hint: The TriggerDevice.Triggered event often provides information about who triggered it. Look for a property on the triggered event that gives you the PlayerCharacter. Use string interpolation (like "Hello, {Name}!") to include the name in your log message.

Don’t worry if it crashes at first—logs are your safety net! Print the player object first to see what data is available.

Recap

  • Logging is your best friend for debugging Verse code.
  • Use a log_channel to keep your debug messages organized.
  • Use Logger.Print to send messages to the Output Log.
  • Logs help you verify if your code is running and what values your variables hold, so you can fix bugs faster than you can respawn.

References

  • https://dev.epicgames.com/documentation/en-us/uefn/verse-prop-hunt-template-4-setting-up-teams-and-classes-in-unreal-editor-for-fortnite
  • https://dev.epicgames.com/documentation/en-us/fortnite/sorting-algorithms-in-verse
  • https://dev.epicgames.com/documentation/en-us/uefn/sorting-algorithms-in-verse
  • https://dev.epicgames.com/community/snippets/bO9r/fortnite-matrices
  • https://dev.epicgames.com/documentation/en-us/fortnite/verse-api/unrealenginedotcom/temporary/diagnostics/log

Get the complete code — free

You've read the full walkthrough. The complete, copy-paste-ready Verse solution is free for members — sign in to unlock it.

Free with your BrainDead.TV / BrainDeadGuild Discord account. The walkthrough above is always free.

Verse source files

Turn this into a guided course

Add fortnite-diagnostics-using-log-class 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