• 🏆 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!

Attack Move in straight line? Units curving...

Status
Not open for further replies.
Level 4
Joined
Apr 16, 2018
Messages
47
Is there some way to actually make units move in a straight line? I am making a aos style lane system, but the units curve WAAAAAY off the path... Just need them to flipping move in the center of lane... I tried making much shorter distance points to move to, but still they curve. I tried making them have float with 1 collision size like I seen some say, but they STILL do the curve.

I have considered maybe making each destination have units moving there have an repeating order to move to the location again, but I am concerned with maybe making extra lag by sending so many on the map very regularly. Also when re assigning them making them retarget new targets potentially which is not the best, they should keep targeting who they are fighting or you could push around to hunt another hero and randomly have creeps change to you, potentially before even initiating anything. Just not the most ideal. hmm. NVM, tried that and it did not even make them go straight...

I have seen others doing it fine in maps , but no idea how they are doing it. I figure by now there would be some sort of solution all these years later that I am just missing? Already tried search. T.T
 
Last edited:
Level 6
Joined
Feb 22, 2009
Messages
212
Is there some way to actually make units move in a straight line? I am making a aos style lane system, but the units curve WAAAAAY off the path... Just need them to flipping move in the center of lane... I tried making much shorter distance points to move to, but still they curve. I tried making them have float with 1 collision size like I seen some say, but they STILL do the curve.

I have considered maybe making each destination have units moving there have an repeating order to move to the location again, but I am concerned with maybe making extra lag by sending so many on the map very regularly. Also when re assigning them making them retarget new targets potentially which is not the best, they should keep targeting who they are fighting or you could push around to hunt another hero and randomly have creeps change to you, potentially before even initiating anything. Just not the most ideal. hmm. NVM, tried that and it did not even make them go straight...

I have seen others doing it fine in maps , but no idea how they are doing it. I figure by now there would be some sort of solution all these years later that I am just missing? Already tried search. T.T

Can you show me a picture of the lane + How you want them to move vs How they are moving right now?
 
Level 4
Joined
Apr 16, 2018
Messages
47
Pathing issue..png


The blue is the desired path straight through middle, but instead they lean towards one side and gradually gets worse before near the end turning back toward the desired location... New map, no obstructions. T.T
 
Level 6
Joined
Feb 22, 2009
Messages
212
View attachment 388320

The blue is the desired path straight through middle, but instead they lean towards one side and gradually gets worse before near the end turning back toward the desired location... New map, no obstructions. T.T
Can you use the bb code (How To Post Your Trigger) and post your trigger here?


Meanwhile, try to enlarge your regions about 3 times and see if anything changes.
 
Level 4
Joined
Apr 16, 2018
Messages
47
Still a little sloppy, but mainly just trying to block out functionality atm. =/

  • Spawn Units
    • Events
    • Conditions
    • Actions
      • Set VariableSet UnitsSpawn_UnitType = Footman
      • Set VariableSet UnitsSpawn_UnitsAmount = 4
      • Set VariableSet Temp_Loc = (Center of LaneSpawn West S <gen>)
      • Set VariableSet Temp_Loc2 = (Center of Lane SouthWest <gen>)
      • For each (Integer A) from 1 to UnitsSpawn_UnitsAmount, do (Actions)
        • Loop - Actions
          • Unit - Create 1 UnitsSpawn_UnitType for UnitsSpawn_Force at Temp_Loc facing Temp_Loc2
          • AI - Ignore (Last created unit)'s guard position
          • Unit - Order (Last created unit) to Attack-Move To Temp_Loc2
          • Wait 0.50 seconds
 
Level 6
Joined
Feb 22, 2009
Messages
212
Still a little sloppy, but mainly just trying to block out functionality atm. =/

  • Spawn Units
    • Events
    • Conditions
    • Actions
      • Set VariableSet UnitsSpawn_UnitType = Footman
      • Set VariableSet UnitsSpawn_UnitsAmount = 4
      • Set VariableSet Temp_Loc = (Center of LaneSpawn West S <gen>)
      • Set VariableSet Temp_Loc2 = (Center of Lane SouthWest <gen>)
      • For each (Integer A) from 1 to UnitsSpawn_UnitsAmount, do (Actions)
        • Loop - Actions
          • Unit - Create 1 UnitsSpawn_UnitType for UnitsSpawn_Force at Temp_Loc facing Temp_Loc2
          • AI - Ignore (Last created unit)'s guard position
          • Unit - Order (Last created unit) to Attack-Move To Temp_Loc2
          • Wait 0.50 seconds


From what I see, it is something that have to do with the size of your regions.

I tested out my theory by making 2 sets of regions.

Set 1 equals in size to yours.
Set 2 is 9 times larger.

Units in set 2 moved consistently on a somewhat straight path along the intended road.

Units in set 1 (9 out of 10 footmans in their group) moved as you described (a downward road).


Try to enlarge the regions and if you still not satisfy, we may need to ask someone else.
 
Level 4
Joined
Apr 16, 2018
Messages
47
lol. fk, either its too small and doesnt fix, or too big and seems to reverse the angle it curves to the other side of blue line. hehe. xD

Love Wc3, but having issues with stuff like just going in a straight line is such a pain. T.T

Thank your for the attempt. =/
 
Last edited:
Level 19
Joined
Feb 27, 2019
Messages
580
This is a common issue. I have not heard of a solution, nor have i searched for one. Per heaps the points are very specific, must be exactly 673.03, -689.10. The only way to figure that out is trial and error. Another thought is that there needs to be more points. Like 10x more points than whats expected.
 

Dr Super Good

Spell Reviewer
Level 63
Joined
Jan 18, 2005
Messages
27,190
This is due to how the path finder works. Having the units move at a diagonal of sorts is likely not helping.

The issue can be made worse by having map cells registered to regions an excessive number of times. For example abusing the any unit enters (Playable map area) event multiple times instead of just once as each time the event is declared in triggers it will create a new region and register most of the map cells on the map to it. Note that this is in reference to regions, a JASS mechanic used by but hidden in GUI. What GUI/World Editor calls "regions" are actually rects which do not seem to have any limits.

You can also try placing pathing blocks or other obstacles nearby the road. Sometimes these can divert deviations.
 
You could try periodically ordering them to attack-move a point on the exact line you want them to walk on.

It is a bit of trigonometry. But for each unit, find the closest point on the line, move the point a bit further along it, and the order the unit to attack-move to it.

That way path-finding only ever have to work for a short distance. And if they diverge to attack, they are still ordered back to the line afterwards.
 

Dr Super Good

Spell Reviewer
Level 63
Joined
Jan 18, 2005
Messages
27,190
You could try periodically ordering them to attack-move a point on the exact line you want them to walk on.
This is likely not ideal or even viable since every time a unit's current move order is replaced with a new move order they will stop moving while they wait for the path finder to visit them. The more units owned by the same player that are moving, the longer they will remain stopped after each new move order.

This is why Warcraft III feels so unresponsive compared with StarCraft II/Heroes of the Storm. In StarCraft II units do not stop when given a new movement order as the path finder always services them instantly.
 
Status
Not open for further replies.
Top