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

amount of units in map and lag

Status
Not open for further replies.
Level 6
Joined
Jul 21, 2011
Messages
139
so in my map theres around 400 units

the thing is that my map still lags, so i wonder if it could be related to the huge amounts of units

do you think 400 is too much or should i keep looking for leaks else where?
 
Level 6
Joined
Jul 21, 2011
Messages
139
i would look for leaks elsewere. look at the tutorial for things that leak
the thing is that i been leak hunting for months now, cant believe im not done yet

400 is too much. It can't even support multi-command. Maybe you are leaking it when you are creating or their animations reducts fps and causes major lag. Models can also be the suspect because it lags when so many units are inside the player's camera sight.
ill post the triggers i use to re spawn the units, so you guys can check it and no, the units are all over the map, you wont have many in your screen together

PC specs?
Any trigger systems?
How many players between the units?
my pc is decent , dont think thats the problem, but something i noticed is that the more players the more lag / the faster it starts laggin

Lol, 400 units in a map is nothing, as long as they aren't all on the same screen.

I'd say look for leaks, clean them up and optimize all the triggers, especially periodic enumerations.
just to add more info, my map is

180x180
192x192


edit:

  • abc123
    • Acontecimientos
      • Map initialization
    • Condiciones
    • Acciones
      • Set tiempogrupo = (Units of type Tauren)
      • Grupo de unidad - Pick every unit in tiempogrupo and do (Actions)
        • Bucle: Acciones
          • Set Integer = (Integer + 1)
          • Unidad - Set the custom value of (Picked unit) to Integer
          • Custom script: set udg_Creep_X[udg_Integer] = GetUnitX(GetEnumUnit())
          • Custom script: set udg_Creep_Y[udg_Integer] = GetUnitY(GetEnumUnit())
          • Custom script: call DestroyGroup(udg_tiempogrupo)
      • Custom script: call DestroyGroup(udg_tiempogrupo)
another question as you can see i used destroygroup twice above, i guess i used to do it just to "feel safe" about the leak being fixed, but i also remember someone saying that we shouldnt put leak removals in loops, is that right? what problem would it cause?


  • ReviveCreep
    • Acontecimientos
      • Unidad - A unit owned by Neutral hostil Muere
    • Condiciones
      • (Unit-type of (Dying unit)) Igual a Tauren
    • Acciones
      • Wait 20.00 seconds
      • Set tiempopunto[1] = (Center of (Entire map))
      • Set tiempopunto[2] = (tiempopunto[1] offset by (Creep_X[(Custom value of (Triggering unit))], Creep_Y[(Custom value of (Triggering unit))]))
      • Unidad - Create 1 (Unit-type of (Dying unit)) for Neutral hostil at tiempopunto[2] facing (Random angle) degrees
      • Unidad - Set the custom value of (Last created unit) to (Custom value of (Triggering unit))
      • Custom script: call RemoveLocation(udg_tiempopunto[1])
      • Custom script: call RemoveLocation(udg_tiempopunto[2])
      • Unidad - Remove (Dying unit) from the game
 
Level 30
Joined
Nov 29, 2012
Messages
6,637
400 units is too much for wc3 to handle. Also if you have a trigger that creates 400 units, that will really lag due to it is too many for Warcraft to handle. I suggest just make the enemies wave by wave and not 400 units all the way. Example 25-50 units maybe eadch wave and make intervals in the wave spawns because making waves spawn all the time makes wc3 lag also.
 
400 units is too much for wc3 to handle. Also if you have a trigger that creates 400 units, that will really lag due to it is too many for Warcraft to handle. I suggest just make the enemies wave by wave and not 400 units all the way. Example 25-50 units maybe eadch wave and make intervals in the wave spawns because making waves spawn all the time makes wc3 lag also.
Total bullshit. I got over 900 units in my map, all pre-placed. My map size is 480x256. No lagging at all.
It's leaks that's causing this or a high poly count of custom imported models.

Try to disable all triggers in your map. Is you map still lagging?
If not, search for leaks!

If yes, try to put this into your map and see if it gets better:
http://www.hiveworkshop.com/forums/jass-resources-412/system-destructablehider-219569/


Now, to your questions:
another question as you can see i used destroygroup twice above, i guess i used to do it just to "feel safe" about the leak being fixed, but i also remember someone saying that we shouldnt put leak removals in loops, is that right? what problem would it cause?
Don't ever do that! Only destroy a group that actually exists or the thread/trigger will crash and not be able to run until the end!
Also, you destroy the group after each single enum process. Which means only the first enumed unit is affected, all others will simply be ignored, as the whole thread crashes after the first unit. Simply delete the group destruction inside the enumeration loop and it should work. Also, instead of using the custom unit value, use a http://www.hiveworkshop.com/forums/jass-resources-412/system-unit-indexer-172090/

In the second trigger you posted, instead of using "Dying Unit", use "Triggering Unit", or the trigger will bug as soon as more than one unit dies within 20 seconds.
 

Rheiko

Spell Reviewer
Level 25
Joined
Aug 27, 2013
Messages
4,121
moderators need to close this thread
232216-albums6711-picture73883.png
 
Status
Not open for further replies.
Top