A* Implementation on JavaScript
This mod will not work on the lastest stable warzone2100 ver 3.4.1
This mod file shows how the new version of the game should load mods, their hierarchy of directories and includes.
The file contains the A* functions, as well as a test minimod that draws a line of the calculated path from the beacon to beacon in a game match.
After the start of the match, just brost two beacons (Ctrl+H) and A* will calculate the distance of the full path, including obstacles, as well as water crossability.
And will throw result in STDOUT through debug() builtin function, and also will draws a red line inside the game.
Overall, it's pretty fast
Worked only on Warzone2100 ver 4.0+aStar on JavaScript
Re: aStar on JavaScript
New features and fixes
Get here: https://github.com/EuPhobos/astar
- Now edges of the map are surrounded by impassability to fix the "impossible" workaround
- Added the ability to build a diagonal path
- Added game objects that are returned as an array of coordinates if destructible and encountered on the way
- Destructible game objects the algorithm tries to bypass by default, but if the workaround is too long, it builds a path through the objects and returns the interfering objects in a separate array
- Now the graphs can be "hotly" reinitialized by changing the algorithms of the "diagonal or not" path during the match of the game
- Added new symbols to the schematic map
- The schematic map can be disabled with the flag, during initialization
Get here: https://github.com/EuPhobos/astar
- Now edges of the map are surrounded by impassability to fix the "impossible" workaround
- Added the ability to build a diagonal path
- Added game objects that are returned as an array of coordinates if destructible and encountered on the way
- Destructible game objects the algorithm tries to bypass by default, but if the workaround is too long, it builds a path through the objects and returns the interfering objects in a separate array
- Now the graphs can be "hotly" reinitialized by changing the algorithms of the "diagonal or not" path during the match of the game
- Added new symbols to the schematic map
- The schematic map can be disabled with the flag, during initialization
Re: aStar on JavaScript
How does that Ascii renderer perform compared to the current OpenGL/OpenGLES/Vulkan/Metal/DirectX renderers?
Re: aStar on JavaScript
From JS, using new static array mapTiles[] added by pastdue in 4.0 release.
Just compiled variable and put to debug() function to stdout.
here variables "pic": https://github.com/EuPhobos/astar/blob/ ... ar.js#L417
Its useful for me as debugging pathfinding. I'm not trying to create a dwarf fortress
Just compiled variable and put to debug() function to stdout.
here variables "pic": https://github.com/EuPhobos/astar/blob/ ... ar.js#L417
Its useful for me as debugging pathfinding. I'm not trying to create a dwarf fortress