• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

How to know if target point is unreachable?

Status
Not open for further replies.

Deleted member 219079

D

Deleted member 219079

How to know if target point is unreachable? I have 32 collision sized unit, that fatty thinks he's a super man and tries to pathetically go to places he can't go, because my map only includes 16x16 gaps to the target area TT

I'm thinking of sending 32 collision sized fast dummy to the point, if he has stop command without reaching the point, the target is unreachable and my fatty will receive another task to do.

Just wondering if anyone has faster/more efficient way of achieving this? Thanks :)
 

Deleted member 219079

D

Deleted member 219079

Hmm, but that region changes by the game, as there are buildings which block the entrance in my map. :/
 

Chaosy

Tutorial Reviewer
Level 40
Joined
Jun 9, 2011
Messages
13,219
something like this would work
  • Melee Initialization
    • Events
      • Unit - A unit Is issued an order targeting a point
    • Conditions
      • (Issued order) Equal to (Order(move))
      • (Distance between (Position of (Triggering unit)) and your_loc) Greater than or equal to 500.00
      • (Triggering unit) Not equal to your_unit
    • Actions
      • Unit - Order (Triggering unit) to Stop
 

Deleted member 219079

D

Deleted member 219079

Eh, how does that relate to points and reachability? (Not indented to sound rude, I appreciate your help) My unit is 32 collision - fat, but he is healthy enough to walk for more than 500 distance units :/

asdfasdf.jpg

For example this pic, Paladin wants to ask Jaina out but Jaina built a farm so that slimey pedo won't get close to him.

How can he know Jaina's point is unreachable?

Only the dummy thing I talked about comes to my mind... I wonder if there's more efficient ways.
 

Deleted member 219079

D

Deleted member 219079

He doesn't need to go in a straight line. Just so that the system tells him if it's possible.
 

Chaosy

Tutorial Reviewer
Level 40
Joined
Jun 9, 2011
Messages
13,219
I tried this.
  • Untitled Trigger 001
    • Events
      • Player - Player 1 (Red) skips a cinematic sequence
    • Conditions
    • Actions
      • Set loc1 = (Center of Region 000 <gen>)
      • Set loc2 = (Center of Region 001 <gen>)
      • Set distance = (Distance between loc1 and loc2)
      • Set angle = (Angle from loc1 to loc2)
      • Set you_can_walk_in_a_line = True
      • For each (Integer A) from 1 to (Integer((distance / 10.00))), do (Actions)
        • Loop - Actions
          • Set check_loc = (loc1 offset by ((Real((Integer A))) x 10.00) towards angle degrees)
          • Set tunitgroup = (Units within 32.00 of check_loc)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (tunitgroup is empty) Equal to False
            • Then - Actions
              • Custom script: set bj_forLoopAIndexEnd = bj_forLoopAIndex
              • -------- Unit Detected! --------
              • Game - Display to (All players) the text: Unit Detected!
              • Set you_can_walk_in_a_line = False
            • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • you_can_walk_in_a_line Equal to True
        • Then - Actions
          • Game - Display to (All players) the text: The system Didnt de...
        • Else - Actions
it seemed to work but the pathing (32) is pretty small so hard to say.
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,258
WC3 is not really designed for this due to the primitive pathing system it uses. SC2 does it by default thanks to its mesh pathing system.

The fact is there is no real solution to this problem with out making an entire path finding system of your own to overwrite the standard path finding. Yours would have to take into consideration the width of passages (why mesh based ones are good) compared to WC3 which only checks if a point can reach it.

Integer A / B are slower and less efficient. They are also buggy.
They are only slightly slower. They are not buggy at all if not nested (where global variables would also bug).
 

Deleted member 219079

D

Deleted member 219079

I attached a map where I made some kind of system for this.
  • CR Cast
    • Events
      • Unit - A unit Is issued an order targeting a point
    • Conditions
      • (Issued order) Equal to (Order(channel))
    • Actions
      • Set p = (Target point of issued order)
      • Cinematic - Ping minimap for (All players) at p for 1.00 seconds
      • Custom script: set udg_u = CreateUnit(GetTriggerPlayer(), 'U000', 0, 0, bj_UNIT_FACING)
      • Unit - Order u to Orc Blademaster - Wind Walk
      • Unit - Set u movement speed to 900.00
      • Custom script: call SetUnitX(udg_u,GetUnitX(GetTriggerUnit()))
      • Custom script: call SetUnitY(udg_u,GetUnitY(GetTriggerUnit()))
      • Unit - Order u to Move To p
      • Unit Group - Add u to CR_Group
      • Set CR_pColon[(Custom value of u)] = False
      • Set CR_pTargetRect[(Custom value of u)] = (Region centered at p with size (200.00, 200.00))
      • Set CR_plUnreachable[(Player number of (Owner of u))] = False
      • Trigger - Turn on CR Loop <gen>
      • Custom script: call RemoveLocation(udg_p)
  • CR Loop
    • Events
      • Time - Every 0.04 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in CR_Group and do (Actions)
        • Loop - Actions
          • Set u = (Picked unit)
          • Set i = (Custom value of u)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Current order of u) Not equal to (Order(move))
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (CR_pTargetRect[i] contains u) Equal to True
                • Then - Actions
                  • Set CR_plUnreachable[(Player number of (Owner of u))] = False
                  • Game - Display to (All players) the text: reachable
                • Else - Actions
                  • Set CR_plUnreachable[(Player number of (Owner of u))] = True
                  • Game - Display to (All players) the text: unreachable
              • Unit Group - Remove u from CR_Group
              • Unit - Remove u from the game
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (CR_Group is empty) Equal to True
                • Then - Actions
                  • Trigger - Turn off (This trigger)
                • Else - Actions
            • Else - Actions


Can it be more efficient? Or faster? :/

Edit: @Chaosy that system checks in a straight line doesn't it? I will use this for bot's ai so that won't work. Bot can bug a while meanwhile my dummy is running towards the check point, because that's what bots do the best :D
 

Attachments

  • MoveSpeedXGUI.w3x
    41.3 KB · Views: 58
Level 23
Joined
Apr 16, 2012
Messages
4,041
no need to wild walk, just give the unit Locust and Invulerability and make it have no model

maximum unit move speed is 522 unless hou move the unit with SetUnitPosition or SetUnitXY, but both are equally bad for what you need

I think apart from what DSG suggests(making your own pathfinding), which wouldnt work regardless and what you do there is no other reliable solution

This one is also quite slow, because if the dummy hits unwalkable place after 3500 units traveled? that is 7 seconds wasted waiting for dummy to stop
 

Deleted member 219079

D

Deleted member 219079

Locust forgets buildings, which are pink on pathing.

I used PurgeandFire's MoveSpeedX system to get past 522.
 
Level 28
Joined
Sep 26, 2009
Messages
2,520
locust doesn't do anything with pathing, it just makes unit invulnerable and un-targetable. You may think it has anything to do with pathing since units with locust usually have movement type set to "Fly" which ignores ground pathing blockers. However if you leave it at hover/amphibious/foot, etc., it will not ignore ground pathing.
 
Level 22
Joined
Sep 24, 2005
Messages
4,821
What task are you giving fatty? Why do you need to know if a certain point is reachable? Just asking because I want to know if we can come up with an alternative solution (one that doesn't involve path-finding).
 

Deleted member 219079

D

Deleted member 219079

@Nichilus I tested it, it does forget buildings. I can test it again if you insist.

@chobibo I will use this for bot's ai, for checking can bot reach unit it has targeted. Bot can bug a while meanwhile my dummy is running towards the check point, because that's what bots do the best :D
 
Level 22
Joined
Sep 24, 2005
Messages
4,821
Can't you use attack-move for that? At least the unit won't insist on reaching that unreachable point haha xD (your using waypoints to go to the vital areas, like lanes, right?).
 

Deleted member 219079

D

Deleted member 219079

I cannot unfortunately use attack-move :( Because the bot selects target randomly, it doesn't know if it's behind some kind of wall.
 
Status
Not open for further replies.
Top