Units Ignoring Move Orders

Status
Not open for further replies.
Level 16
Joined
Mar 27, 2011
Messages
1,349
I am making a tower defence map and there's a strange problem where move orders are ignored by the attackers. Rather, they just stand still. To complicate things, some move orders work and some don't. I can't think of any triggers which could conflict with the move orders (other than the ones I have posted below)

This inconsistency is annoying. I tried making a cinematic where the boss moves, but he just stands still!

This does not work:
  • Unit - Order LastBoss to Move To RallyPoint[27]
  • "LastBoss" is a unit variable. I can confirm variable has been set properly
This works:
  • Set TempUnitGroup = (Units in (Playable map area) matching ((Unit-type of (Matching unit)) Equal to Defiler))
  • Unit Group - Pick every unit in TempUnitGroup and do (Actions)
    • Loop - Actions
      • Unit - Order (Picked unit) to Move To RallyPoint[27]
  • Custom script: call DestroyGroup (udg_TempUnitGroup)
Other triggers that do and don't work:


This trigger is runs when units enter the map to make them move to the endpoint.

  • Rally Invaders 1
    • Events
      • Unit - A unit enters invaders1 <gen>
    • Conditions
      • ((Triggering unit) belongs to an ally of Player 1 (Red)) Equal to True
      • (Unit-type of (Triggering unit)) Not equal to Dummy
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Triggering unit) is A flying unit) Equal to True
        • Then - Actions
          • Unit - Order (Triggering unit) to Move To RallyPoint[1]
        • Else - Actions
          • Unit - Order (Triggering unit) to Move To RallyPoint[27]
This is an ability which can be used to make some enemies move.

  • Unstuck
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Unstuck
    • Actions
      • Set TempPoint = (Target point of ability being cast)
      • Set TempUnitGroup = (Units within 175.00 of TempPoint matching (((Matching unit) belongs to an enemy of (Owner of (Triggering unit))) Equal to True))
      • Unit Group - Pick every unit in TempUnitGroup and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) is A ground unit) Equal to True
            • Then - Actions
              • Unit - Order (Picked unit) to Move To RallyPoint[27]
            • Else - Actions
      • Custom script: call RemoveLocation (udg_TempPoint)
      • Custom script: call DestroyGroup (udg_TempUnitGroup)




This trigger stops enemies attacking buildings. It DOES stop them attacking, but the move order is ignored and the units pretty much freeze in their spot. I can see the special effect, which means the IF conditions passed.

  • Prevent Enemy Attack
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • ((Owner of (Attacking unit)) is an ally of Player 1 (Red)) Equal to True
      • (Owner of (Attacked unit)) Not equal to Neutral Passive
      • (Unit-type of (Attacking unit)) Not equal to Block Checker
    • Actions
      • Game - Display to (All players) for 4.00 seconds the text: Prevent unit attack...
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Attacking unit) is A ground unit) Equal to True
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (rally26 <gen> contains (Attacking unit)) Equal to True
            • Then - Actions
              • Unit - Order (Attacking unit) to Attack Crystal of Life 0000 <gen>
            • Else - Actions
              • Game - Display to (All players) for 4.00 seconds the text: Move order issued
              • Unit - Order (Attacking unit) to Move To RallyPoint[27]
              • Special Effect - Create a special effect attached to the overhead of (Attacking unit) using Abilities\Spells\Human\Polymorph\PolyMorphDoneGround.mdl
              • Special Effect - Destroy (Last created special effect)
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (rally26 <gen> contains (Attacking unit)) Equal to True
            • Then - Actions
              • Unit - Order (Attacking unit) to Attack Crystal of Life 0000 <gen>
            • Else - Actions
              • Unit - Move (Attacking unit) instantly to InvaderSpawnPoint[3]
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,241
Confirm that the units are really not moving, and not just in a state of awaiting a movement update tick.

WC3 movement system does not allow units to move instantly. Instead a unit ordered to move gets scheduled to move in the future. Every game frame for every player a scheduled moving unit is selected and the path finder gives them a movement suggestion. Units will then try to execute this movement suggestion, stopping if they collide with another unit, collide with unpathable map cells, have their order changed, or have completed the suggestion. As movement suggestions are a finite resource (limited number issued per unit time), too many units being ordered to move instantly can cause significant per unit delay before the unit gets a suggestion and can begin moving. At the extreme situation of hundreds of moving units the system might become completely overloaded where by the movement suggestion duration is shorter than the per unit tick period and hence units will begin to exhibit the infamous stutter step movement problem.

There is also a less known result of this system. Issuing a new movement order will cancel the current movement suggestion. Since it will take time before a unit is given another movement suggestion this means the unit will temporarily stop in result to a new movement order. This is why spamming right click smart move orders to a single unit will actually slow down the unit's average movement speed. It also means that if a trigger issues move orders to a unit with high enough frequency the unit may be unable to ever move, or move extremely slowly.

Splitting moving units over multiple players will increase the number of movement suggestions used to move the units and hence allow more units to move simultaneously and with better response time.

Also be aware that Neutral players have their own AI that can cause them to do unexpected things. For example Neutral Hostile units might ignore orders in order to sleep, might ignore attacking buildings and might suddenly cancel movement orders to return to guard position.
 
  • Like
Reactions: Kam
Status
Not open for further replies.
Top