IsWalkabilityOff 1.2

The native IsTerrainPathable doesnt consider destructible and building pathing.

This library contains two distinct functions for detecting if pathing type walkability is off, including destructible and building pathing.


1. Used for checking if walkability is off at certain (x, y), including units.

| function IsWalkabilityOff takes real x, real y returns boolean


2. Used for checking if walkability is off at certain cell containing (x, y), excluding units.

| function IsTerrainWalkabilityOff takes real x, real y returns boolean


Story:

This library is the result of me trying to find the fastest and most efficient method for detecting walkability by comparing existing methods.


Credits:

- Kazeon for PathingLib which this library is based on.


Changlelog:
Version 1.0: Released
Version 1.1: Changed description, added more demo, made units non-hero, other miscellaneous changes
Version 1.2: Simplified demo triggers


Keywords:
check, detect, walkability, walkable, pathing, pathability, terrain, off
Contents

IsWalkabilityOff 1.2 (Map)

Reviews
Antares
Simple and working as intended. Approved
Level 24
Joined
Feb 27, 2019
Messages
833
What does this do differently than IsTerrainPathable or your other library?
IsTerrainPathable is a native that doesnt always return correct values because it doesnt consider all destructible, buildings or unit pathing. It is a shown unreliable native that spawned the likes of Rising_Dusk's IsTerrainPathable, Anitarf and Vexorian IsTerrainPathable, Nestharus' IsPathable, PathingLib and PurgeandFire's CheckWalkability.

This system can use that native to an advantage, but is not the only one that can, by inverting how it checks for pathing it can use the native to narrow the search. Simply, the native is fast so if it can be used its good. This system is best compared to PathingLib since is uses the same method but inverted and with a few more quirks.

My other resource is practically unrelated to this one. They are totally seperate.
 
IsTerrainPathable is a native that doesnt always return correct values because it doesnt consider all destructible, buildings or unit pathing. It is a shown unreliable native that spawned the likes of Rising_Dusk's IsTerrainPathable, Anitarf and Vexorian IsTerrainPathable, Nestharus' IsPathable, PathingLib and PurgeandFire's CheckWalkability.
I see. Good to know, thanks. Make sure to add this to your description (see our resource submission rules regarding descriptions).
 
Level 24
Joined
Feb 27, 2019
Messages
833
Okay really though how much faster is it? Because as it stands this really looks like it should be a pr for the pathing lib
Haha sorry for the weird reply before I dont know how that happened XD I guess I was trying to respond yesterday. Anyway, the reason this system and the inverted method is faster is twofold. This method of checking pathability by trying to issue a build order is much faster if the result is false. By inverting this system the result is false when the path is walkable and I believe walkable paths are more commonly checked than unwalkable paths. Secondly, thanks to BlzPauseEx and Limit construction of units, its 6.5x faster to check for with this system unwalkable paths, but PathingLib could add this method and make its walkable paths 6.5x faster to check as well. Remember the mentioned paths are the ones that are slow to check. Thirdly, it can exclude player units thanks to adding a pathing map to one of the units built and sharing control with the WALK_PLAYER to exclude that player from the search, which is the size of a cell, which is also very useful for systems like Bresenham Pathchecker since their method is built on checking a cell at a time. A pathing map on a built unit on a walkable path would cause a unit to move out of the way, but that doesnt happen with unwalkable paths. So I intentionally limited this system in an inverted way. What does PR mean, part? Maybe, but it hasnt happened yet.
 
Level 6
Joined
May 29, 2013
Messages
139
I applied this system to my map and it doesn't work. I set the objectid, I set the unit exactly the same as your demo trigger.
I suspected that an existing trigger in my map was causing error, so I tried deleting all other triggers, but that didn't work either. Do gameplay constants or other settings affect whether this system works or not?
 
Level 24
Joined
Feb 27, 2019
Messages
833
I applied this system to my map and it doesn't work. I set the objectid, I set the unit exactly the same as your demo trigger.
I suspected that an existing trigger in my map was causing error, so I tried deleting all other triggers, but that didn't work either. Do gameplay constants or other settings affect whether this system works or not?
There are no gameplay constants or other settings that are required for this system to work. I cant imagine any gameplay constant or setting that would cause any issues either. What I do know is that for the function IsTerrainWalkabilityOff to work, it requires that all players have shared control towards neutral passive which is handled automatically by the system.

The function IsWalkabilityOff() takes unit collision into consideration. That means that if the starting co-ordinates are on top of a unit with collision it will return true as in walkability is off.
Did you try both the function IsWalkabilityOff and IsTerrainWalkabilityOff?

Could you per heaps show me how you are using this system in a trigger?
 
The IsWalkabilityOff library is clean and works as intended.

You have packaged the IsPathWalkable function with the test map. As far as I can tell, this is its own stand-alone system (that is based on someone else's library, but you modified). You can package those in the same resource or upload them separately - that's up to you. But it shouldn't be in the Demo section, because it's its own system and not for demo purposes.

The demo triggers are quite byzantine. They add unnecessary confusion to what should be a simple-to-use library. Why is this not a simple if IsWalkabilityOff(x, y) then print X else print Y endif?. Please clean them up a bit.

The Knight trigger message shows the inverse of what it should show.

Awaiting Update
 
Level 24
Joined
Feb 27, 2019
Messages
833
The IsWalkabilityOff library is clean and works as intended.

You have packaged the IsPathWalkable function with the test map. As far as I can tell, this is its own stand-alone system (that is based on someone else's library, but you modified). You can package those in the same resource or upload them separately - that's up to you. But it shouldn't be in the Demo section, because it's its own system and not for demo purposes.

The demo triggers are quite byzantine. They add unnecessary confusion to what should be a simple-to-use library. Why is this not a simple if IsWalkabilityOff(x, y) then print X else print Y endif?. Please clean them up a bit.

The Knight trigger message shows the inverse of what it should show.

Awaiting Update
Makes sense. Thank you.
 
Top