A* Pathfinding Project

Grid graph on terrain with procedurally generated obstacles


#1

Creating obstacles on terrain at runtime, and using ProceduralGridMover to update graph, which works great so far. Issue is, I want to add penalties for terrain textures to force AI prefer road instead of grass/mud/etc.

I’ve read that I can import texture splatmap to Pro edition to set penalties, but will that work with ProceduralGridMover since its size is much smaller than terrain size?

I can also create a huge graph with same size as terrain, import 1:1 splatmap to A* for penalties, and I can use DynamicGridObstacles on all terrain obtacles. I’ll probably have 25-30 obstacles enabled at most. Do you think this splatmap method will work with Pro edition?

Edit: Another idea, can I use two grid graphs, one for whole terrain for splatmap penalties and one for ProceduralGridMover? I’ll need to modify ProceduralGridMover to update the second, smaller graph I guess.


#2

In case anyone have issue with Vegetation Studio Pro and procedural vegetation, here’s what I did to solve pathfinding with low latency:

Baked every collider for the scene and created an Obstacle Mask for all the colliders. Also, exported terrain splatmap and created 2 channel image for unwalkable/high-penalty zones on the grid. Removed collider check from the Pathfinder and now agent can walk around the map without any spikes.