LoneTower

LoneTower

A 3D tower-defence MVP prototype in Unity 6 (URP): procedural corner-typed voxel terrain, a custom flow-field navigation resolver (BFS cost field + boid steering), and a connector-aware block-building sandbox.

LoneTower is a 3D tower-defence MVP prototype built in Unity 6 (URP) centred on two interlocking systems: a procedural voxel-ish terrain generated from a corner-type grid, and a custom flow-field navigation resolver that drives agents over that terrain without using Unity's built-in NavMesh.

The terrain is a vertex-grid where each vertex is typed as Land or Water with a biome. Each cell derives a presentation (variant + quarter-turn rotation) from its four corner types via a 4-bit bitmask classifier (marching-squares-style), then assembles either an authored FBX tile mesh or a runtime-built placeholder quad. Slope analysis (triangle-normal dot-product against a configurable walkable-slope threshold) decides which cells are traversable and buildable.

The standout piece is the NavigationResolver — a self-contained flow-field pathfinding and steering system. A BFS integration builds a per-goal cost field and direction field over the grid; agents sample the direction field for a preferred velocity, a spatial-hash broadphase collects neighbours, and a boid-style steering layer (separation + goal slowdown) produces a safe velocity. A topology-version cache invalidates fields on terrain/block changes, and a mutation-preview API validates whether a pending block placement would disconnect existing agents from their goals before committing.

Key features

Stack

C#Unity 6URPVContainerMessagePipeUniTaskPrimeTween

← All projects