A* in Complex World
A more advanced A
* algorithm exercise
would be to apply the algorithm to a 3D visual world.
Here is "Complex World", a 3d-visual World
(but actually a 2-d movement problem).
The enemy chases the agent, not very intelligently:
Click to run Mind:
Complex Mind in World:
Complex World at
Ancient Brain.
"Complex World" uses the "Three.js" graphics library:
- To get the nice graphics, this World uses the
Three.js
graphics library
rather than the P5
graphics library.
- Still JavaScript, but a different graphics library.
- See
Three.js tutorial
A hard exercise: A* in Complex World
Here is a hard exercise:
- Code a more aggressive enemy for Complex World.
- The enemy will use A* to find best route towards agent.
-
What do we mean by this?
After all, we are only going to move one square per step.
A World where the enemy immediately jumped to the agent square before the agent had a chance to move would not be interesting.
- So what we mean is that you use A* to figure the best route.
Then make the first step on that route.
Then the agent will move.
Then you do a new A* to get the new route.
And do the first step of that.
And so on.
I gave this project (or variants of) to some classes before. See the best Worlds here: