This is my first attempt at A* pathfinding. I made this simulation to experiment with interesting ways of pathfinding for game development. The Simulation is very user-friendly and you can configure all major features of my algorithm through the UI to your liking. This simulation is heavily influenced by the A* Pathfinding Visualization written by Devon Crawford, but I just optimized it a bit more and added some new handy features.
- Go to the Releases Page
- Download the AStarPathfinding.jar from the latest release
- To run the Jar file simply open up your terminal and type
java -jar path/to/jar/AStarPathfinding.jar
(path/to/jar/
is usuallyDownloads/
but it depends on where you stored the file) - After you run that command the Simulation Window should pop up and you can play around with the simulation. If it doesn't work, feel free to post an issue with the error at hand.
You must create a map to start the pathfinding. The start node is blue, end node is red and the walls are black.
To create nodes:
- Start: hold 's' + left click
- End: hold 'e' + left click
- Wall: left click
To delete nodes:
- same as creation, except right click
My algorithm supports both diagonal and non diagonal pathfinding.
Simply check the "diagonal" box at the bottom left of the screen.
You may change the speed of the simulation during runtime. (By default, speed
is 50%.)
Notice: speed only works when showSteps is true.
if showSteps
is false, well, that leads into the next section..
You may choose to view a step-by-step process of the algorithm by selecting showSteps
box at the bottom left.
- If
showSteps
is false, the algorithm will skip visuals until the end, and process as fast as possible. This is useful for when you want to analyze the efficiency of my algorithm in different coniditons. The example below showsshowSteps
as false, where it times the algorithm and outputsCompleted in 7ms
at the bottom left.
You may scroll up and down to zoom in and out. If zoomed in far enough, you will be able to see details like the g cost
, h cost
and f cost
for each node that is open and closed. The Zoom feature can only be used when the board is empty so if you want to resize the grid you would have to first clear the board.
You can create unordinary and complex maps and the simulation will run fine but be wary that sometimes, if the path has already searched many nodes, the program might eventually run into a stackoverflow error. (Should be fixed for the most part now)
a project fixed by BooleanCube :]