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

Lag issue

Status
Not open for further replies.
You can debug yourself or you can upload map here for us to try to help you fix. If you want to debug it yourself then investigate the matter one by one finding who is the culprit. It sounds like high-poly models though which means like rips/exports from another game that are too graphically intense to be rendered easily which then costs a lot of power from peoples computers. However it might not be that, try checking through triggers first.
 
Level 11
Joined
Jan 23, 2015
Messages
788
Well, I have two long triggers, it's about the creep waves messages and changing the unit type for each wave.. but it's just 'display message' and 'set variable', it can't be the reason for the lag when more than 70 units are spawned?
 
Level 11
Joined
Jan 23, 2015
Messages
788
  • WavesSpawner
    • Events
      • Time - Elapsed game time is 30.00 seconds
    • Conditions
    • Actions
      • For each (Integer A) from 1 to 30, do (Actions)
        • Loop - Actions
          • Set TempPoint01 = (Random point in Spawn01 <gen>)
          • Set TempPoint02 = (Random point in Spawn02 <gen>)
          • Set TempPoint03 = (Random point in Spawn03 <gen>)
          • Set TempPoint04 = (Random point in Spawn04 <gen>)
          • Set TempPoint05 = (Random point in Spawn05 <gen>)
          • Set TempPoint06 = (Random point in Spawn06 <gen>)
          • Unit - Create CreepsBorn UnitType for Player 12 (Brown) at TempPoint01 facing Default building facing degrees
          • Unit - Create CreepsBorn UnitType for Player 12 (Brown) at TempPoint02 facing Default building facing degrees
          • Unit - Create CreepsBorn UnitType for Player 12 (Brown) at TempPoint03 facing Default building facing degrees
          • Unit - Create CreepsBorn UnitType for Player 12 (Brown) at TempPoint04 facing Default building facing degrees
          • Unit - Create CreepsBorn UnitType for Player 12 (Brown) at TempPoint05 facing Default building facing degrees
          • Unit - Create CreepsBorn UnitType for Player 12 (Brown) at TempPoint06 facing Default building facing degrees
          • Set CreepsAlive = (CreepsAlive + 6)
          • Custom script: call RemoveLocation (udg_TempPoint01)
          • Custom script: call RemoveLocation (udg_TempPoint02)
          • Custom script: call RemoveLocation (udg_TempPoint03)
          • Custom script: call RemoveLocation (udg_TempPoint04)
          • Custom script: call RemoveLocation (udg_TempPoint05)
          • Custom script: call RemoveLocation (udg_TempPoint06)
          • Leaderboard - Change the value for Player 12 (Brown) in Leaderboard to CreepsAlive
          • Wait 1.00 seconds
The trigger that spawns the units.

  • WavesChangeUnit
    • Events
      • Time - Elapsed game time is 29.00 seconds
    • Conditions
    • Actions
      • Set UnitType = Peon 1
      • Trigger - Run WavesSpawner <gen> (ignoring conditions)
      • Wait CreepsReload seconds
      • Set UnitType = Footman 2
      • Trigger - Run WavesSpawner <gen> (ignoring conditions)
      • Wait CreepsReload seconds
      • Set UnitType = Satyr Trickster 3
      • Trigger - Run WavesSpawner <gen> (ignoring conditions)
      • Wait CreepsReload seconds
      • Set UnitType = Crypt Fiend 4
      • Trigger - Run WavesSpawner <gen> (ignoring conditions)
      • Wait CreepsReload seconds
      • Set UnitType = Dire Wolf 5
      • Trigger - Run WavesSpawner <gen> (ignoring conditions)
      • Wait CreepsReload seconds
      • Set UnitType = Dryad 6
      • Trigger - Run WavesSpawner <gen> (ignoring conditions)
      • Wait CreepsReload seconds
      • Set UnitType = Grunt 7
      • Trigger - Run WavesSpawner <gen> (ignoring conditions)
      • Wait CreepsReload seconds
      • Set UnitType = Hippogryph Rider 8
      • Trigger - Run WavesSpawner <gen> (ignoring conditions)
      • Wait CreepsReload seconds
      • Set UnitType = Knight 9
      • Trigger - Run WavesSpawner <gen> (ignoring conditions)
      • Wait CreepsReload seconds
      • Set UnitType = Razormane Brute 10
      • Trigger - Run WavesSpawner <gen> (ignoring conditions)
      • Wait CreepsReload seconds
      • Set UnitType = Assassin 11
      • Trigger - Run WavesSpawner <gen> (ignoring conditions)
      • Wait CreepsReload seconds
      • Set UnitType = Huntress 12
      • Trigger - Run WavesSpawner <gen> (ignoring conditions)
      • Wait CreepsReload seconds
      • Set UnitType = Battle Golem 13
      • Trigger - Run WavesSpawner <gen> (ignoring conditions)
      • Wait CreepsReload seconds
      • Set UnitType = Tauren 14
      • Trigger - Run WavesSpawner <gen> (ignoring conditions)
      • Wait CreepsReload seconds
      • Set UnitType = Dragonhawk Rider 15
      • Trigger - Run WavesSpawner <gen> (ignoring conditions)
      • Wait CreepsReload seconds
      • Set UnitType = Giant Spider 16
      • Trigger - Run WavesSpawner <gen> (ignoring conditions)
      • Wait CreepsReload seconds
      • Set UnitType = Abomination 17
      • Trigger - Run WavesSpawner <gen> (ignoring conditions)
      • Wait CreepsReload seconds
      • Set UnitType = Ogre Mauler 18
      • Trigger - Run WavesSpawner <gen> (ignoring conditions)
      • Wait CreepsReload seconds
      • Set UnitType = Queen of Suffering 19
      • Trigger - Run WavesSpawner <gen> (ignoring conditions)
      • Wait CreepsReload seconds
      • Set UnitType = Mountain Giant 20
      • Trigger - Run WavesSpawner <gen> (ignoring conditions)
      • Wait CreepsReload seconds
      • Set UnitType = Kodo Beast 21
      • Trigger - Run WavesSpawner <gen> (ignoring conditions)
      • Wait CreepsReload seconds
      • Set UnitType = Harpy Queen 22
      • Trigger - Run WavesSpawner <gen> (ignoring conditions)
      • Wait CreepsReload seconds
      • Set UnitType = Unbroken Rager 23
      • Trigger - Run WavesSpawner <gen> (ignoring conditions)
      • Wait CreepsReload seconds
      • Set UnitType = Bad Guy 24
      • Trigger - Run WavesSpawner <gen> (ignoring conditions)
      • Wait CreepsReload seconds
      • Set UnitType = Bandit 25
      • Trigger - Run WavesSpawner <gen> (ignoring conditions)
      • Wait CreepsReload seconds
      • Set UnitType = Arachnathid 26
      • Trigger - Run WavesSpawner <gen> (ignoring conditions)
      • Wait CreepsReload seconds
      • Set UnitType = Elder Wendigo 27
      • Trigger - Run WavesSpawner <gen> (ignoring conditions)
      • Wait CreepsReload seconds
      • Set UnitType = Gargantuan Sea Turtle 28
      • Trigger - Run WavesSpawner <gen> (ignoring conditions)
      • Wait CreepsReload seconds
      • Set UnitType = Red Drake 29
      • Trigger - Run WavesSpawner <gen> (ignoring conditions)
      • Wait CreepsReload seconds
      • Set UnitType = Troll Berserker 30
      • Trigger - Run WavesSpawner <gen> (ignoring conditions)
      • Custom script: call DestroyTrigger( GetTriggeringTrigger() )
The trigger that changes unit type.

  • WavesMessages
    • Events
      • Time - Elapsed game time is 15.00 seconds
    • Conditions
    • Actions
      • Quest - Display to (All players) the Warning message: Wave 1 of 30 [|cff3...
      • Wait MessagesTime seconds
      • Quest - Display to (All players) the Warning message: Wave 2 of 30 [|cff3...
      • Wait MessagesTime seconds
      • Quest - Display to (All players) the Warning message: Wave 3 of 30 [|cff3...
      • Wait MessagesTime seconds
      • Quest - Display to (All players) the Warning message: Wave 4 of 30 [|cff3...
      • Wait MessagesTime seconds
      • Quest - Display to (All players) the Warning message: Wave 5 of 30 [|cff0...
      • Wait MessagesTime seconds
      • Quest - Display to (All players) the Warning message: Wave 6 of 30 [|cff3...
      • Wait MessagesTime seconds
      • Quest - Display to (All players) the Warning message: Wave 7 of 30 [|cff3...
      • Wait MessagesTime seconds
      • Quest - Display to (All players) the Warning message: Wave 8 of 30 [|cfff...
      • Wait MessagesTime seconds
      • Quest - Display to (All players) the Warning message: Wave 9 of 30 [|cff3...
      • Wait MessagesTime seconds
      • Quest - Display to (All players) the Warning message: Wave 10 of 30 [|cff...
      • Wait MessagesTime seconds
      • Quest - Display to (All players) the Warning message: Wave 11 of 30 [|cff...
      • Wait MessagesTime seconds
      • Quest - Display to (All players) the Warning message: Wave 12 of 30 [|cff...
      • Wait MessagesTime seconds
      • Quest - Display to (All players) the Warning message: Wave 13 of 30 [|cff...
      • Wait MessagesTime seconds
      • Quest - Display to (All players) the Warning message: Wave 14 of 30 [|cff...
      • Wait MessagesTime seconds
      • Quest - Display to (All players) the Warning message: Wave 15 of 30 [|cff...
      • Wait MessagesTime seconds
      • Quest - Display to (All players) the Warning message: Wave 16 of 30 [|cff...
      • Wait MessagesTime seconds
      • Quest - Display to (All players) the Warning message: Wave 17 of 30 [|cff...
      • Wait MessagesTime seconds
      • Quest - Display to (All players) the Warning message: Wave 18 of 30 [|cff...
      • Wait MessagesTime seconds
      • Quest - Display to (All players) the Warning message: Wave 19 of 30 |cff9...
      • Wait MessagesTime seconds
      • Quest - Display to (All players) the Warning message: Wave 20 of 30 [|cff...
      • Wait MessagesTime seconds
      • Quest - Display to (All players) the Warning message: Wave 21 of 30 [|cff...
      • Wait MessagesTime seconds
      • Quest - Display to (All players) the Warning message: Wave 22 of 30 [|cff...
      • Wait MessagesTime seconds
      • Quest - Display to (All players) the Warning message: Wave 23 of 30 [|cff...
      • Wait MessagesTime seconds
      • Quest - Display to (All players) the Warning message: Wave 24 of 30 [|cff...
      • Wait MessagesTime seconds
      • Quest - Display to (All players) the Warning message: Wave 25 of 30 [|cff...
      • Wait MessagesTime seconds
      • Quest - Display to (All players) the Warning message: Wave 26 of 30 |cff9...
      • Wait MessagesTime seconds
      • Quest - Display to (All players) the Warning message: Wave 27 of 30 [|cff...
      • Wait MessagesTime seconds
      • Quest - Display to (All players) the Warning message: Wave 28 of 30 [|cff...
      • Wait MessagesTime seconds
      • Quest - Display to (All players) the Warning message: Wave 29 of 30 [|cff...
      • Wait MessagesTime seconds
      • Quest - Display to (All players) the Warning message: Wave 30 of 30 [|cff...
      • Custom script: call DestroyTrigger( GetTriggeringTrigger() )
The trigger that displays wave messages.
 
Level 24
Joined
Aug 1, 2013
Messages
4,657
Waits should be "Wait (...) seconds of gametime" if you do not want to use timers.

If spawn 1 <gen>, spawn 2 <gen> etc are very small, you should set the location variables to the center and use that one over and over again instead of making a new one every time.

Also never use wait or wait gametime in loops.
Make a timer and start the timer when you want to spawn the units.
Event -> Elapsed gametime = 29 seconds.
Action -> Start CreepSpawnTimer as repeating with 1 second.
Make a new trigger, When CreepSpawnTimer expires, create the units and set an integer +1.
When the integer reaches 30, you can stop the timer to stop the spawn... or whatever you wanted to do.

More than that, I cannot see.
 
One major problem with warcraft 3 is any order that makes a unit move. This causes the unit to recalculate its path through the terrain, which is very costly performance-wise. Which I assume you are using as this can easily cause lag with as little as 50 units being ordered every second.

This may or may not be the case, however you should post your map. Don't fret about someone stealing your map; they won't.
 
Level 11
Joined
Jan 23, 2015
Messages
788
I've been opening other td maps to study them and learn making my own, on those maps, there's even more triggers and units, but it still doesn't lags, while my map lags :/

I'm using regions to move the creeps. When a unit owned by the player of the creeps enters a corner, the unit moves to other corner.. I think it's the same with all other td maps
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,202
Waits should be "Wait (...) seconds of gametime" if you do not want to use timers.
Except that action leaks a handle pointer.

The most likely cause is that the units have not been pre-loaded so the game stalls for I/O to load the unit's assets. This only happens some times because the OS will cache asset data and the game might cache the actual loaded assets. Using a preloader to read all WC3 data into memory should reduce the length of the stall. Placing one unit of each wave on the map so that they get loaded at map initialization (during load screen) will completely remove the stalls at the cost of slightly longer map load time.

If your map has generally low frame rate continuously then this is not the case. Asset stalls will be once off spikes at the start of every new wave.

If the problem is generally low performance when 70 units are on the map then there is something running with a unit based complexity that consumes a lot of resources. For example massive area damage, badly written unit search triggers, high frequency unit polling triggers, various abilities with huge area etc.
 
Level 11
Joined
Jan 23, 2015
Messages
788
I replaced the first wave with not modified units, and it still lagged.. I guess it's something with the triggers, cause it didn't lagged before, but when I added new triggers, it started lagging, I'll try to find the source..
 
Level 11
Joined
Jan 23, 2015
Messages
788
I've solved my problem!! I've just figured out that I didn't changed the 'wait' action to 'wait (game-time)' for the wave messages trigger, I did that and now the map doesn't lags when even 200 units are spawned!! :))

Thank you all for helping me!!
 
Level 24
Joined
Aug 1, 2013
Messages
4,657
I've solved my problem!! I've just figured out that I didn't changed the 'wait' action to 'wait (game-time)' for the wave messages trigger, I did that and now the map doesn't lags when even 200 units are spawned!! :))

Thank you all for helping me!!
(0.o)

@DSG
Am I missing something or is ^^^that^^^ supposed to actually reduce performance?

I mean... yes I told him to change it but a WaitTimer (PolledWait) uses a SleepAction itself...

EDIT: I think that it was not laggin' but rather has a delay between the spawn and display... I don't know of any other explanation myself.
 
Status
Not open for further replies.
Top