Reader small image

You're reading from  Build Stunning Real-time VFX with Unreal Engine 5

Product typeBook
Published inMay 2023
PublisherPackt
ISBN-139781801072410
Edition1st Edition
Concepts
Right arrow
Author (1)
Hrishikesh Andurlekar
Hrishikesh Andurlekar
author image
Hrishikesh Andurlekar

Hrishikesh Andurlekar is the founder of Tplusplus Interactive, an Unreal Authorized instructor, owner of a Unreal Authorized training center and a Mentor at Mastered UK. He has been a CG Supervisor at Prana Studios and Pixion. He has been working as a contractor/consultant in Unreal Engine for 6 years with leading companies including Reliance Jio Studios, Monk Studios, Prime Focus and True Telecom delivering Games, Simulations, Virtual Production Solutions and AR/VR experiences. He has trained companies around the world through Epic Games. More than 3200 hours of 1-2-1 training conducted for major companies like Technicolor, Yashraj studios, Infosys, Tech Mahindra, TCS, Aptech among others.
Read more about Hrishikesh Andurlekar

Right arrow

Debugging Workflow in Niagara

Niagara particle systems are essentially abstracted pieces of code controlling the behavior and rendering of particle systems. Code has a nasty habit of having bugs in it and we end up spending a lot of time trying to debug that code. In this chapter, we will explore the process of debugging in Niagara.

We will familiarize ourselves with the Debugger panel, which has tools to sift through the particle system data. Then, we will look at data visualization tools that overlay debug data on our systems. We will check some performance profiling features and finally, we will learn a few important console commands to add to our debugging toolset.

This is what we’ll be covering in the chapter:

  • Exploring the Niagara Debugger panel
  • Debug Drawing
  • Performance profiling
  • Debug console commands

Technical requirements

You can find the project we worked on in this book here:

https://github.com/PacktPublishing/Build-Stunning-Real-time-VFX-with-Unreal-Engine-5

Exploring the Niagara Debugger panel

Niagara provides you with a debugger to review particle systems running in your level. The debugger has a bunch of tools to help you look at the simulation data in detail to pinpoint any issues in your particle system.

You can turn on the Debugger panel by going to Tools > Debug > Niagara Debugger.

This will open the dockable Niagara Debugger panel. As with any panel in Unreal, you can dock it to any convenient position.

Figure 10.1: Opening Niagara Debugger

The Niagara Debugger panel has three major areas:

  • The Particle System Playback Options toolbar
  • Debugger tabs
  • Debugger options

This is depicted in the following figure (Figure 10.2):

Figure 10.2: The Niagara Debugger panel

Each of the tabs contains further options. Please be aware that this layout may change in upcoming versions of Niagara.

The Particle System Playback Options toolbar

For diagnostic...

Debug Drawing

For some modules, it is difficult to visualize the properties that the module applies to the particle behavior. It may also not be very clear, from observing the resultant particle behavior, as to what is the contribution of a particular module to that behavior.

In these cases, having the capability of representing such properties in a way that is easy to debug is very helpful. For example, the direction of movement of a particle, the direction in which the force is being applied, and so on can be drawn on top of the particle system render as debug lines to make it clear to the user what exactly is happening in the system. The Debug Drawing feature is available on a few select modules.

We’ll take a look at a few examples.

For our first example, let us create an emitter called NE_DebugDemo using the fountain template.

Figure 10.23: Creating the NE_DebugDemo emitter using the fountain template

We will add a Collision module to this...

Performance profiling

Another way that can help us optimize a particle system is to visualize the impact on the performance of each module in the particle system. This helps us identify modules that are taking more time to evaluate and focus on optimizing them.

In Unreal Engine 5, a new Performance button was added to the Niagara Editor toolbar to help us visualize the impact of each module on the performance of the particle system:

Figure 10.30: The Performance button

This button toggles the display of performance information at a granular level for each of the modules in the Emitter and System nodes. The performance information changes based on the options chosen in the dropdown menu on the Performance button:

Figure 10.31: Choosing what to display when the Performance button is pressed

By default, the Performance button shows the average and the relative values, as shown in Figure 10.32:

Figure 10.32: The...

Debug console commands

While the Niagara Debugger is an excellent tool, we may not need all the features it has. We may want to use the debug features at runtime without the interface, or we may want to be able to log them during gameplay testing, or we may even want to trigger the debug features at certain points in our game to debug specific areas in our games.

We can do all of this and much more with the help of console commands. These commands can be typed in the Unreal Editor console located in the Output Log panel:

Fig. 9.34: Typing the Niagara debug commands in the console

It can also be triggered through the Execute Console Command node in Blueprints:

Figure 10.35: Using the Execute Console Command node in Blueprints to trigger the debug commands

Let us have a look at an example of a console command:

fx.Niagara.Debug.Hud Enabled=1 OverviewEnabled=1

This command by itself can be seen here:

fx.Niagara.Debug.Hud
...

Summary

In this chapter, we learned about the debug toolset offered by Niagara to diagnose issues and performance bottlenecks in our particle systems. We also learned how to generate verbose data and save it in formats that can be further analyzed by external tools. We understood the profiling tools, which present data visually to help audit our particle systems.

In the next chapter, we will look at integrating Blueprints and Niagara Systems. We have already done this at a smaller scale with our Presence Detector particle effect in Chapter 7. Now, we will do a deep dive into it.

lock icon
The rest of the chapter is locked
You have been reading a chapter from
Build Stunning Real-time VFX with Unreal Engine 5
Published in: May 2023Publisher: PacktISBN-13: 9781801072410
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
undefined
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime

Author (1)

author image
Hrishikesh Andurlekar

Hrishikesh Andurlekar is the founder of Tplusplus Interactive, an Unreal Authorized instructor, owner of a Unreal Authorized training center and a Mentor at Mastered UK. He has been a CG Supervisor at Prana Studios and Pixion. He has been working as a contractor/consultant in Unreal Engine for 6 years with leading companies including Reliance Jio Studios, Monk Studios, Prime Focus and True Telecom delivering Games, Simulations, Virtual Production Solutions and AR/VR experiences. He has trained companies around the world through Epic Games. More than 3200 hours of 1-2-1 training conducted for major companies like Technicolor, Yashraj studios, Infosys, Tech Mahindra, TCS, Aptech among others.
Read more about Hrishikesh Andurlekar