• 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.

Unit Lag

Status
Not open for further replies.
Level 19
Joined
Apr 25, 2006
Messages
1,309
This is my biggest problem with my zombie map. I did a little testing with it where I on purpose ran away from the attacking zombies and didn't kill them. After there were about 200 zombies after me they started stopping. What I did was I didn't shoot them and I didn't stand still, I was running in a circle all the time. What the zombies did was that they came in about a 500 radius away from me and stopped. When I moved they were facing me but didn't attack. The zombies could attack only if I stopped for more than a few seconds or especially if I started shooting them they would attack.

I really need help with this one. Is there a way to fix this or prevent it from happening? And I don't think a zombie map is anything without something like 100-400 zombies.

This problem isn't revealed during a defence mission where you have stationary barricades, turrets and polices helping you but if I try to do an escape mission where players are supposed to get somewhere this problem becomes very clear.

So please I really need help.
 
Level 10
Joined
Mar 16, 2009
Messages
354
the proble mis caused because of having to large of forces doing nothing, when enemeys of an inactive player are chasing they are all grouped in the same unit group so they will lag like in the normal game when you select 12 units and move them they wait for the slowest to catch up, it is in the same general sense. To prevent this you will need to find a way to add the zombies into unit groups upon an action with causing no leak.
on your spawning triggers add the action - add last created unit to zombies1 unit group
then a trigger

Event - unit comes within (the aquisition range of a unit in unit group zombies1)
condition - triggering unit is equal to player 1 or player 2 or player 3 or player 4 or player 5 or player 6(and so on)
Action - cause all units in unit group zombies 1 to patrol to point of triggering unit
Wait - 6 seconds stop
(that will make it so they wont chase indevifatly and will return to starting spot and stop instead of countinued patroling.)

dividing up the unit groups
Event - every 10 seconds
Actions - move units in unit group zombies1 to zombies2
Trigger - turn on (the next trigger mentioned)

Event - every 10 seconds
Actions - move units in unit group zombies2 to zombies3
Trigger - turn on (the next trigger mentioned)

you will aslo need to put a replica with slight modification of the attacking trigger:
Event - unit comes within (the aquisition range of a unit in unit group zombies1)
condition - triggering unit is equal to player 1 or player 2 or player 3 or player 4 or player 5 or player 6(and so on)
Action - cause all units in unit group zombies 1 to patrol to point of triggering unit
Wait - 6 seconds stop
(that will make it so they wont chase indevifatly and will return to starting spot and stop instead of countinued patroling.)

this will definatly take some time I am 90% positive it will work you might not want to try this untill I have tested it due to the time factor I should be able to test it towmarrow but I'm kinda bussy today sorry man. Let me know if you dont need me to test it.

the reason its not seen during a defense when you have mobile towers is because if you attack a unit the attacked unit and surrounding units are then moved from the idle units group and are then active hostile which means with less in the unit group their is less lag.
 
Level 19
Joined
Apr 25, 2006
Messages
1,309
I have been trying to think this through but I'm little confused. So you are saying all the units are somehow added to the same unit group which causes lag. And the solution to this is? I don't really understand how adding zombies1 to zombies2 would fix this. Is there a big difference if you use attack-move instead of patrol??
 
Level 10
Joined
Mar 16, 2009
Messages
354
no there is really no difference between attack move and patrol the thing is the game is always adding units to groups and classifying them and the idle units is an actual group so by seperating units into smaller groups you can elliminate the lag caused by large unit groups. Using the triggers in my first post the units will be seperated into smaller groups you will need to have a system like

dividing up the unit groups
Event - every 10 seconds
Actions - move units in unit group zombies1 to zombies2
Trigger - turn on (the next trigger mentioned)

Event - every 10 seconds
Actions - move units in unit group zombies2 to zombies3
Trigger - turn on (the next trigger mentioned)

dividing up the unit groups
Event - every 10 seconds
Actions - move units in unit group zombies1 to zombies3
Trigger - turn on (the next trigger mentioned)

Event - every 10 seconds
Actions - move units in unit group zombies2 to zombies4
Trigger - turn on (the next trigger mentioned)

dividing up the unit groups
Event - every 10 seconds
Actions - move units in unit group zombies3 to zombies4
Trigger - turn on (the next trigger mentioned)

Event - every 10 seconds
Actions - move units in unit group zombies4 to zombies5
Trigger - turn on (the next trigger mentioned)

do this style of triggering until you have all of your units you said 400 or so (i think) seperated in a way that there are 10 - 20 units in each group. The lag is cuased by large amounts of units under the same classification(idle, following, attacking are all in game groups of units) if one of these groups gets too high or their are too many actions happening it will lag. More then 200 units in one unit group will cause lagging, more then 255 units in one in-game unit groups(non user ajustable idle, following, attacking are all in game groups of units) I hope this gives clarification
 
Level 19
Joined
Apr 25, 2006
Messages
1,309
Are you saying I have to every 10 seconds change the unit group of units? =/ Can't I just add 12 units to first group and when it is full I start adding units to the next group. (The way I have done it) Does changing unit group really have some kind of effect? =/ Also I don't get the pattern you are using.
 
Level 10
Joined
Mar 16, 2009
Messages
354
Are you saying I have to every 10 seconds change the unit group of units? =/ Can't I just add 12 units to first group and when it is full I start adding units to the next group
well yeah thats all you have to do is change the unit groups when their full. I didn't know their was a condition for if unit group has x amount of units in it. After the unit groups are in place having 12 in each you need to set up a trigger making sure they dont go into a regular set unit group, such as attacking. Doing so by using a trigger involving you making the unit attack.
 
Level 19
Joined
Apr 25, 2006
Messages
1,309
you need to set up a trigger making sure they dont go into a regular set unit group, such as attacking. Doing so by using a trigger involving you making the unit attack.
And you are sure ordering the unit to attack when it comes to the acquisition range will prevent the problem? I will try this.

EDIT: It doesn't seem to have any effect.
 
Last edited:
Level 2
Joined
Mar 30, 2009
Messages
30
  • Events
    • Time - Every 0.60 seconds of game time
  • Conditions
  • Actions
    • Unit Group - Pick every unit in (Units in (Region centered at (Position of (Triggering unit)) with size (0.00, 0.00)) matching ((Matching unit) Equal to zombiee)) and do (Actions)
      • Loop - Actions
        • Unit - Order (Picked unit) to Attack-Move To (Position of (Triggering unit))
        • -------- This trigger leaks about 3 times so be sure to clean up --------
This should fix it and set the width and height of region.
 
Level 20
Joined
Oct 21, 2006
Messages
3,230
And how that helps?

Wc3 wasnt designed for controlling many units at the same time and so causes units to pause/stop for a few seconds when they are ordered to do something. It cant be fixed by triggers. Only way is to reduce the units per player.
 
Level 2
Joined
Mar 30, 2009
Messages
30
Valid argument :thumbs_up:

tho i still claim that it can be done with triggers by controlling just a few units at a time

The Sorrow
 
  • Events
    • Time - Every 0.60 seconds of game time
  • Conditions
  • Actions
    • Unit Group - Pick every unit in (Units in (Region centered at (Position of (Triggering unit)) with size (0.00, 0.00)) matching ((Matching unit) Equal to zombiee)) and do (Actions)
      • Loop - Actions
        • Unit - Order (Picked unit) to Attack-Move To (Position of (Triggering unit))
        • -------- This trigger leaks about 3 times so be sure to clean up --------
This should fix it and set the width and height of region.

That would make it worse, seeing as it leaks 3 times per instance.

As for your not attacking problem, make sure your issuing attack-move, not attack.

You can try disabling their gaurd position as well.

  • AI - Disable units gaurd position
 
Level 20
Joined
Oct 21, 2006
Messages
3,230
tho i still claim that it can be done with triggers by controlling just a few units at a time
How? Ordering them to move to somewhere? Its order, and as I said, ordering to do anything in any way, no matter was it trigger or not, it would cause the same problem.

I've had this "lag" problem before. And it makes ALL of player's units to stop when he had something like 400 units and ONE unit is ordered to do somethng.
 
Level 2
Joined
Mar 30, 2009
Messages
30
i know, its in trigger comment. But i don't know how to clean all those leaks. *hoping that someone will do it*

But should work with small region

Edit: ok Super-Sheep i guess your right
Edit#2 replace guess with sure (guess sounds disrespectful)
 
Level 10
Joined
Mar 16, 2009
Messages
354
Maybe having inactive zombies switch to netrual passive untill they are needed.
Or depending on how many zombies their are increase their movement/attack speed.
I'm really just spit-balling now, I'm not sure anymore. Changing the command lines so they were grouped smaller should have sovled the problem. Like TheSorrow their has got to be a way to handle this with triggers. Maybe hiding zombies until they come into visionof enemy players. Or making it a 10 player survival and adding zombies to cpu slots. I am really curious to the answer of this.
 
Level 19
Joined
Apr 25, 2006
Messages
1,309
There are no inactive zombies, they are all supposed to be heading towards the players. Hiding zombies is not a good option, besides I doubt units can move when hidden, haven't tested that though.
 
Last edited:
Level 8
Joined
Nov 9, 2008
Messages
502
I have experienced something similar in a few games. Games that have a huge amount of units present at one time.

XPQJ is probably right about grouping and orders but it seems to me this lagging is a consequence of the hard-coding and not counteractable with triggers.

I think what was meant by hiding the zombies was no create them only when necessary. So you would be limiting the amount of zombies but it wouldn't affect gameplay in the slightest.
For example, instead of having 200 zombies traveling towards players you could trigger to spawn a few zombies just outside the players FoV (Field of Vision).

In SWAT: Aftermath there are sufficient mass of zombies to be a threat and when a certain limit is reached there spawns an uber unit and no more zombies. This is incentive to kill zombies therefore keeping the unit number down.

I suggest using 2 slots for zombies and limiting each slot to only 75 zombies max. Use clever triggers to spawn zombies in positions that endanger the team enough for them not to care there aren't more of them (EDIT: wish there were less of them xD).

Quality, not quantity ;)
 
Last edited:
Status
Not open for further replies.
Top