Overview
The Pathing Wizard is a tool that facilitates the creation of the pathing map, allowing the user to easily control which parts of the map can be accessed by players.
Pathing Wizard uses a flood-fill algorithm to determine which parts of the map are accessible and which parts are connected. You have the option to use seed points. If you do, only sections of the map that can be reached from at least one of the seed points are considered accessible. Imagine water being flooded into the map from the seed points you define. Unwalkable terrain sections act as walls, preventing the water from reaching areas that are separated from the areas you flood, even if they are themselves walkable.
If you don't use seed points, the algorithm will simply check whether a point on the terrain is walkable to determine whether it is accessible, while still storing information about which sections of the map are connected.
You then have various options to modify inaccessible sections of the map. You can disable pathability (to disallow units from blinking there, for example) and create pathing blockers around those areas to improve AI pathfinding (with just walkability disabled, units often have a hard time finding the correct path). You no longer have to spam pathing blockers yourself, reducing map size and editor save/load time.
The pathing map is created during the loading screen and takes roughly 1 second on a semi-large map.
Units are intentionally ignored, as this system is supposed to only concern itself with the map terrain.
Features
- Disable pathing on inaccessible sections of the map. This prevents players from teleporting into forbidden areas.
- Automatically disable pathing on certain terrain types.
- Paint pathing with rects.
- Automatically create pathing blockers around the borders of inaccessible areas to improve unit pathfinding.
- Update the pathing map whenever a destructable is destroyed.
- Check for spots where players can leave the intended map areas by visualizing the pathing map.
- Functions:
- IsPointAccessible
- GetClosestAccessiblePoint
- ArePointsConnected
- GetSectionSize
Installation
Copy the PathingWizard script file from the test map as well as the Walkability Check Item. Make sure the fourCC code ("I000" etc.) of the item matches the TEST_ITEM_TYPE you set in the config.
Credits
Showcase Map Credits:
Ultimate Terraining Map