How to trace a dependency: a 5-minute workflow instead of an hour
The three previous articles gave you individual tools: how to read a header, how to read an implementation, how to understand a module boundary. This article is not about a new tool — it's about how to assemble all three into a single workflow: open a genuinely unfamiliar engine file and, in five minutes, understand enough to keep moving forward, instead of an hour of wandering. This is the last article of Level 0 — after this, Level 1 begins, and there you will be reading engine source on every page.
Here dependencies are traced through existing, someone else's engine code. The "C++ Architecture" stage in Learning covers the same idea — coupling, cohesion, dependency direction — from the other side: there you first learn to consciously design dependencies between your own classes, and only then, on that foundation, it becomes easier to recognize them in a file written by someone else.
01What is it?
Dependency tracing is the ability to answer two mutually inverse questions about any place in code: "who calls this function" (call site tracing) and "what does this file depend on in order to compile at all" (through #include and module dependencies). Together, these two questions and the three skills from the previous articles combine into a concrete, repeatable algorithm for understanding an unfamiliar file.
02Why does it exist?
The problem
You're debugging a bug: a character sometimes spawns without an owner (Owner). The stack trace leads you to AActor::SetOwner() — the implementation is short, ten lines, you read it in a minute (the skill from the article about .cpp). But the function itself doesn't explain the bug — the problem is not what SetOwner does, but who calls it and when, and that's where the previous three articles don't directly help: they teach you how to read a file that's already open, not how to find which files are even worth opening.
SetOwner is a method of AActor, which means there are theoretically hundreds of potential call sites in the four-plus million lines of engine source. Simply opening Actor.cpp and looking at the function's implementation doesn't solve this problem at all — there's no list of callers there. How will you search without reading the whole engine line by line?
The reason
C++ and Unreal's compilation model don't store a centralized, human-readable list of "who calls whom" anywhere — this information is physically scattered across thousands of files and can only be recovered through the index your IDE builds (Rider, Visual Studio with the extension), or manually through text search. Knowing "where to look" is exactly the kind of knowledge that doesn't appear on its own just from the ability to read a single file: engine code is organized by functionality (what this system does), not by call graph (who uses it), and these are two fundamentally different slices of the same code.
03What problem it solves
The workflow turns "no idea where to start" into a concrete, reproducible sequence of a few actions, each of which takes seconds when you have an indexed project — and fits into a few minutes even manually, through grep, if for some reason there's no indexing.
04How it works
Constraints: the five-minute budget is not a metaphor
On a real task (a bug, a code review, assessing the consequences of a refactoring), you usually don't have an hour for a single file — you have a few minutes before it's worth either going deeper or deciding that what you've already learned is enough to answer the question. The workflow must produce a useful result at every step, not only at the end of all five minutes — if you're interrupted in the third minute, you should already have partial, useful understanding, not nothing.
The solution: five steps, each a tool from its own article
Step 1 (30 sec) — WHERE AM I? reading-headers: open the .h, read
the signature, the Epic comment, understand the contract
Step 2 (60 sec) — WHAT DOES IT DO? reading-cpp-and-macros: three passes
through the .cpp, separate noise/protection from logic
Step 3 (90 sec) — WHO CALLS IT? Call site tracing: Find Usages / grep
by function name
Step 4 (60 sec) — WHERE IS THIS EVEN ACCESSIBLE FROM? public-vs-private-modules:
check which module the file is in,
and the calling code, and whether there's
a declared dependency between them
Step 5 (60 sec) — WHAT DO I KNOW NOW? Summarize everything into one sentence:
"function X does Y, is called from Z
under condition W, is accessible to module M
because it depends on module N"
Let's break down steps 3 and 4 in detail — the two new tools of this article; steps 1, 2, and 5 are already familiar or obvious from the previous articles.
Step 3: how to find callers (call site tracing)
The fastest way is the IDE's "Find Usages" / "Find All References" command (Rider: Alt+F7, Visual Studio: Shift+F12) on the function name — provided the project is indexed with the engine source included, not just your game module. It finds calls semantically (accounting for overloads and virtual overrides), not by text.
When there's no index or the IDE can't handle it (for example, the call goes through a function pointer or a Blueprint graph invisible to static C++ analysis) — a fallback but reliable method: text search for the function name across the entire source tree (grep -rn "->SetOwner(" Engine/Source or the IDE equivalent). It produces more noise (it will find declarations and comments too), but it won't miss a single real call, because it doesn't depend on whether the analyzer managed to build a semantic model of the code.
A text search for ->SetOwner( in Engine/Private actually returns (among others) these three lines:
PC->PlayerState->SetOwner(PC);
ThisActor->SetOwner(NULL);
AnimCameraActor->SetOwner(nullptr);
Already from these three lines, without reading the files themselves in full, you can see something meaningful: SetOwner is used both to set an owner (GameMode.cpp — PlayerState receives the controller as its owner) and to explicitly reset it (LevelActor.cpp, PlayerCameraManager.cpp — the owner is cleared, likely at the end of the actor's lifecycle). The list of calling files is itself already a hint about which engine systems this function is actually used in (Gameplay Framework, level management, camera), even before you've opened any of them in detail.
Step 4: where is this even accessible from — checking the module boundary
Having found the calling file, the next natural question (after the previous article it should arise automatically): which module is it in, and which module is the thing it calls in? If both are in the same module — the question is closed, the dependency is trivial. If they're in different modules — it's worth taking one glance at the calling module's .Build.cs to confirm the dependency is declared, and to understand whether it's public or private — this directly tells you whether Epic expects other modules to know about it too, or whether it's an internal detail of a specific system.
For our example: both GameMode.cpp and Actor.cpp (where SetOwner is declared) are in the same module, Engine — the dependency is intra-module, so no additional Build.cs questions arise. If the calling file turned out to be, for example, in a game plugin's module, it would be worth looking at its Build.cs and checking: is the dependency on Engine declared as Public or Private, and does that make sense for the plugin's own role.
The list of a function's callers is an informal but living documentation of its real usage, one that can't go stale the way a comment goes stale: a comment can lie for years, while the list of call sites always reflects the code that actually compiles right now. When Epic's official comment above a function seems incomplete or ambiguous, the first thing I look at is not the documentation but the real calls — they almost always disambiguate what the comment left as "depends on the situation."
Putting it all together: a complete pass through an unfamiliar function
Let's apply all five steps to SetOwner in full, without skipping a single one — here's what a real result of such a pass looks like, condensed into five sentences:
Step 1 (.h): the signature is void SetOwner(AActor* NewOwner), the comment describes Owner as gameplay, not structural ownership (unlike Outer — the UObject article in Level 1 covers the difference in detail). Step 2 (.cpp): a short function — removes registration from the old owner, assigns the new one, marks the actor "dirty" for the network (replication). Step 3 (call sites): actually called both to set (PlayerState receives the controller-owner in GameMode) and to explicitly reset when the actor is destroyed/reparented. Step 4 (module): all found calls are inside the Engine module, so no additional Build.cs check was needed. Step 5 (conclusion): Owner is not a cosmetic field but a mechanism actively used by Epic for network relevance and logical ownership, one that is explicitly cleared when the connection is broken, rather than simply left hanging.
05When to use this process — and when not to
| A full pass is appropriate when… | It's not worth using when… |
|---|---|
| The file/function is genuinely unfamiliar, and the answer will influence a decision (a bug, a refactoring, choosing an API for your own code) | The question is answered by a single line of Epic documentation or a direct answer from a colleague — the five steps make sense when no faster source of an answer exists, not as a default ritual |
| You need to understand the consequences of changing an existing engine function (how safe it is to touch if you're writing a plugin that patches the engine) | The function is trivial and its entire meaning is visible from its signature alone (a getter like GetActorLocation()) — tracing a getter's call sites is almost never necessary |
How this can be misused
Tracing manually, file by file, instead of a single Find Usages call or a single grep command — that's not thoroughness, that's wasted time: if the tool that answers "who calls X" in seconds is already on your screen, opening neighboring files "just in case" and reading them linearly in search of a call is the same naive approach the .cpp reading article started with, just moved one level up, from a file to the whole project. The five steps exist so you don't read more than necessary, not to give you a formal excuse to read more.
06Typical mistakes
A text search for SetOwner( will find both calls to AActor::SetOwner and any other function with the same name in an unrelated class, if one happens to exist in the project — while the semantic Find Usages in the IDE is more precise in this situation, because it distinguishes functions by class and signature, not just by the text of the name. Before trusting the results of a text search, it's worth quickly checking the context (the type of the object to the left of ->) for at least the first few found lines.
Having found a single call to SetOwner(nullptr) and deciding that "the function is only used for resetting," it's easy to draw a wrong conclusion about the architecture — in reality there are usually several real usage scenarios, and they reflect different, unrelated engine systems (in our example — Gameplay Framework, level logic, and the camera). The correct practice is to look through all or almost all found calls before drawing a conclusion about "how this function is typically used."
07Practice: a complete pass in 5 minutes
UActorComponent::Activate(bool bReset) (Engine/Classes/Components/ActorComponent.h / Engine/Private/Components/ActorComponent.cpp) and go through all five steps on your own, timing yourself: (1) read the signature and the comment in the header; (2) read the implementation in the .cpp in three passes; (3) find at least three real call sites via Find Usages or grep across the project/engine; (4) for each found call site, check whether it's in the same module as ActorComponent.cpp, and if not — look at the Build.cs; (5) formulate the conclusion in one paragraph, as in the SetOwner example above.
Show the expected line of reasoning
The header typically describes Activate as turning on a component that was turned off via Deactivate, with the bReset parameter controlling whether to reset the component's internal state upon activation. The implementation in the .cpp is short, with a check of bIsActive (protection against re-activating an already active component) and broadcasting the OnComponentActivated event to subscribers (the logic).
Call sites will be found primarily inside the engine itself — where components are enabled/disabled by gameplay logic (for example, ability, collision, and particle components turned on/off based on gameplay conditions), and in your own game code, if you've already written components with manual activity management.
The concluding paragraph should tie all five steps into one coherent explanation: what the function does, why the bReset parameter is needed (what the behavioral difference is with and without it), and in which systems it is actually used — rather than just restating the signature from the header.
08Frequently asked questions
No — C++ semantic analysis doesn't see the Blueprint graph; it exists in a separate, non-C++ representation (assets, not source code). If a function is marked BlueprintCallable, its actual usage in the project may include calls from Blueprint that Find Usages physically won't show — the only reliable way to check this in a large project with Blueprint logic is searching for the function name inside the editor itself (Reference Viewer / Find in Blueprints), which is a separate, non-C++ tool.
Don't try to review them all — look for diversity, not completeness: open three to five results from different modules/subsystems and stop as soon as you can see that new findings repeat an already understood usage pattern. The five-minute budget is deliberately not designed for an exhaustive review — it's designed for understanding sufficient to make a practical decision.
Yes, and it's the exact same skill, unchanged — "who calls this function of my own class" and "which modules does my file physically depend on" are equally useful in a code review before refactoring your own code, not only when reading the engine. That's exactly why this skill is not a one-off trick for reading someone else's code but a working habit for the entire rest of the encyclopedia.
09What the reader should start noticing
Faced with an unfamiliar engine function, you stop asking yourself "where do I start" — you already have a concrete, practiced five-step sequence, and the question sounds different: "which step am I on, and what do I need to learn next."
The list of callers (call sites) starts to be perceived as a source of knowledge on par with the function's code itself — sometimes even more reliable, because it can't lie the way a stale comment can.
The file path and the Build.cs structure, which before the Public/Private article looked like a technical formality, now read as part of a substantive answer to the question "where is this even accessible from" — rather than just as build settings.
10Summary
- ✔ get through an unfamiliar engine file in 5 minutes using a concrete five-step algorithm, not guesswork
- ✔ find all callers of an arbitrary function via Find Usages or grep, including a fallback plan for when there's no index
- ✔ distinguish semantic search (Find Usages) from text search (grep) and know when each is more reliable
- ✔ check the module boundary between the calling and called code and understand what it says about the architecture
- ✔ avoid drawing conclusions about a function's usage from a single found call site
- ✔ apply the same process to your own code, not just the engine
The four articles of this sub-section (how to read a header, how to read an implementation, where the module boundary lies, how to trace a dependency) together deliver exactly what was promised at the start of the level: you can physically navigate engine files without yet knowing what a UObject is.
Next comes Level 1 — and there you will be reading engine source on every page, but the articles' focus changes: not "how to find and read this file" but "why it's written exactly this way." The next article, about UObject, will open up the real, working UCLASS() macro much the same way you already know how to open any other engine macro — but now it will explain not "how to read it" but "why Epic designed it that way in the first place." The navigation tool you've just acquired becomes background from this point on — it simply works while the encyclopedia explains the reasons.
Material prepared for UE C++ Academy. Original article — uecppacademy.com. If this material helped you understand Unreal Engine, you can support the project's development.
© 2026 UE C++ Academy. All rights reserved. For copyright or technical issues — support@uecppacademy.com