Docs Tutorials
Take apart: Midnight Prowler
Play a stealth heist, then see how guards that take a moment to spot you, hiding spots and an alarm script make a stealth game.
In the editor: Welcome ▸ Tutorials ▸ 4.3 ▸ ▶ Start opens a fresh copy of Midnight Prowler with this lesson's checklist.
Take apart · about 40 minutes · Advanced mode
What you'll learn: how a stealth game is put together: guards with a sight cone and a spot meter, cameras that never move, hiding spots, noise, and one script that runs the alarm and the getaway.
Before you start: do Take apart: Hexbound.
#1. Play it first
Open Midnight Prowler from the sample games on the welcome window's Start tab (or File ▸ New Project… and pick it) and press F5. In the Roost, take a job at the board. Watch the cones on the floor and the meters over the guards' heads. Hide in a wardrobe, throw a Tin coin to pull a guard away, grab loot, and press E at the green way out. Get caught once on purpose to see the lockup.
#2. Read the notes
Stop with Shift+F5 and open Explorer ▸ Notes. Read the note on the project first: it lists every rule of a job.
#3. A guard who takes a moment
Open the level Ashby Manor. Its guards are copies of the Guard prefab. Click one with Select (1) and read Properties (its ◆ Prefab card says Guard). Two behaviors make it:
- Patrol path with no stops and a Stroll range (tiles) of 6, so it wanders its room.
- Chase player with a Sight cone (°) of 80, Time to spot (s) of 1.4, Show sight cone and Show spot meter ticked, Hears noises (tiles) and an Attack damage of 1.
This is the pattern. With Time to spot above 0, a guard that sees you stops and looks while its meter fills, faster up close. Only a full meter starts the chase. That pause is what gives the player a chance to slip away.
Now click a camera on a wall (a Security camera copy): it's a Chase player with Speed 0, a narrow cone and When idle set to look around, so it sweeps the room without moving.
#4. Hiding, shadow and noise
Wardrobes, curtains and ferns are Walk-through and tagged hiding: stand in one and a guard can't see you. Deep shadow is tagged shadow, where you take far longer to spot. The Tin coin script calls make_noise() a few tiles ahead, and a guard in earshot walks over to look.
#5. The level is new every job
Open Ashby Manor and press F12. A Dungeon layout, a Locked area with the prize and its keycard, and Scatter nodes for guards, cameras, lasers and loot. In the game is set to New layout every visit, so every job is a new house.
#6. One script runs the job
Open The job (main control) in the Scripts tab. It starts the clock, counts the loot you carry, checks each guard's and camera's state five times a second, and runs the alarm, a capture and the getaway. Small scripts just send messages to it: Tripwire sends alarm and Way out sends get_away.
#7. Change it
- Click a guard in Ashby Manor, raise its Time to spot (s) to 2.5, and click Apply to all in its ◆ Prefab card, so every guard in both jobs gets it.
- In Ashby Manor's generator (F12), raise Max on the guards' Scatter (the one fed by Room centers) and press the dice button (🎲) to see a new layout.
- In The job (main control), change
local JOB_TIME = 240to give yourself more time. - In The lockup (main control), add a line of your own to
MINE, Magpie's mutters.
Play it now: take a job, then get caught and watch Magpie's speech bubbles in the lockup for your line.
#Try it yourself
- Make the camera wider but slower to spot you, and see if the museum gets harder or easier.
- Add a new hiding spot to the generator's Scatter nodes.
- Make the Tin coin's noise reach farther.
#Learn more
- Behaviors and items: every Chase setting, including the stealth ones.
- Generating levels.
- Patrol then chase.
#Next
Get an email when Voxel Game Maker launches
It's coming to Steam with a launch discount. One email on launch day, the odd progress update, nothing else.