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

How to reduce Lag

Status
Not open for further replies.
Level 3
Joined
Jan 1, 2013
Messages
43
Hallo, anyone know about leak checker???

i need it, please give me a link to download it,

my map it's so lag if i tried to cast a spell:vw_sad:
 
Level 28
Joined
Jan 26, 2007
Messages
4,789
Leak Checker is outdated, I wouldn't recommend it to anyone.
The best way to remove leaks is to learn about them and do it yourself (this is also faster than leak-checker, not including the time spent learning).

And if it lags even the first time you cast a spell, then leaks alone are probably not the cause.
Would you mind posting that spell here?
 
Level 3
Joined
Jan 1, 2013
Messages
43
ram 512, procesor intel celeron 1.8gHz, vga 125mb ATI radeon, hardisk 320GB,

is that enough to overcome the lag??
 
Level 26
Joined
Aug 18, 2009
Messages
4,097
People overestimate leaks. Non-interactive and non-graphical objects like locations or groups are cheap and they only get noticeable in late game when massed. Of course, you can spam them right off the bat but then creating them in the first place is what makes the difference in performance. Leaks are not sudden fps drops and their stress would persist even after your spell cast.

It is much more common, especially with GUI users, that they take disadvantageous coding structures like huge loops, non-cached data, too frequent intervals or unnecessary updates, expensive functions and just do not know what Wc3 can endure, which designs do not require too much.

Also, abilities that possess modified data in object editor will init this data once when they are casted/used for the first time.
 
People overestimate leaks. Non-interactive and non-graphical objects like locations or groups are cheap and they only get noticeable in late game when massed.
Depends of Maps ^^". If you do a slide and that you haven't removed leaks, then you already have 2 location leaks per player sliding per 0.01 seconds -> 200 location leaks per player sliding per second -> 2400 location leak per second if 12 players, that means 144000 leaks per minutes or 8640000 leaks per hour + 1 location leak per player per 0.05 seconds for checkpath (5 or more if it's not a simple one), or 864000 leaks per hour if 12 players (4320000 or more in case of complex one) + other things such as units patrolling.

If my memory is good, i had lags on warcraft 3 with a comp that had 512 mb ram, no graphic card (chipset) and dunno what processor. So, it might come from computer, but you should check if you have lags on other maps (not only melee ones).
 
Level 28
Joined
Jan 26, 2007
Messages
4,789
@askin9: post the spell, we might be able to tell you how to reduce stress on Warcraft.


@Vladadamm: isn't that what WaterKnight said? (He did say they're noticeable "when massed").
You probably also know that nobody should use 0.01 seconds for movements. But yes, new people often do that.

Anyhow, WaterKnight is correct (as are you, Vladadamm): leaks are only a problem if they've been spammed enough. Usually this doesn't happen until mid-/lategame (I still remember the old WinterMaul Wars had some serious FPS issues after 20-30 minutes :D).
Anyway, it certainly shouldn't be the case after casting a single spell.

So we've come to the conclusion that
ap0calypse said:
leaks alone are probably not the cause.

Warcraft III's minimum requirements are 128MB RAM, 400MHz processor.
Recommended is 256MB RAM, 600MHz processor.
(Yes, it's a really old game :p).

Still, even with those recommended requirements I think you can still experience some FPS drops whenever a heavy system gets activated.
And people who are new to triggering usually make every system pretty heavy (see WaterKnight's post).
 
Level 3
Joined
Jan 1, 2013
Messages
43
@askin9: post the spell, we might be able to tell you how to reduce stress on Warcraft.


@Vladadamm: isn't that what WaterKnight said? (He did say they're noticeable "when massed").
You probably also know that nobody should use 0.01 seconds for movements. But yes, new people often do that.

Anyhow, WaterKnight is correct (as are you, Vladadamm): leaks are only a problem if they've been spammed enough. Usually this doesn't happen until mid-/lategame (I still remember the old WinterMaul Wars had some serious FPS issues after 20-30 minutes :D).
Anyway, it certainly shouldn't be the case after casting a single spell.

So we've come to the conclusion that


Warcraft III's minimum requirements are 128MB RAM, 400MHz processor.
Recommended is 256MB RAM, 600MHz processor.
(Yes, it's a really old game :p).

Still, even with those recommended requirements I think you can still experience some FPS drops whenever a heavy system gets activated.
And people who are new to triggering usually make every system pretty heavy (see WaterKnight's post).

This is my spell, please help me to reduce the f*ck*ng laggggg...http://www.mediafire.com/?6yhbv8teyairmr9
 
Level 28
Joined
Jan 26, 2007
Messages
4,789
I don't like how Shadow Drain, Willowmaker, Essence Link and Tornade Blade use a 0.01-second timer, but there are no horribly coded spells.

These are the 'bad' triggers:

  • Expiration
    • Events
      • Time - Every 0.01 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) is in DUMMY_GROUP) Not equal to True
            • Then - Actions
              • Unit Group - Add (Picked unit) to DUMMY_GROUP
              • Trigger - Add to Adding <gen> the event (Unit - (Picked unit) Dies)
            • Else - Actions
  • Magic Coil Loop
    • Events
      • Time - Every 0.05 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in (Units in (Playable map area) matching (((Matching unit) has buff Magic Coil ) Equal to True)) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) is in MC_Detection) Not equal to True
            • Then - Actions
              • Unit Group - Add (Picked unit) to MC_Detection
              • Trigger - Add to Magic Coil Detection <gen> the event (Unit - (Picked unit) Takes damage)
            • Else - Actions
  • Weapon Guard 1
    • Events
      • Time - Every 0.05 seconds of game time
    • Conditions
    • Actions
      • Custom script: set bj_wantDestroyGroup = true
      • Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) is in WeaponGuard_Group) Not equal to True
            • Then - Actions
              • Unit Group - Add (Picked unit) to WeaponGuard_Group
              • Trigger - Add to Weapon Guard 2 <gen> the event (Unit - (Picked unit) Takes damage)
            • Else - Actions
  • Enchant Totem Group
    • Events
      • Time - Every 0.05 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) is in EnchantGroup) Not equal to True
            • Then - Actions
              • Unit Group - Add (Picked unit) to EnchantGroup
              • Trigger - Add to Enchant Attack <gen> the event (Unit - (Picked unit) Takes damage)
            • Else - Actions
  • Attack
    • Events
      • Time - Every 0.50 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) is in PowerPact_Group) Not equal to True
            • Then - Actions
              • Unit Group - Add (Picked unit) to PowerPact_Group
              • Trigger - Add to Limit Attack <gen> the event (Unit - (Picked unit) Takes damage)
            • Else - Actions
In front of all those triggers (as the first action), place this:
  • Custom script: set bj_wantDestroyGroup = true
And change every "X seconds" you see in those triggers to "0.50 seconds"
That will prevent a few leaks (there are more, but I couldn't find any more spammed leaks).

However, this isn't the cause for your lag. The cause is that this is a bigass map and it takes over 200MB of RAM to just run it. When you start doing some fancy stuff (like spells), that increases this value (though not for long).
If you keep in mind that your OS also needs a bit of that, you don't have much RAM left to do much else.

You're just going to have to decrease the map size (and save a little on the imports too).
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,202
if a spell causes lag first time its cast and that's the only spell you gotta buy some ram memory seriously
Too bad I have 6GB of memory, more than 2GBs more than the maximum process size WC3 can have as it is only 32 bit.

The cause actually is a failure to preload some data and assets.

The problem there is connected to the video card.
Actually it is mostly the CPU bottlenecking since WC3 consumes virtually nothing of the GPU. Exception is if you have huge billborded transparent surfaces as those seem to bottleneck GPU a lot.
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,202
set bj_wantDestroyGroup = true
The bj_wantDestroyGroup flag is used by the group iteration BJ to tell it that it should perform DestroyGroup(group) on the provided group after the iteration is complete when the flag is set to true. It then sets the flag to false so it needs to be set before every call to that BJ.
 
Status
Not open for further replies.
Top