Update waypointing.md

- Corrected "`waypoint_mode 1` in the console " to "waypoint_mode cvar"
- Explanation on wayTarget targetting
- Correction for "Zombie sight" conditions
- Correction for "Zombie pathfinding priority"
This commit is contained in:
Logan 2025-01-22 08:30:26 +00:00 committed by GitHub
parent ee7fbe79a9
commit b62b193fd4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -7,7 +7,7 @@
_Nazi Zombies: Portable_ makes use of a waypointing system to define nodes that zombies may path between. This allows for a fairly simple and intuitive, albeit limited, way to allow mappers to create custom pathfinding for their maps.
Waypoints can be edited directly in-game via the waypoint editing mode, foregoing the need to recompile the map when creating or adjusting waypoints. This mode can be accessed via the command `waypoint_mode 1` in the console.
Waypoints can be edited directly in-game via the waypoint editing mode, foregoing the need to recompile the map when creating or adjusting waypoints. This mode can be accessed via the command `waypoint_mode` cvar.
Saving a set of waypoints via this mode will generate a `.way` file within the maps folder of NZ:P; a plain-text file containing data for each node.
## Interacting with Waypoints
@ -27,14 +27,14 @@ Saving a set of waypoints via this mode will generate a `.way` file within the m
Special Waypoint nodes are used in conjunction with a valid `func_nzp_door` to prevent zombies from attempting to path through currently closed doors.
A valid `func_nzp_door` requires an ID to be set in the `wayTarget` entity field.
A valid `func_nzp_door` requires an ID to be set in the `wayTarget` entity field. Targetting this `wayTarget` within waypoint mode is as simple as placing a waypoint node within the door entity you have created, and creating a special entity
whilst this node is selected. Correct use of this function can be clarifyed by a console output.
## Pathing Behaviour
Zombies will move along a path dictated by the mapper through connected waypoint nodes until they are within sight range to path to a player on their own (Where "Sight" is dictated by both the zombies shins and forehead being able to see the player).
Zombies will move along a path dictated by the mapper through connected waypoint nodes until they are within sight range to path to a player on their own (Where "Sight" is dictated by both the zombies shins, chest and forehead being able to see the player).
When zombies reacquire a path to the player (Whether that be after hopping a barricade post-spawn, or in attempt to find the player after they have teleported outside and back into the map.),
they will do so via the closest waypoint node to them. This is also important to consider in maps with verticality, as the nearest node to the zombie may in fact be above or below
them - causing them to get stuck.
they will do so via the closest waypoint node to them. There is however a heuristic cost, meaning zombies will attempt different paths via nodes if the closest node to them is not reachable.
![Example map of connected waypoint nodes, arrows indicating that nodes are linked in both directions.](../res/images/example_waypoints.webp)