
Procedural Spider Locomotion System
Unreal Engine C++ Gameplay Prototype
ROLE
Gameplay Programmer / Technical Designer
Focus
Traversal, procedural animation, surface detection, and player feel.
DESCRIPTION
A focused Unreal Engine C++ gameplay prototype exploring spider-like traversal across floors, walls, and ceilings. The system combines surface detection, orientation alignment, procedural leg placement, and movement tuning to create responsive non-standard locomotion for a player-controlled creature
Timeframe
3 Weeks / Ongoing
Engine
Unreal Engine
Langauge
Blueprint
C++
Status
In Development
PLATFORM
PC
Gameplay System Breakdown
System Goals
-
Enable spider traversal across floors, walls, and ceilings
-
Support AI-controlled movement on non-standard surfaces
-
Keep movement readable during surface transitions
-
Align creature orientation to detected surface normals
-
Use procedural leg placement for believable spider motion
-
Build the system in C++ as a reusable locomotion prototype
System Implementation
C++ Surface-Aligned Locomotion
-
Built a surface-aligned locomotion system for AI spider movement
-
Used traces to detect floors, walls, ceilings, and valid traversal surfaces
-
Aligned the spider’s orientation to the current surface normal
-
Projected movement direction relative to the active traversal surface
-
Added procedural leg placement to support believable creature motion
-
Tuned movement speed, rotation smoothing, and transition behavior
-
Added optional player control for testing and debugging the system
AI Locomotion Design
-
Designed primarily for AI-controlled creature traversal
-
Prioritized believable spider behavior over standard character movement
-
Tuned wall and ceiling movement to avoid unstable or random motion
-
Focused on readable silhouettes so players could understand the spider’s path
-
Supported both autonomous AI behavior and player-controlled testing
-
Balanced procedural motion with gameplay clarity
System Demo
A C++ AI locomotion system that supports spider traversal across floors, walls, ceilings, and uneven terrain using surface detection, custom gravity, and procedural leg placement.
Full Breakdown
Surface Detection

Video demonstration of surface detection
within the climbing system

Visualization of trace placement and the resulting surface direction vector. Yellow traces sample nearby geometry, while the averaged result (Blue) produces the surface direction used for movement and alignment.
-
Detects nearby traversal surfaces around the spider
-
Supports floors, walls, ceilings, slopes, and uneven geometry
-
Creates a stable surface direction for movement and alignment
-
Reduces instability near corners, edges, and surface transitions
-
Provides the foundation for custom gravity and procedural leg placement
-
Uses Blueprint for trace setup and C++ for movement calculations
Technical Overview
The main challenge was supporting spider movement across uneven geometry, not just flat walls and ceilings. Most climbing examples I found were built around clean, flat surfaces, so I needed a more flexible approach that could handle rough terrain, slopes, corners, and irregular level shapes.
To solve this, I built the surface detection system around multiple line traces placed around the spider. Each trace samples nearby geometry and contributes to the final surface calculation, with weighted values allowing certain traces to influence the result more strongly than others.
Instead of relying on a single surface check, the system blends multiple hit results and averages their surface normals to estimate the active surface direction. This averaged normal becomes the reference used by the locomotion system for movement, gravity, and orientation.
By blending multiple traces, the spider can maintain more reliable surface detection across uneven geometry and transitions between floors, walls, and ceilings. This gives the rest of the system a stable surface reference to build from.
Gravity & Movement Alignment

Gravity and movement alignment demo showing the spider transitioning between wall, ceiling, and floor surfaces.
-
Keeps the spider attached to floors, walls, ceilings, and slopes
-
Allows movement to follow the active traversal surface
-
Projects movement across the surface instead of into the geometry
-
Updates gravity and movement direction during surface transitions
-
Supports continuous motion across walls, ceilings, slopes, and uneven terrain
-
Handles gravity direction, movement projection, and physics calculations in C++
Technical Overview
After solving surface detection, the next challenge was making the spider stay attached to the surface while still moving naturally across it. A standard gravity direction would only work for floor movement, so the system needed gravity and movement logic that could adapt to walls, ceilings, slopes, and uneven geometry.
​
To solve this, the system takes the averaged surface normal from surface detection and inverts it to create a custom gravity direction. This gravity pulls the spider toward the active traversal surface, allowing it to remain attached as it moves across non-standard geometry.
​
Movement is then projected onto the active surface plane. This allows the spider to travel across the detected geometry while staying aligned with the current traversal surface. As the spider crosses between surfaces, the system updates both gravity direction and movement projection so the creature can remain attached and continue moving smoothly.
Surface State & Alignment

Surface-state transition demo showing the spider moving from ceiling traversal into a drop behavior
-
Tracks traversal state using an enum for grounded, climbing, and ceiling movement
-
Uses dot product checks to compare the active surface normal against world up
-
Classifies the spider’s current state based on surface orientation
-
Updates body rotation as the spider moves between floors, walls, and ceilings
-
Smooths rotation changes to reduce snapping during transitions
-
Supports ceiling drops, reorientation, and continued movement after landing
Technical Overview
After building the gravity and movement alignment, the next challenge was managing how the spider should behave across different traversal states. Moving on a floor, climbing a wall, and traveling across a ceiling all require different alignment logic, so I used an enum to track whether the spider was grounded, climbing, or ceiling-mounted.
The system uses dot product checks to compare the active surface normal against world up. This allows the spider to classify its current traversal state based on the orientation of the surface it is attached to. That state is then used to drive rotation behavior, helping the spider align correctly as it moves between floors, walls, and ceilings.
This state-aware alignment also supports more dynamic AI behavior. The spider can move across a ceiling, drop toward a target, reorient after the drop, and continue moving without switching to a separate locomotion system. This makes the system more reusable for standard traversal, ambush behavior, and aggressive creature movement.
AI Movement Support


AI locomotion demo showing the spider navigating with surface detection, custom gravity, and state-based alignment without direct player control.
Manual control test showing the locomotion system responding to player input while preserving surface alignment and custom gravity behavior.
-
Supports autonomous AI-controlled spider traversal
-
Uses the same surface detection, gravity, and alignment systems across AI and testing modes
-
Allows AI movement to follow the active traversal surface
-
Supports climbing, ceiling traversal, dropping, and continued pursuit
-
Enables behavior tree actions such as leap attacks and ceiling drops
-
Includes optional player control for testing, debugging, and tuning
Technical Overview
The locomotion system was designed to be input-agnostic, allowing the same movement framework to work with AI, player controls, or any other input source. The spider uses the same surface detection, gravity alignment, and surface-state logic regardless of how movement commands are generated.
For autonomous traversal, movement is calculated relative to the active surface so the spider can navigate across floors, walls, ceilings, and angled geometry. This allows AI movement to stay consistent as the creature changes traversal states, including grounded movement, climbing, ceiling traversal, and drops.
Procedural Leg Placement

Control Rig preview used to test and tune procedural leg placement before integration with the C++ surface-aware locomotion system.
-
Integrated a Control Rig-based procedural leg system into the spider locomotion prototype
-
Connected leg placement behavior to the surface-aware traversal system
-
Used surface detection and alignment data to support believable foot placement
-
Tuned movement and rotation behavior so the legs remained readable during traversal
-
Ensured the spider maintained visual contact across floors, walls, ceilings, and angled surfaces
-
Focused on making procedural motion support AI-controlled creature movement
Technical Overview
The spider uses a Control Rig-based procedural leg setup to support believable movement across non-standard surfaces. Using an existing Control Rig foundation, I focused on integrating the procedural leg placement behavior with the C++ locomotion system and connecting it to the spider’s surface-aware movement, gravity, and alignment logic.
This integration helps the legs respond more believably as the spider moves across floors, walls, ceilings, and angled geometry. The goal was to make the creature feel physically connected to the environment, especially during climbing, ceiling traversal, and surface transitions.
System Outcome
-
Built a reusable C++ locomotion component for AI-controlled spider traversal
-
Supported movement across floors, walls, ceilings, slopes, and irregular geometry
-
Combined weighted surface detection, custom gravity, and smooth surface alignment
-
Integrated procedural leg placement to improve creature readability
-
Added optional player control for faster testing and debugging
-
Created a foundation for ceiling traversal, ambushes, drops, and future combat behaviors
Future Improvements
In Progress
-
Expanding the behavior tree to support more complete AI combat and traversal behavior
-
Developing attack behaviors where the spider can leap toward the player
-
Refining ceiling-drop behavior so the spider can ambush targets from above
-
Working on multiplayer replication so spider movement and AI behavior function reliably in networked play
Planned Expansion
-
Support a hybrid animation workflow using both authored animations and procedural movement
-
Improve blending between procedural leg placement and authored attack/traversal animations
-
Package the locomotion system into a reusable Unreal Engine component
-
Prepare documentation, example maps, and setup instructions for a potential Unreal Engine Marketplace release
