UE4/5 Surface AI path finding Unreal Engine

Опубликовано: 09 Февраль 2026
на канале: TangHa
159
3

demo: https://github.com/Tangha-Technologie...
plugin: https://www.fab.com/zh-cn/portal/list...

🔹 Overview
SurfaceAI is a surface-based navigation system for Unreal Engine 5.
It automatically samples points on static meshes, analyzes surface topology,
and builds navigation graphs that can be used for pathfinding, AI movement,
or large-screen visualization of 3D environments.

⚙️ Core Features
Automatically samples navigation points across multiple UStaticMeshComponents.

Supports configurable grid step sizes (StepX, StepY, StepZ).

Supports bounding box expansion and trace-based filtering to ensure surface precision.

Points automatically adjust to stay at a fixed distance (TraceLength) from the surface.

2️⃣ Intelligent Node Filtering

Removes points inside meshes or redundant interior layers.

Keeps only boundary, edge, and isolated points.

Optionally filters points by normal direction (e.g. facing upward surfaces only).

3️⃣ Normal & Surface Detection

Extracts accurate vertex normals from mesh LOD data (StaticMeshVertexBuffer).

Projects points onto the closest surface position.

Ensures normals are consistent with mesh topology, even on curved or tilted surfaces.


4️⃣ Graph Construction

Builds node-to-node connectivity (Edges) based on spatial proximity.

Supports configurable MergeDistance to control graph density.

Performs collision checks to prevent links passing through meshes.

Each node and edge is saved in a USurfaceNavGraph DataAsset.


5️⃣ Pathfinding Support

Includes built-in pathfinding via BFS / Dijkstra-style traversal.

Returns full waypoint list between start and end positions.

Ensures path stays on connected surface regions (no mesh penetration).

6️⃣ Editor Integration


Fully integrated with Unreal Editor via an Editor Module.

Provides one-click graph generation and visualization tools.

Supports saving results as .uasset DataAssets (AutoGraph01.uasset).

Automatically skips invalid (level-private) references when saving.


7️⃣ Visualization & Debugging

Visualizes all nodes and edges in 3D viewport.

Customizable colors (NodeColor) and lifetime (DrawTime).

Supports per-mesh graph isolation and debug overlays.

8️⃣ Modular Data Design

FSurfaceNavNode: stores position, surface point, normal, and source mesh info.

FSurfaceNavEdge: stores node indices and path cost.

USurfaceNavGraph: holds the entire graph, nodes + edges + parameters.