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

Advanced help plz: Mass attack controls, units clogging up

Status
Not open for further replies.
Level 9
Joined
Sep 8, 2004
Messages
633
So here's my problem, in my map, you control a maximum of 150 marines, per player.
To control these many marines, i made a mass attack controller, which,
when the controller moves to a certain rect, relative to a location in the map,
orders all marines to attack-move there.

The problem is that all marines start clogging up when they're close together.
The essence of the problem lies within the warcraft 3's pathing code - i believe.
Everytime a marine bumps into another marine, it starts calculating a new path for it,
but since it's 150 marines packed together, it just starts calculating new paths for 100 marines at a time,
2x per second. The result is that the marines clogg up, and get ahead very slowly.

One thing i know for a fact is that in starcraft this did not happen (simpler pathing).

What i would like to know is;
- Can i trigger them to move in groups? like, if there's 100 marines, it orders groups of 12, to go,
one group per second?
Or, is there a way to DESTROY (Caps ftw :) ) the advanced pathing?

Thanks in advance.
 
Level 9
Joined
Jun 28, 2005
Messages
633
youve never played a maul?

well when there is alot of units in a map the units just kinda stop....... then go...... then stop..... then go....... repeadtly

i guess the trigger i would use is

event-unit enters region (reg001)
condition*
action-unit patrol to target point (region0002)
think thats what it says
but along the path they go you keep having those triggers so if they just stop they will be forced to move because of the constant patroling regions

event-unit enters region (reg0003)
condition*
action-unit patrol to target point (reg0004

event-unit enters region (reg0004)
condition*
action-unit patrol to target point (reg0005

event-unit enters region (reg0005)
condition*
action-unit patrol to target point (reg0006)

event-unit enters region (reg0006)
condition*
action-unit patrol to target point (reg-kill the enemy leader dum dum dum)

soz for the last ones inconviniance
 
Level 22
Joined
May 11, 2004
Messages
2,863
No, no. Pathing is not the problem, and ben's solution wont work for this sort of problem- its the AI its self. The AI can only move 12 units at a time just like a human player, so when you give it control of hundreds of units, they will begin to bog down, stop, and then move only 12 units at a time.

Solution to this: Add in extra AI players and divvy up the units evenly among them, giving them less overall units to control. You will find things will move much smoother then.
-VGsatomi
 
Level 9
Joined
Sep 8, 2004
Messages
633
VGsatomi said:
No, no. Pathing is not the problem, and ben's solution wont work for this sort of problem- its the AI its self. The AI can only move 12 units at a time just like a human player, so when you give it control of hundreds of units, they will begin to bog down, stop, and then move only 12 units at a time.

Solution to this: Add in extra AI players and divvy up the units evenly among them, giving them less overall units to control. You will find things will move much smoother then.
-VGsatomi

Okay, i see your point ( didn't know about the 12-unit max :) ) but i do not think that is the issue here.
I'll elaborate on the system itself;
My map is a sort of zonecontrol (starcraft zonecontrol).
For every bunker you control, you get one marine every 2 seconds.
The amount of marines you can control has been capped to 150.
To send all these marines, you can use this mass attack controller.
Thing here is that the player controls the marines, so they remain under your control while you issue the attack order. And what it does, trigger wise:

Code:
Team1massattack1
    Events
        Unit - A unit enters Team1mass1 <gen>
    Conditions
        (Unit-type of (Triggering unit)) Equal to Mass attack Controller
    Actions
        Unit - Move (Triggering unit) instantly to (Center of Team1massLoc <gen>)
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Owner of (Triggering unit)) Equal to Player 1 (Red)
            Then - Actions
                Unit Group - Pick every unit in (Units owned by Player 1 (Red)) and do (If ((Unit-type of (Picked unit)) Equal to Marine) then do (Unit - Order (Picked unit) to Attack-Move To (Center of Rect 065 <gen>)) else do (Do nothing))
            Else - Actions
                Do nothing
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Owner of (Triggering unit)) Equal to Player 2 (Blue)
            Then - Actions
                Unit Group - Pick every unit in (Units owned by Player 2 (Blue)) and do (If ((Unit-type of (Picked unit)) Equal to Marine) then do (Unit - Order (Picked unit) to Attack-Move To (Center of Rect 065 <gen>)) else do (Do nothing))
            Else - Actions
                Do nothing

Thing is, i've tested this. When i put the marines (all 150 of 'em) spread out over the map, they would not clogg, since they didn't bump into eachother.
Any ideas now you know this?

Edit:
(P.S. 1- I'm pretty skilled at triggering nowadays, i'm just trying to improve this very simple, and ineffective trigger.)
(P.S. 2- When you order a group of units to attack-move to a random place in a rectangle, do they all go to the same random spot, or are they each assigned a different spot?)
 
Level 9
Joined
Sep 8, 2004
Messages
633
Los_Tacos said:
Instead of picking every individual unit, you might want to select 12 at a time and order then to move as a group. Unit Group - Order (random 12 units of type marine) to attack move to point.

I thought of that too, but the problem is that it will keep doing that randomly, picking marines that are already at the destinated location too. I "could" Trigger around that, but it would be damn hard to get the system to move all marines there without skipping any or giving double orders.
 
Level 22
Joined
May 11, 2004
Messages
2,863
It really doesnt matter how you set up the selection. If they are all being issue orders under the same AI, even if in seperate trigger actions you have them selected as a groups, they will only be managed 12 at a time.

I remember when I first found out about this, I was in a similar situatiuon where I was trying to get 100+ units to attack using a "pick all units in region" action. Once I saw the problem, I originally split up the region into smaller ones, each with 12 units in them and had several "pick all units in region" so only 12 were moved from a region with each trigger. It didnt work. However, once I added in extra AI so only a fraction of the units were under the control of 1 AI at any given time, it worked perfectly and all units attacked simultaneously. So I dont think triggering will really help you here.
-VGsatomi
 
Level 9
Joined
Sep 8, 2004
Messages
633
VGsatomi said:
It really doesnt matter how you set up the selection. If they are all being issue orders under the same AI, even if in seperate trigger actions you have them selected as a groups, they will only be managed 12 at a time.

I remember when I first found out about this, I was in a similar situatiuon where I was trying to get 100+ units to attack using a "pick all units in region" action. Once I saw the problem, I originally split up the region into smaller ones, each with 12 units in them and had several "pick all units in region" so only 12 were moved from a region with each trigger. It didnt work. However, once I added in extra AI so only a fraction of the units were under the control of 1 AI at any given time, it worked perfectly and all units attacked simultaneously. So I dont think triggering will really help you here.
-VGsatomi

so basically this is not possible in warcraft 3, since i cannot start giving the marines to an AI for an X period of time, that would mess up the game mechanics.
Strange though, that they do not clogg up if they're well spread out, then they get the orders without problems.
 
Level 3
Joined
Oct 14, 2005
Messages
37
This is purely speculation, but what if when a unit is stopped because of an obstacle (say, a horde of units ahead of it) the AI has to re-issue the move command? That would explain the discrepancy, since dispersed units need only take a single set of move commands (in batches of 12), but the concentrated units would be constantly receiving new move commands, often not to the units in front that need them.
 
Level 2
Joined
Nov 15, 2005
Messages
18
i don't know if you'd want to do this but you could set collision size of the marine to 0. this would stop them from running into eachother, but it would also make it so the enemy could just walk right through your troops. Whaddaya think?
 
Level 9
Joined
Sep 8, 2004
Messages
633
Lord Nightbringer said:
This is purely speculation, but what if when a unit is stopped because of an obstacle (say, a horde of units ahead of it) the AI has to re-issue the move command? That would explain the discrepancy, since dispersed units need only take a single set of move commands (in batches of 12), but the concentrated units would be constantly receiving new move commands, often not to the units in front that need them.

Actually, that is exactly what i meant with advanced pathing, when it runs into something, it just calculates a new trajectory, but when it has to do that like 100x per second... boom!
How to fix it though..?




laser-eye said:
i don't know if you'd want to do this but you could set collision size of the marine to 0. this would stop them from running into eachother, but it would also make it so the enemy could just walk right through your troops. Whaddaya think?

That was the first thing that came to my mind as well, but it really isn't a viable option, looks really bad in big fights (marines all clustered together). It just messes up the game.

That's why i need to find another fix, not some simple not-so-good hotfix.
 
Status
Not open for further replies.
Top