How to check if there is an avalible path?

feelingparty

New Member
Reaction score
3
I'm pretty sure many of you have played Tropical Tower Wars. If so then you should know what I am talking of, if not let me explain: since you put buildings freely (no restrictions on where to put them) there is some system that does not let you block the way of the creeps - the creeps move towards the desired location and when they find there is no way they explode. So does anybody know how this could be done?
 

Rushhour

New Member
Reaction score
46
Someone else wanted to have the same thing, check out the algorithm I wrote:

Explanation:
http://www.thehelper.net/forums/showpost.php?p=1269933&postcount=28

Demo map: (you need JassNewGen pack to edit, save and implement this into your map)
http://www.thehelper.net/forums/showpost.php?p=1270603&postcount=30

It checks if there exists a path between two points/ two pairs of coordinates. In the demo map, the the tower will be destroyed if it blocks. But of course you can wait to kill this tower until a creep comes near it.
Setting the parameters really depends on your map and of the size the maze of towers could be like. Using higher values is more accurate, using lower values is faster.
 

feelingparty

New Member
Reaction score
3
thanx alot. judging by the demo map it is promising :D I wonder however if this system will count doodads as pathing blockers as well
 

Rushhour

New Member
Reaction score
46
It does. Everything including doodads will count as unpathable, if they have a pathing map set in the object editor.

The only problem could be items.

To check if a point is pathable this moves an item to the specific point and checks if the point where the item got moved by the game engine is nearer than 10 yards from the point it should have been moved.
The reasons this works is because the game engine would move the item to another spot if the target isn't walkable.

But since there is a very small possiblity that there is another normal item lying on the ground at a position that gets checked. (item on top of another item doesn't work). So setting the constant boolean to 'true' will check if there are items near the target location. I didn't test this, but this is what vexorian set up his system, so I think it will work ;D

Any more questions?
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top