Mass Units w/o Lag?

SnoopyLoL

New Member
Reaction score
6
Ok,
I'm trying to create a zombie siege map. There is a huge a mount of units (for the zombies). Whenever I spawn the zombies its fine but If I try to move them, it generates a huge amount of lag. Is there a way to fix this? Could somebody post a trigger that I could try. I wont bother to post my trigger because its worthless and I want to trash it :)
 
Post your trigger... So we can see if that has something to do with...anything.

Probably, just too many units.

What you could try is to remove units that are dead, at once, in gameplay constants > decay bones - 5.
Also, how many units do you create? How often... so on.

>Is there a way to fix this?
Reduce number of zombies created/ordered to move.
 
rawr T.T
i haven't mapped in a looong time. i've forgotten JASS, so its in the WE GUI triggering.
Code:
Moving
    Events
        Time - Every 40.00 seconds of game time
    Conditions
    Actions
        Unit Group - Pick every unit in (Units in (Entire map) matching (((Owner of (Matching unit)) Equal to Player 2 (Blue)) and ((((Matching unit) is in (Units of type Zombie)) Equal to True) or (((Matching unit) is in (Units of type Ranged Zombie)) Equal to True)))) and do (Actions)
            Loop - Actions
                Unit - Order (Picked unit) to Attack-Move To (Center of Survivor Base <gen>)

really simple. lawl. i would just like a replacement trigger.
the timing is every 40 seconds because the spawn is every 40 seconds.
AND any zombies on the map freeze whenever a new wave spawns :/
 
Order them right after they have been created.
Show us the trigger where you create them
PS: ever heard about leaks? :)
 
Yes I've heard of leaks but I forgot all about them, well not all about them but rather how to get rid of them and which ones are leaks ^_^
The code for clearin unit groups is something like... idr
JASS:
call DestroyGroup (udg_group_name)

??????


I changed them a little so I'll just post both.

Spawn
Code:
Spawning
    Events
        Time - Every 40.00 seconds of game time
    Conditions
    Actions
        Set zombie_spawn = (zombie_spawn + 2)
        Unit Group - Pick every unit in (Units owned by Player 2 (Blue) matching (((Matching unit) is in (Units of type Zombie Spawner)) Equal to True)) and do (Actions)
            Loop - Actions
                Unit - Create zombie_spawn Zombie for Player 2 (Blue) at (Position of (Picked unit)) facing (Position of Survivor Center 0002 <gen>)
        Unit Group - Pick every unit in (Units owned by Player 2 (Blue) matching (((Matching unit) is in (Units of type Zombie Spawner Ranged)) Equal to True)) and do (Actions)
            Loop - Actions
                Unit - Create zombie_spawn Ranged Zombie for Player 2 (Blue) at (Position of (Picked unit)) facing (Position of Survivor Center 0002 <gen>)
        Trigger - Run Moving <gen> (checking conditions)

Move:
Code:
Moving
    Events
    Conditions
    Actions
        Unit Group - Pick every unit in (Units in (Entire map) matching (((Owner of (Matching unit)) Equal to Player 2 (Blue)) and ((((Matching unit) is in (Units of type Zombie)) Equal to True) or (((Matching unit) is in (Units of type Ranged Zombie)) Equal to True)))) and do (Actions)
            Loop - Actions
                Unit - Order (Picked unit) to Attack-Move To (Center of Survivor Gate <gen>)
 
Code:
Untitled Trigger 002
    Events
        Map initialization
    Conditions
    Actions
        Set zombieMelee = (Units owned by Player 2 (Blue) of type Altar of Kings)
        Set zombieRanged = (Units owned by Player 2 (Blue) of type Barracks)
        Set attackpoint = (Center of Region 014 <gen>)

Code:
Untitled Trigger 003
    Events
        Time - Every 40.00 seconds of game time
    Conditions
    Actions
        Unit Group - Pick every unit in zombieMelee and do (Actions)
            Loop - Actions
                Set p = (Position of (Picked unit))
                Unit - Create 1 Knight for Player 2 (Blue) at p facing Default building facing degrees
                Custom script:   call RemoveLocation(udg_p)
                Unit - Order (Last created unit) to Attack-Move To attackpoint
        Unit Group - Pick every unit in zombieRanged and do (Actions)
            Loop - Actions
                Set p = (Position of (Picked unit))
                Unit - Create 1 Rifleman for Player 2 (Blue) at p facing Default building facing degrees
                Custom script:   call RemoveLocation(udg_p)
                Unit - Order (Last created unit) to Attack-Move To attackpoint
I could have optimized it a bit more, but...

At least they are leakfree, working triggers.

Besides, your trigger, it does not say how many units you create...
Code:
  Unit - Crea[COLOR="Red"]te XX zo[/COLOR]mbie_spawn Zombie for Player 2 (Blue) at (Position of (Picked unit)) facing (Position of Survivor Center 0002 <gen>)
There is no number there? :)

Also, to prevent "lag" a bit more... add something like this:
Code:
Untitled Trigger 004
    Events
        Unit - A unit Dies
    Conditions
        (Owner of (Triggering unit)) Equal to Player 2 (Blue)
        ((Triggering unit) is A Hero) Not equal to True
    Actions
        Wait 7.00 seconds
        Unit - Remove (Triggering unit) from the game
Or as I already said, change gameplany constants... Creeps - Decay Bones.

And of course, if those "zombieSpawningALtar/Barracks" are killable... Do this to prevent further spwaning:
Code:
Untitled Trigger 005
    Events
        Unit - A unit Dies
    Conditions
        (Unit-type of (Triggering unit)) Equal to Altar of Kings
    Actions
        Unit Group - Remove (Triggering unit) from zombieMelee

Edit:
Forgot to say: yes, call DestroyGroup(udg_UnitGroupVariable)
But you have to create the "UnitGroupVariable" first, then set it to some kind of group of units, then use those units to attack/die/move/jump/whatever, then call Destroy...

Edit: Oh, yes, integer variable...I read "zombie_spawn_Zombie" :)
 
ok I'll try that.
and it does say the amount spawned. zombie_spawn is an interger. the
Code:
Set zombie_spawn = zombie_spawn+2

Adds more units for every wave.


Update: thanks! that creates much less lag. +rep
but it would be wonderful if somebody could help me make it have less lag

Update 2: wait there's a problem, not all the zombies move! halp!

Update 3: o wait, there's an error in your triggers. it doesn't support making more than one zombie at a time... at least it wont move them.
 
There is no "bug" in my trigger. I create 1 knight at a time, I order then 1 knight at a time, if you create up to twelve, 12, units at a time, you can use:
Code:
Unit Group - Order (Last created unit group) to Attack-Move To (Center of Region 014 <gen>)

If the amount of spawned units (at one swapning place, at one "Zombie Spwaner") becomes greater than 12, which I assume it will, create a region around every ZombieSpawner, if a unit enters and the owner of entering unit is player 2 blue, order entering unit to attack-move to...

Hence:
Code:
Untitled Trigger 002
    Events
        Map initialization
    Conditions
    Actions
        Set zombieMelee = (Units owned by Player 2 (Blue) of type Altar of Kings)
        Set zombieRanged = (Units owned by Player 2 (Blue) of type Barracks)
        Set attackpoint = (Center of Region 014 <gen>)
        Unit Group - Pick every unit in zombieMelee and do (Actions)
            Loop - Actions
                Set ii = (ii + 1)
                Set p = (Position of (Picked unit))
                Set region[ii] = (Region centered at p with size (300.00, 300.00)) [COLOR="Red"]//A region, with the size of .. A bit bigger than an Altar, maybe you want it bigger, 500, 600, 700...[/COLOR]
                Trigger - Add to Untitled Trigger 007 <gen> the event (Unit - A unit enters region[ii])
                Custom script:   call RemoveLocation(udg_p)
        Unit Group - Pick every unit in zombieRanged and do (Actions)
            Loop - Actions
                Set ii = (ii + 1)
                Set p = (Position of (Picked unit))
                Set region[ii] = (Region centered at p with size (300.00, 300.00))
                Trigger - Add to Untitled Trigger 007 <gen> the event (Unit - A unit enters region[ii])
                Custom script:   call RemoveLocation(udg_p)

Code:
Untitled Trigger 007
    Events
    Conditions
        (Owner of (Triggering unit)) Equal to Player 2 (Blue)
    Actions
        Unit - Order (Triggering unit) to Attack-Move To attackpoint

And the spawn trigger, remove the order to move... it should look like this:
Code:
Untitled Trigger 003
    Events
        Time - Every 40.00 seconds of game time
    Conditions
    Actions
        Unit Group - Pick every unit in zombieMelee and do (Actions)
            Loop - Actions
                Set p = (Position of (Picked unit))
                Unit - Create 1 Knight for Player 2 (Blue) at p facing Default building facing degrees
                Custom script:   call RemoveLocation(udg_p)
        Unit Group - Pick every unit in zombieRanged and do (Actions)
            Loop - Actions
                Set p = (Position of (Picked unit))
                Unit - Create 1 Rifleman for Player 2 (Blue) at p facing Default building facing degrees
                Custom script:   call RemoveLocation(udg_p)

Of course, instead of adding regions like that, regions around each spawn, now I do not know how your map works, but if player 2 units only are going to attack towards the Center of some region, you could just have a little trigger like this:
Event - A unit enters playable map area
Condition - Triggering unit == Player2
Actions - Order to attack-move to attackpoint
 
Only 12 units can be fit into a group. Two options: loop from 1 to unit amount/12 or make the group variable an array setting each set of 12 units to a group using a loop to retrieve the array of the groups.
 
ok thanks that works. BUT i have another problem.
as the units are moving toward the survivor's base they often stop, freeze or pause. any ideas?
it seems as thought they are holding position. and they tend to group up 0_o

this also only happens when there is a large amounts of units on the map. perhaps it is caused by unit lag or something?
 
Too many units.
Reduce amount of creeps, add more hitpoints/damage on the creeps so it remains at the same "level". Also: creating 50 and 50 units at each spawn, not a good idea. They should rather come in 1/2/3/4/5 by 1/2/3/4/5 and rather decrease the time between each spawn, my opinion! :)

This is also the main reason why splash towers are so incredibly imbalanced in many TD's. The creeps just won't...:)

>>stop, freeze or pause. any ideas?
Basically what you had earlier on, just removing the leaks... With the event... every... 10-20-30 seconds? 5?
Set UnitGroupVariable = Unit owned by Player 2 blue
Pick every unit in UnitGroupVariable
- Order picked unit to attack-move to attackpoint
call DestroyGroup(udg_UnitGroupVariable)

Or stop increasing the amount of units being spawned. Or give defeat if there are over 300 units? Or even better, if there are... 300 units, make them all die, but create one hell of a big Frost Wyrm...No? :)

Another idea then: add expiration timer on the creeps, so none will lasts for longer than a minute?
 
The idea is supposed to be that there is a huge amount of zombies and they die very very fast. But the problem is that they don't get to the play so they don't die and so they accumulate. -_-
w/e
Im going to make a new map with the things that you said. thnx
 
@manytimes:
how would I be able to change a periodic event in the way you said?
like, quicken the spawn speed.

EDIT:
k here is the remade map. had some help on chat so now its lagless. :)
BUT unfortunately the zombies stack :/
idk if its done tho.
http://www.mediafire.com/?ymn2yzfiomm
 
Also, to prevent "lag" a bit more... add something like this:
Code:
Untitled Trigger 004
    Events
        Unit - A unit Dies
    Conditions
        (Owner of (Triggering unit)) Equal to Player 2 (Blue)
        ((Triggering unit) is A Hero) Not equal to True
    Actions
        Wait 7.00 seconds
        Unit - Remove (Triggering unit) from the game

This is not mui and will cause bugs!

add this
Code:
Untitled Trigger 004
    Events
        Unit - A unit Dies
    Conditions
        (Owner of (Triggering unit)) Equal to Player 2 (Blue)
        ((Triggering unit) is A Hero) Not equal to True
    Actions
        Custom script:   local unit [B]udg[/B]_tempunit = GetTriggerUnit()
        Wait 7.00 seconds
        Unit - Remove tempunit from the game
udg is a variable prefix to a variable you set up in the variable box! (its for jass)
 
There are not many ways - A unit is a unit.

Increasing the units speed to maxium decreases the time hte unit is alive (gets to target faster) and decreasing total distance can help a lot.
Splitting the zombies into 2 players or more migrates movement lag.
Try and avoid visible auras or extra parts on zombies.
Make the corpse/bones of the zombie dissapear very quickly - these can add up pretty quickly.
Do a fixed-seed sound test of zombies - the first test will use default sounds, look at framerate during large amount of zombie kills. Second test replaces the zombie sounds with empty ones - compare frame rate again (if there's a big difference, than reduce quality of zombie sound)

Remove any extra particles and lights from zombies
Reduce collision of zombie


But increasing the life/re spawn rate of zombies can ease up lag greatly. But that is just a personnel preference.
 
I'm not sure if this post is still being viewed but I had run into the same problem.

The issue is that the waypoints of the zombies lead their movement path on a collision course with each other. The zombies keep pausing because they are letting another zombie go by first in the pathing map, so with 50 zombies doing that at once, there are expontentially more collisions and the zombies hardly move.

If you reduce the Collision size of the zombies to zero, they will move without lag but they will also stack (i.e. their attacks would like one attack but actually be 50 attacks), not fun. This is how the tower maps are made.

Another solution is to make/download a movement script for the zombies so that they move orderly instead of all rushing to the same zone at once.

The other ideas here will not help with the pausing, except for reducing the distance, because there will be less collisions of movement paths.

Kind Regards,
Googs
 
When moving, you could turn off the collision of picked units.
Then add another trigger:
A unit is attacked
Attacking Unit is a zombie
turn on collision for attacking unit.

You can also make use of non-moving units such as wards and structures.
Or make use of 0 collision flying units.
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • Varine Varine:
    I don't think he ever figured out how to do the calamari in a pan though, like idk how to do that either. He was afraid of the at home deep fryers though and it's like yeah, that's fair, I am too
  • Varine Varine:
    He was just such a sweet old man, we had two servers pregnant and they held a baby shower together, he was soooooo fucking excited to get to see a baby. Unfortunately he died a month or so before they were born
  • The Helper The Helper:
    So I decided to Google some people that I had not seen or heard from in a while and sure enough one of my old best friends, we had a falling out years ago but whatever, find out he died of Pancreatic Cancer in January. I have also lost a few of my closer acquaintances from growing up the last year. Getting old - people die - I kinda thought it was going to be this way a few years ago....
    +2
  • The Helper The Helper:
    Forum running super slow again
  • Ghan Ghan:
    Not really clear from the stats as to what is causing the slowness.
  • Ghan Ghan:
    We get a lot of guest traffic so it may just be the load is getting too high and not from any particular source.
  • Ghan Ghan:
    Looks like the server is maxed out on CPU.
  • Ghan Ghan:
    Oh it looks like a lot of the traffic is Silkroad Forums. That domain isn't protected by Cloudflare.
  • Ghan Ghan:
    But the old Silkroad site is still on its own server. I just had a test site set up on this server for it.
  • Ghan Ghan:
    I just disabled that test site. Let's see if that helps the load.
  • Ghan Ghan:
    Looks much better already.
  • The Helper The Helper:
    I had actually forgot about the Silkroad site. I had asked
  • The Helper The Helper:
    SD Ryoko about it and he said the couple of people left on there really like it, that was a few years ago, maybe I should check back
  • jonas jonas:
    I guess when you're getting old, and the last day of soup season draws near, you start wondering
  • jonas jonas:
    will I make it to the start of the next season? or was this the last time I'll ever have my favorite dish?
  • The Helper The Helper:
    I am doing my first Vibe Coding project. In installed the environment and tools according to instructions but it is all chat doing this for me at my direction. It is fun really and holy shit I might finish in 2 hours what it would have taken a day to in my Access and this would be an electron app complete new
  • Ghan Ghan:
    Good stuff.
  • Ghan Ghan:
    Just make sure it is secure. :)
    +1
  • The Helper The Helper:
    It will only be on internal network
  • jonas jonas:
    Man the AI is good about gaslighting about security though. I've had several times where I pointed out security problems and it tried to convince me that with a tiny tweak it suddenly becomes secure
  • jonas jonas:
    Like using a distrobox as a "secure" container, and when I point out that's not secure at all, it claimed that specifying home will make it secure
  • The Helper The Helper:
    Yeah I finished the app today and it is bad ass. Like ChatGPT codes way better and faster than me that is for sure. The app is unsecure AF though and I would never put it anywhere it was obvious. I did not even show it today, the boss never made it in, but I showed the office and they liked it and frankly, I do software for a living and I am qualified to judge this kind of stuff and... Holy Shit this is a game changer. It took me around 4 hours to finish the app from design to end and that is much faster than I could have done it in the outdated MS Access the thing it replaced was in. Good Stuff! Had tons of fun doing it too! Work has not been fun in a while - today was fun!
    +1
  • The Helper The Helper:
    And really, I did not do it, chat wrote all the code I just pasted it in, tested it, acted like Chats eyes on it and just learned. I learned VS Code, how to use the Terminal and a bunch of Powershell and Command stuff, I used Git for the first time and learned how to save, search, start my server, stop it, run the tests, do some debugging - all the freaking fun stuff - chat wrote all the code
    +1
  • The Helper The Helper:
    I think the key was the 40 minutes of that 4 hours that went into the design of it. The thing was fully specced out before we started and the only reason it took so long was I had never done any of it and had to get used to the navigation and workflow.
    +1
  • The Helper The Helper:
    React, JS and AG Grid are the tools that I know i used along with git. I learned alot but it will be a minute before I fully understand everything I am doing in these environments because I am really just following instructions.
    +1

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials
      Top