• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[Snippet] IsPathBlocked

Level 31
Joined
Jul 10, 2007
Messages
6,306
Fixed final band-aid bug
Fixed 32x32 towers
Made all collision sizes work (no longer hard coded)
Fixed larger towers by making start and end points calculated while determining what is blocked around the tower


So... I believe that this now has 0 bugs and it's uber fast. I could run it off of a minimum binary heap to minimize the loop sizes when the path isn't blocked, but that'd significantly increase overhead when the path is blocked (bad worst case scenario). I'm trying to keep the worst case scenario as good as possible as I think a freeze is much worse than a generally slower operation ;D.


Anyways Bribe, you can go ahead and approve this for use in Tower War and Tower Defense maps now : D.
 
Level 31
Joined
Jul 10, 2007
Messages
6,306
Fixed final bugs... I think IsPathable was bugging it up, so get the updated IsPathable objects.

This also uses better stuff now for generating the pathing map, so it's a little bit faster on load time ^)^.


Also, it is 100% official.. if players are allowed to build on all corners in a playable map area, they will be able to blanket the entire area. As long as you make it so one corner is unbuildable, you will be ok ^)^.


This is due to how the preprocessing stuff works. Sadly, there is no way to resolve this issue, it's 100% impossible. Resolving this issue would make it impossible to build bricks of towers, which don't technically block >.>. The preprocessing was done purposefully to allow for bricks (in wmw, air guards are always bricks of towers). So just make one corner in each playable area unbuildable and you'll be golden.
 
Level 18
Joined
Jan 21, 2006
Messages
2,552
It wasn't because of the spherical cubes?

Why don't you trace the outlines of player buildings, similar to what you do for Terrain. I would think the outline for player buildings would be a smaller set the the outline of terrain squares.
 
Level 23
Joined
Jan 1, 2011
Messages
1,504
I seem to have found a way to make a blocked off area :p
(With your test map)
Bug.jpg
 
Level 5
Joined
Oct 13, 2010
Messages
84
The bug i found may be the cause of what maddeem found.

First, the bug only occurs when build Scout Tower 2 (64x64)
Second, the bug only occurs when the distance between 2 tower is 32

I made a map demo what i have said:
The scenarios when the the bug appear when not. The red circle is the place where can build ST2 even it blocks the path. The Pathing algorithm still work well at the white circle.
Hope it helpful !

Edit:
- This map is your demo map with towers i pre-placed in many cases.
- added transmulate spell for worker to destroy the tower quickly then no need restart demo map
 

Attachments

  • Anti Block Bugs.w3x
    56 KB · Views: 51
Last edited:
This thing is now faster thanks to how Nes made it use ~200 hashtables :p
That leaves 55 hashtables:
1 for Table -> Every other system/spell in your map
54 for specialized systems like this one (Network is a good example)

The reason this is needed is because of the magnitude of data being stored.
A hashtable gets slower as the amount of data in it increases because of hash collisions, which is why data is stored in an array of linked lists at the C++ level.
Using more than one hashtable would ensure less iterations -> a faster hashtable.

Approved.
 
Level 31
Joined
Jul 10, 2007
Messages
6,306
Updated

Completely changed the preprocessing to work with any building size and also made it smarter. It will only run now when there is a chance for a block ;D.

edit
update again

used HaveSaved instead of Load and only store boolean when it's true. This cut the RAM down by 40 megs on demo map. Should also be faster on larger maps.
 
Last edited:
Level 31
Joined
Jul 10, 2007
Messages
6,306
And another update... the entire design was flawed, had to redo it : (

thanks maddeem for noticing that this froze etc

I have made sure that it works on mad's map with no issues. I also made sure that the 3-4 bugs I found in the last version weren't in this version.

if anyone runs into any problems, please let me know : )
 
Top