1. Updated Resource Submission Rules: All model & skin resource submissions must now include an in-game screenshot. This is to help speed up the moderation process and to show how the model and/or texture looks like from the in-game camera.
    Dismiss Notice
  2. DID YOU KNOW - That you can unlock new rank icons by posting on the forums or winning contests? Click here to customize your rank or read our User Rank Policy to see a list of ranks that you can unlock. Have you won a contest and still havn't received your rank award? Then please contact the administration.
    Dismiss Notice
  3. The Lich King demands your service! We've reached the 19th edition of the Icon Contest. Come along and make some chilling servants for the one true king.
    Dismiss Notice
  4. The 4th SFX Contest has started. Be sure to participate and have a fun factor in it.
    Dismiss Notice
  5. The poll for the 21st Terraining Contest is LIVE. Be sure to check out the entries and vote for one.
    Dismiss Notice
  6. The results are out! Check them out.
    Dismiss Notice
  7. Don’t forget to sign up for the Hive Cup. There’s a 555 EUR prize pool. Sign up now!
    Dismiss Notice
  8. The Hive Workshop Cup contest results have been announced! See the maps that'll be featured in the Hive Workshop Cup tournament!
    Dismiss Notice
  9. Check out the Staff job openings thread.
    Dismiss Notice
Dismiss Notice
60,000 passwords have been reset on July 8, 2019. If you cannot login, read this.

My map is lagging hard and I need help

Discussion in 'Triggers & Scripts' started by gogeta55, Nov 2, 2019.

  1. gogeta55

    gogeta55

    Joined:
    Jul 12, 2017
    Messages:
    50
    Resources:
    1
    Maps:
    1
    Resources:
    1
    I feel like my map is lagging too much even when there's so little enemies. I think it may be cause of damage detection system but I'm not sure. I already did what Bribe (damage detection system creator) asked me to do but it seemed to not working out at all.

    I think it comes from other triggers of mine as well but I don't know what to fix at all even though I tried checking my 1000+ triggers.

    I wonder if anyone can help me with this. I really hit the dead end here and I wanna continue improving my map.

    Here is my map.

    I thank you in advance.
     

    Attached Files:

  2. FeelsGoodMan

    FeelsGoodMan

    Joined:
    Dec 13, 2018
    Messages:
    574
    Resources:
    2
    Maps:
    2
    Resources:
    2
    Check your periodic triggers for leaks. If they are already leakless then check if you often reference objects that aren't in the map (not sure if this can cause lag like that but it's worth a try).

    If all else fails then disable your triggers in chunks (around 10-20 at a time) until you find the faulty trigger.
     
  3. gogeta55

    gogeta55

    Joined:
    Jul 12, 2017
    Messages:
    50
    Resources:
    1
    Maps:
    1
    Resources:
    1
    reference objects? What and where is that?
     
  4. FeelsGoodMan

    FeelsGoodMan

    Joined:
    Dec 13, 2018
    Messages:
    574
    Resources:
    2
    Maps:
    2
    Resources:
    2
    Units, doodads, you name it. If you for example have a periodic trigger that orders a unit to move somewhere every 5 seconds, and that unit has been removed or not created yet then I believe that can cause some issues if you have a lot of it. I'm not sure if this is correct, but I have experienced my triggers going haywire when referencing units that aren't in the map.
     
  5. Pyrogasm

    Pyrogasm

    Joined:
    Feb 27, 2007
    Messages:
    3,056
    Resources:
    1
    Spells:
    1
    Resources:
    1
    This would not cause lag of any kind. Functions called with null arguments or unit functions called with dead unit arguments will not cause lag.
     
  6. gogeta55

    gogeta55

    Joined:
    Jul 12, 2017
    Messages:
    50
    Resources:
    1
    Maps:
    1
    Resources:
    1
    Those kind of triggers of mine have been turned off until it needs to do their jobs so not that one for sure. I'm out of idea sad life.
     
  7. BradPittlord

    BradPittlord

    Joined:
    Apr 1, 2019
    Messages:
    74
    Resources:
    0
    Resources:
    0
    Could be from creating unit groups periodically, my map lags a bit from that. Been trying workarounds like adding units to groups as they're sold

    At least for the periodic triggers still running
     
  8. chopinski

    chopinski

    Joined:
    May 16, 2012
    Messages:
    171
    Resources:
    0
    Resources:
    0
    I've learned i few thinks during my experiments with the editor and usually the most commom cause for lag is having too many units in the game at a given moment, specially if you have a lot of triggers that use the events "A Unit is Attack" or a damage engine. If thats your case, than i would recommend reviewing your triggers for better performance or enabling them only when necessary. Another cause for lag is having too many Destructables, like 30000. This is a problem because warcraft 3 do not hide Destructables that are out of your screen, unlike units, so if thats your case than i would recommend you importing [System] DestructableHider into your map. As @FeelsGoodMan and @BradPittlord said, check your trigger for leaks, specially your periodic ones and those that perform actions over an area or a group. If your map is lagging after a certain amount of time, than you can bet that it is probably caused by leaks, but if it lag right away than it most likely the first 2 situations. I would also recommend testing your map every time you add a new triggers/functionality so when stuff like this happen you will know straight away what is causing it.
     
  9. Serenity09

    Serenity09

    Joined:
    Mar 7, 2011
    Messages:
    49
    Resources:
    0
    Resources:
    0
    This is going to be the most important point in this thread. It could, and often is, both of these things, so I'd start by identifying & fixing leaks. Does anyone know if there's a working tool that scans your map and identifies leaks? I know none of them were ever 100%, but they were always a good starting point

    Performance testing, which is what you want, is one of the hardest things to do in the WC3 engine. There are two main reasons for this, but the end result is really what matters to you: there's no good clear and rigorous approach to this issue. Instead, you're left determining performance by experiment. You need to play your game and then observe the results to infer how your game is running. Here are some, maybe common sense, tactics to doing that:
    • Frame rate is currently your best indicator of performance, there are currently no in-game scripting tools which will give you reliable results. Make sure you uncap your framerate before using it this way!! I use WC's FPS feature, but I probably should use my GPU's
    • Trying to identify performance issues by reading through code is a lost cause. Besides leaks, most performance issues usually aren't bugs, its a lack of understanding of how something would scale, and then a code design that fails to compensate for that
    • Try to isolate the variables you're looking at in a single experiment. Don't just performance test your entire game, try to performance test specific aspects. I usually do this by testing stuff as I make it, so I have an idea of what performance was like before and after, but you can always do this later on by disabling scripts. I'd suggest starting with your most core functionality - the stuff whose performance does not depend on other stuff - and then work out from there
    • Don't jump to conclusions based on one experiments results. Often there are variables feeding into that result that you didn't anticipate, or your experiment forget to account for variables that'll exist in actual gameplay. Try to iterate on your important experiments, using each iterations findings to get you closer and more confident about your original goal
    • It's always best to understand the performance of your game as a whole and make decisions from there, but it's also okay/informative to tweak and check without full understanding. What you want to avoid is a runaway process of tweak-check-move on (no understanding), where it feels like things are magically working, and might also magically break, at any point