AI Grid / Space Samurai Zombie Cowboy • WIP - Third-Year Programming Systems for Games
Engine: Unity 2022 LTS • Language: C# • Focus: Systems programming, AI navigation, and low-gravity mechanics
Overview
This ongoing project forms my Programming Systems for Games university module in third year. The aim is to build a scalable AI grid and pathfinding system that will later serve as the foundation for Space Samurai Zombie Cowboy, a stylised zombie shooter set on the moon. Players will choose between three distinct classes - Cowboy, Ninja, and Astronaut - each offering different movement, weapon handling, and recoil behaviours in low gravity. The zombies will react dynamically to sound, light, and player class behaviour, creating emergent combat encounters.
Footage
Image Gallery
Core systems
- GridGraph - dynamically samples the terrain, checks obstacles and slope angles, and builds a walkability map for AI navigation.
- AStarPathFinder - clean A* implementation generating walkable routes between two points for agents or projectiles.
- PathTest - a utility visualiser using a
LineRendererto debug live A* paths as objects move. - LowGKinController - fully custom low-gravity first-person controller that simulates lunar physics, step-height logic, and jump buffering.
- FPCameraBob & FPRecoil - procedural camera motion and spring-based recoil system to give weapons physical feedback.
- SimplePistol + SimpleHealth - early combat and target feedback prototype, serving as placeholders for class-specific weapons and zombie health.
Representative code
// AStarPathFinder.cs — simplified pathfinding loop
while (open.Count > 0)
{
open.Sort((a, b) => a.f.CompareTo(b.f));
var current = open[0];
open.RemoveAt(0);
if (current.node == goal)
return Reconstruct(current);
closed.Add(current.node);
foreach (var neigh in graph.GetNeighbours(current.node))
{
if (!neigh.walkable || closed.Contains(neigh))
continue;
float g = current.g + Vector3.Distance(current.node.worldPos, neigh.worldPos);
float f = g + Heuristic(neigh, goal);
var existing = open.Find(r => r.node == neigh);
if (existing != null && g >= existing.g) continue;
if (existing == null)
open.Add(new NodeRecord { node = neigh, parent = current, g = g, f = f });
else
{
existing.parent = current; existing.g = g; existing.f = f;
}
}
} // LowGKinController.cs — low-gravity jump and movement logic
if (CanJump())
{
lastJumpPressedTime = -999f;
float v = Mathf.Sqrt(2f * Mathf.Abs(gravity) * jumpHeight);
velocity = Vector3.ProjectOnPlane(velocity, groundNormal);
velocity.y = v;
grounded = false;
jumpLockoutUntil = Time.time + jumpLockout;
} Future direction
- Integrate AI agents with personality-based behaviour (cowardly vs aggressive zombies).
- Layer the A* grid with sound and light maps so zombies react to stimuli differently.
- Expand the class system, Cowboy (kinetic), Ninja (stealth), Astronaut (tech), each using the same AI grid but exploiting it in unique ways.
- Add modular weapon scripts with recoil variance and lunar dust FX.
- Experiment with partial procedural environments and dynamic low-G physics hazards.
This project is a work-in-progress for my final academic year and will evolve into a complete lunar zombie shooter demo built around systems programming and AI behaviour research.