I decided to create my own rotational node path collection.
MS Paint FTW!
On a pivot, a box would rotate several degrees and create a collection of distances from the target. After the closest one is found, it adds this entity to a PathCollection(), then moves the pivot to this new closer spot.
An NPC migrating from left to right while avoiding rocks
The cycle repeats itself until the radius is close enough to the target.
I used a collection of Entities storing a minimum avoidance radius, and calculated terrain slope to manage where NPCs can actually travel. Changing the rotating radius and amount of degrees for each iteration can be used to create a low-density path compared to my example. Such modifications may increase performance in different settings.
The best part about this approach is you can store these paths in memory, removing the data as necessary. It also doesn't need to load any additional data with the scene file, it's created on-the-fly.
- Read more...
- 9 comments
- 3,541 views