Skip to content
Get App

THIS ENEMY IS TERRIFYING #shorts #gamedev #indiegame #unrealengine #horrorgaming #gaming #indiedev

A dev shows how to build a smooth, physics-based horror worm enemy by swapping heavy pill colliders for distance-constrained dots, using a distance field and spatial grid, a trick inspired by Hitman's

Key Takeaways

  • Replacing rigid-body colliders with simple distance-constrained particles drastically reduces physics cost.
  • Baked distance fields provide cheap collision with level geometry.
  • Spatial partitioning is essential to avoid quadratic particle-to-particle collision checks.
  • Simple per-particle AI goals can produce emergent, convincing enemy behavior.

What the video covers

  • A single stiff worm is first made physical by adding 12 pill-shaped colliders joined by joints.
  • Spawning 500 worms creates 6,000 colliders that overwhelm the CPU.
  • The solution replaces pills with dots connected by a string, so dots only get pushed back when stretched too far.
  • A distance field (3D grid of nearest-surface distances) bakes the level geometry so dots can be pushed out of walls cheaply with a single lookup.
  • Dot-to-dot collision would require about 32 million checks per frame, so a spatial grid limits checks to nearby cells.
  • Each dot's AI is reduced to one goal: crawl toward the player.
  • The resulting pile can climb walls, wrap pillars, and reconverge when exploded.
  • The technique is credited to Hitman's approach for dead bodies, applied here to a horror enemy.

Answers

Questions about this video

Why does the creator replace the pill colliders with dots?

Six thousand pill colliders spinning and colliding overwhelm the CPU with 500 worms. Replacing them with dots connected by a string means the dots cannot tip or spin, so the CPU only needs to correct a dot when it stretches too far from its neighbors.

How does the distance field stop worms from clipping into the floor?

The level is baked into a 3D grid where each cell stores the distance to the nearest surface. Each dot reads one value, and if it is negative the dot is inside geometry and gets pushed out.

How does the spatial grid solve the dot collision problem?

Checking every dot against every other dot would require about 32 million checks per frame. Dividing the level into a grid lets each dot check only dots in nearby cells, which keeps the game running smoothly.

Full Transcript — Download SRT & Markdown

00:00
Speaker A
This horror game enemy is terrifying, and those [music] physics should be nuking your frame rate. But you used a trick from a 26-year-old Hitman game to make it completely smooth. You start by adding a single worm, but on its own, it's completely
00:15
Speaker A
stiff. You decide to add physics by making the worm a junkie, and cramming 12 pills into its body, each connected with a joint and with its own collider.
00:23
Speaker A
But when you spawn 500 worms, you see an [music] immediate problem. 6,000 pill colliders all spinning and bumping into each other just gave your CPU a stroke.
00:32
Speaker A
You need a different physics approach. So, you send your worm to rehab and replace the pills with dots [music] connected by a string. The dots can't tip or spin, so your CPU only has to shove a dot back if it moves too far
00:44
Speaker A
from its neighbors. To stop the worms from no clipping into the floor, you bake the level into a distance field, a 3D grid, where every spot in the level knows how close the nearest surface is.
00:54
Speaker A
Each dot looks up one number, [music] and if it's negative, it's inside something, so you push it out. The worms are still clipping into each other, which means every dot also needs [music] to check every other dot, but that's 32
01:05
Speaker A
million checks per frame. To save your CPU, you chop the level into a grid and make each dot only check other dots in nearby cells. Now you're running smoothly. But what about the AI? Worms are idiots, so you give every dot of
01:18
Speaker A
every worm only one goal. Crawl toward the player. Now the pile can climb walls, wrap around pillars, and converge back together when you try to explode it. Congrats. You've created a nightmare with the same trick Hitman used for its
01:30
Speaker A
dead bodies.
Topics:gamedevindiegameunrealenginehorrorgamingphysicsprocedural animationdistance fieldHitmanshortsindiedev

Get More with the SozAI App

Transcribe recordings, audio files, and YouTube videos — with AI summaries and speaker detection. 30 minutes free.

Or transcribe another YouTube video here →