1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Music Contest #8 - Hive Soundtrack is up! Create the soundtrack for the upcoming videos of Hive Workshop's YouTube Channel.
    Dismiss Notice
  3. Check out the entries of the latest Mini-Mapping Contest: Stealth! Cast your vote for here!
    Dismiss Notice

[Snippet] IsPathBlocked

Discussion in 'Graveyard' started by Nestharus, Feb 1, 2012.

  1. Bribe

    Bribe

    Joined:
    Sep 26, 2009
    Messages:
    7,470
    Resources:
    13
    Maps:
    3
    Spells:
    10
    Resources:
    13
    I am no rocket scientist, are you trying to kill me with this?

    First, what's with the bugs? That doesn't even make sense that those corners would block the map from functioning properly.

    Second, great work on reducing the in-game lag. Totally worth it because the in-game result will be free of lag.

    Third, why doesn't IsPathBlocked take any additional arguments any more? What unit is supposed to be passed as a parameter there?
     
  2. Dirac

    Dirac

    Joined:
    Jun 20, 2011
    Messages:
    249
    Resources:
    0
    Resources:
    0
    Bribe read the documentation.
    In a TD all you have to do is
    IsPathBlocked(tower)

    It checks if that "new" tower the user just built is blocking the way

    And I agree, the fact that corners bug the system is unacceptable
     
  3. Nestharus

    Nestharus

    Joined:
    Jul 10, 2007
    Messages:
    6,143
    Resources:
    3
    Spells:
    3
    Resources:
    3
    actually if you read first post, corners don't bug system, you can just blanket rects that creeps have to touch with towers ;)
     
  4. Bribe

    Bribe

    Joined:
    Sep 26, 2009
    Messages:
    7,470
    Resources:
    13
    Maps:
    3
    Spells:
    10
    Resources:
    13
    So what exaclty is wrong with building a huge brick, if it doesn't corrupt the pathing algorithm everything is still fine, right?
     
  5. Nestharus

    Nestharus

    Joined:
    Jul 10, 2007
    Messages:
    6,143
    Resources:
    3
    Spells:
    3
    Resources:
    3
    you can't build a huge brick from wall to wall... i was just thinking of blanketing rects specifically in my own wmw map, which would be a huge brick except for touching the opposite wall :\, so I was being silly in my super tired stupor of corners last night, lol. The instant you try to touch the other wall (an actual block), it'll detect it.


    To prevent users from blanketing the rect, just make one of the tiles unbuildable (only 1 is needed). In my case, I would make the corners unbuildable since people never build at those anyways. Not sure what to do about the back checkpoints tho ;o.
     
  6. jim7777

    jim7777

    Joined:
    May 27, 2009
    Messages:
    481
    Resources:
    7
    Maps:
    2
    Spells:
    5
    Resources:
    7
    does this snippet check if the path or line between two points are blocked?

    or just a radius around the unit is being checked?
     
  7. Nestharus

    Nestharus

    Joined:
    Jul 10, 2007
    Messages:
    6,143
    Resources:
    3
    Spells:
    3
    Resources:
    3
    Path. It tries to get from one side of the tower to the other ^)^. If it can't make it to the other side, the path is blocked ;p.

    2 sides chosen are based on a set of if statements to check what path through the tower was possibly blocked (left -> right, bottom -> top, right -> top, etc).
     
  8. Nestharus

    Nestharus

    Joined:
    Jul 10, 2007
    Messages:
    6,143
    Resources:
    3
    Spells:
    3
    Resources:
    3
    Fixed a bug with towers that are built 1 space apart from each other and a third tower built to possibly block the space in between. It would always read it as a block : ). Now it works properly.


    Thanks to magtheridon96 for his wmw noobiness as that allowed him to find the bug ; ).
     
  9. Magtheridon96

    Magtheridon96

    Joined:
    Dec 12, 2008
    Messages:
    6,017
    Resources:
    9
    Maps:
    1
    Spells:
    8
    Resources:
    9
    I'm improving D:
    And my score is pretty good compared to what you've seen other "pros" do D:
     
  10. Nestharus

    Nestharus

    Joined:
    Jul 10, 2007
    Messages:
    6,143
    Resources:
    3
    Spells:
    3
    Resources:
    3
    Fixed bug with retrieving radius (was adding 16) and removed a debug message. Would have been updated last night, but my connection was down.
     
  11. Nestharus

    Nestharus

    Joined:
    Jul 10, 2007
    Messages:
    6,143
    Resources:
    3
    Spells:
    3
    Resources:
    3
    This still has a bit of the bug mag found in it :\. I'm seeing noobs playing my wmw map encounter it over and over again. I'll investigate it tomorrow as I don't have time today.
     
  12. Nestharus

    Nestharus

    Joined:
    Jul 10, 2007
    Messages:
    6,143
    Resources:
    3
    Spells:
    3
    Resources:
    3
    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.
     
  13. Magtheridon96

    Magtheridon96

    Joined:
    Dec 12, 2008
    Messages:
    6,017
    Resources:
    9
    Maps:
    1
    Spells:
    8
    Resources:
    9
    Note: A resource can only be approved if it's requirements are approved ;)
     
  14. Bribe

    Bribe

    Joined:
    Sep 26, 2009
    Messages:
    7,470
    Resources:
    13
    Maps:
    3
    Spells:
    10
    Resources:
    13
    Approved. Fun resource.

    Edit: The RegisterPlayerUnitEvent in your map that "AnitBlock" uses is the suck, what's the point in adding verbosity by requiring boolexpr instead of code? That's a sucky change.
     
  15. Nestharus

    Nestharus

    Joined:
    Jul 10, 2007
    Messages:
    6,143
    Resources:
    3
    Spells:
    3
    Resources:
    3
    Uh, I follow JASS standards. If you look at the actual resource, it does not have the Condition stuff in there ; ).
     
  16. Bribe

    Bribe

    Joined:
    Sep 26, 2009
    Messages:
    7,470
    Resources:
    13
    Maps:
    3
    Spells:
    10
    Resources:
    13
    If you really followed JASS standards your programming structure would be way more readable.

    Earlier this morning your code looked different, you just changed it ;)

    You originally wrote
    Code (vJASS):

    call RegisterPlayerUnitEvent(EVENT_PLAYER_UNIT_CONSTRUCT_START, @Condition(@function thistype.checkBlock@)@)
     
  17. Nestharus

    Nestharus

    Joined:
    Jul 10, 2007
    Messages:
    6,143
    Resources:
    3
    Spells:
    3
    Resources:
    3
    Uh huh, because I had forgotten to change it back. It's Condition( ) in my maps ; ).
     
  18. Bribe

    Bribe

    Joined:
    Sep 26, 2009
    Messages:
    7,470
    Resources:
    13
    Maps:
    3
    Spells:
    10
    Resources:
    13
    And in my WarChasers 2 map it only registers for players 0, 1, 5 and 6 (provided they are also playing).

    To each his/her own ;)
     
  19. Magtheridon96

    Magtheridon96

    Joined:
    Dec 12, 2008
    Messages:
    6,017
    Resources:
    9
    Maps:
    1
    Spells:
    8
    Resources:
    9
    And in my map, I use a dynamic version of RegisterPlayerUnitEvent that allows me to use multiple triggers so I can enable and disable certain boolexprs :p
     
  20. Nestharus

    Nestharus

    Joined:
    Jul 10, 2007
    Messages:
    6,143
    Resources:
    3
    Spells:
    3
    Resources:
    3
    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.