Top Down template
A top-down action starter: a hero under a fixed camera in a walled yard, five crates to collect and zombies that hunt by sound, with no compile step.
The Top Down template is a small action game you can open and play. A Quaternius hero runs a walled 44 by 44 metre yard under a fixed camera. Five supply crates glow gold and four zombies hunt whatever they hear. Everything runs on engine classes, Visual Scripting and the shared content packs, so Play works the moment the project opens.
Controls
| Input | Action |
|---|---|
| W A S D, left stick | Move; screen up is north |
| Space, A button | Jump |
| E, X button | Interact |
| Left mouse button | Walk to the point on the ground under the cursor |
Walking to a point
The hero can also be sent to a point on the ground. Call Move To Location on the character from a graph or from C++ with MoveToLocation(point): it walks in a straight line and stops within arriveRadius (0.4 m by default). Pressing a move key cancels it, and Stop Move To Location does the same from a graph. A left click sends the hero there too: the character casts the cursor through the camera onto the floor with Move To Cursor, and groundOffset says how far below the character's origin that floor is. For your own graphs, Deproject Cursor To Ground (on Gameplay Statics) does the same cast at any height and Get Cursor Ground Point reads the result.
How it plays
Walking over a crate collects it and advances the Clear the yard quest, which the HUD shows at the top left. Walking is noisy. A zombie hears your footsteps within its hearing radius, drifts toward the last sound, searches around it and runs at you once its alertness is high. A zombie that touches you sends you back to the start; the crates you took stay taken.
How it is built
| Asset | What it does |
|---|---|
Assets/Scenes/Main.mmap | The yard: Level Prototyping tiles inside grid walls, Zombie Kit cover, a player start, a nav bounds volume the yard bakes on load, five crate pickups and four zombies |
BP_TopDownHero | The player. A Visual Script class on ATopDownCharacter whose defaults name the hero mesh, the locomotion animation graph, the footstep folder and the camera distance and pitch. The engine character builds and animates the body |
BP_TopDownGameMode | Sets the default pawn and starts the quest |
BP_TopDownPickup | A crate: its OnTriggerEnter graph casts the overlapping actor to the hero, advances the objective, plays a chime and destroys the crate |
BP_TopDownZombie | A zombie's trigger: it casts the overlapping actor to the hero and moves the hero back to the start |
Zombie.resident | The hearing profile: how far a zombie hears, how fast its alertness builds and decays and how fast it moves in each stage |
Zombie.animgraph | Idle, Walk and Run over Speed. The engine feeds Speed from the nav agent's velocity |
Make it yours
Move or add crates and zombies in the viewport. A crate is any actor of class BP_TopDownPickup with a Trigger; a zombie is a mesh with an Animator, a NavAgent, a Resident and a Trigger. Change the quest's count and place that many crates, or open Zombie.resident to make zombies deaf or faster. To drive a different character, set meshAsset on BP_TopDownHero to another .glb whose clips match ABP_Locomotion.animgraph.
See Templates for how a template becomes your project.
Engine sources
This page describes behavior implemented in these files of the engine repository, checked against commit 23111c146.
- Templates/TP_TopDown/README.md
- Templates/TP_TopDown/Config/TemplateDefs.ini
- Templates/TP_TopDown/TP_TopDown.mproject
- Templates/TP_TopDown/Assets/Blueprints/BP_TopDownHero.vscript
- Templates/TP_TopDown/Assets/Blueprints/BP_TopDownGameMode.vscript
- Templates/TP_TopDown/Assets/Blueprints/BP_TopDownPickup.vscript
- Templates/TP_TopDown/Assets/Blueprints/BP_TopDownZombie.vscript
- Templates/TP_TopDown/Assets/AI/Zombie.resident
- Templates/TP_TopDown/Assets/Quests/ClearTheYard.quest
- Engine/Source/Gameplay/Game/Api/Game/ATopDownCharacter.h
- Engine/Source/Gameplay/Game/Api/Game/ATopDownGameMode.h
- Engine/Source/Gameplay/Game/Api/Game/FGameplayCursor.h