This exercise undertakes developing a shortest path simulation on varied terrains. Starting with basic point-to-point movements, I integrated agent behavior, enabling these agents to make decisions and take actions to move towards the destination point by choosing the best available option.

The development of the simulation follows agent movement behaviors from two separate algorithms:

Movement towards Attractor Point

During this exercise I worked on a simple unit duplication algorithm to move in the direction of an attractor point. The unit mesh also avoids obstacles if it enquires any.

The algorithm replicates a unit mesh to move towards an attractor point. Once the mesh reached the point I manually change the location of the point causing the network to branch out and reach the point with the closest mesh available.

Water Runoff Simulation

This exercise involved simulating simple water runoff behavior by finding the shortest path downwards.

The algorithm moves the agents one unit downwards and find the closest point on the terrain mesh from new location, thus simulating a simple water runoff behavior.

Building on the movement behaviors of the above two simulation I developed a shortest path simulation on a terrain.

Shortest Path Simulation (On Terrain)

To induce this movement the agent would:

  1. Project multiple points in a unit radius sphere.
  2. Pick a point from the above projected points which is closest to the destination.
  3. Project the point on the mesh.

The custom preview attached to the path indicates the steepness of the curve on a Green-Blue-Red spectrum gradient, from gentle to steep respectively.

The algorithm can be further refined to find the shortest path, with least resistance by integrating the decision to move towards the path with the least slope form all available points.