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 haven't received your rank award? Then please contact the administration.
    Dismiss Notice
  3. Ride into the sunset with the 32nd Modeling Contest. The contest is optionally paired. Best of luck, people!
    Dismiss Notice
  4. This adventure has come to an end. Congratulate our heroes in the 16th Mini Mapping Contest Results.
    Dismiss Notice
  5. From the gates of hell, the 5th Special Effect Contest Results have emerged.
    Dismiss Notice
  6. Race against the odds and Reforge, Don't Refund. The 14th Techtree Contest has begun!
    Dismiss Notice
  7. 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.

[Lua]Obliterate all GUI leaks with 1 trigger!

Discussion in 'The Lab' started by Dr Super Good, Jun 5, 2019.

  1. JC Helas

    JC Helas

    Joined:
    Oct 19, 2014
    Messages:
    126
    Resources:
    3
    Maps:
    1
    Spells:
    2
    Resources:
    3
    Edit:
    you create too much locations,groups.one mistake like you forgot to import this system,, totally dead XD
     
  2. Dr Super Good

    Dr Super Good

    Spell Reviewer

    Joined:
    Jan 18, 2005
    Messages:
    25,930
    Resources:
    3
    Maps:
    1
    Spells:
    2
    Resources:
    3
    This will only fix leaks. It cannot fix if one keeps references to the objects.
     
  3. George Stinz

    George Stinz

    Joined:
    Jan 12, 2020
    Messages:
    5
    Resources:
    0
    Resources:
    0
    Hello and thanks for writing this. I am unable to test your map (or mine with your triggers). The game just sits there forever on the door knocker screen (with a small blue square on the bottom left).

    Can you confirm this still works with current patch?
     
  4. Dr Super Good

    Dr Super Good

    Spell Reviewer

    Joined:
    Jan 18, 2005
    Messages:
    25,930
    Resources:
    3
    Maps:
    1
    Spells:
    2
    Resources:
    3
    Yes it works with 1.31.

    It may not work with 1.32 which is currently in beta. Blizzard may have implemented something similar natively so it is no longer required. I cannot test 1.32 beta (do not have Reforged) but the synchronized garbage collector certainly does not work from what other people have said.
     
  5. George Stinz

    George Stinz

    Joined:
    Jan 12, 2020
    Messages:
    5
    Resources:
    0
    Resources:
    0
    I am in fact using 1.32. I don't see anything in the patch notes. However, I did find a few people complaining about lua in recent patch notes feedback.
    Anyway, it sounded so lovely to me. Maybe closer to release, it will work again. Thanks.
     
  6. Anachron

    Anachron

    Joined:
    Sep 9, 2007
    Messages:
    6,221
    Resources:
    66
    Icons:
    49
    Packs:
    2
    Tools:
    1
    Maps:
    3
    Spells:
    9
    Tutorials:
    1
    JASS:
    1
    Resources:
    66
    Sorry to say this but for me this is a nice gimmick, nothing more.

    Yes it works, yes it helps but in my opinion this should never replace correct cleanup handling. This will cause additional stress on the game which can be prevented by doing cleanups correctly in the first place.

    I like the idea/concept, but I fear this will lead to even worse coding in maps.
     
  7. Dr Super Good

    Dr Super Good

    Spell Reviewer

    Joined:
    Jan 18, 2005
    Messages:
    25,930
    Resources:
    3
    Maps:
    1
    Spells:
    2
    Resources:
    3
    Additional stress?
    Locations, groups and forces should never have leaked to begin with. In StarCraft II there are no such problems.
     
  8. verstefyren

    verstefyren

    Joined:
    Jun 6, 2015
    Messages:
    45
    Resources:
    0
    Resources:
    0
    This is so nice for lazyasses like myself. I hope this will work on reforged in the future.
     
  9. Dr Super Good

    Dr Super Good

    Spell Reviewer

    Joined:
    Jan 18, 2005
    Messages:
    25,930
    Resources:
    3
    Maps:
    1
    Spells:
    2
    Resources:
    3
    The underlying concept should at least still work. But the garbage collector synchronization does not. Hopefully Blizzard is synchronizing it so the system does work, otherwise it will cause OoS in multiplayer.
     
  10. Kyrbi0

    Kyrbi0

    Joined:
    Jul 29, 2008
    Messages:
    7,981
    Resources:
    1
    Models:
    1
    Resources:
    1
    Is... Is it.. True?

    Has the Blessed Day thusly come upon us?
     
  11. Uncle

    Uncle

    Joined:
    Aug 10, 2018
    Messages:
    990
    Resources:
    0
    Resources:
    0
    Does this still work with the current patch? I've been suggesting using this to new users and I'm worried that it might cause them problems.
     
  12. Dr Super Good

    Dr Super Good

    Spell Reviewer

    Joined:
    Jan 18, 2005
    Messages:
    25,930
    Resources:
    3
    Maps:
    1
    Spells:
    2
    Resources:
    3
    Lua garbage collector synchronization should no longer work but also not be required.

    The automatic garbage collection of locations, groups and forces should still work. As long as hashtables are not involved with the objects.
     
  13. Uncle

    Uncle

    Joined:
    Aug 10, 2018
    Messages:
    990
    Resources:
    0
    Resources:
    0
    Do I have to run this code in anyway? And thanks for the quick response.
     
  14. Dr Super Good

    Dr Super Good

    Spell Reviewer

    Joined:
    Jan 18, 2005
    Messages:
    25,930
    Resources:
    3
    Maps:
    1
    Spells:
    2
    Resources:
    3
    Yes. It runs itself if the map is in Lua mode.

    I have not tested to confirm that it still works. However I do not see why it should no longer work.
     
  15. Uncle

    Uncle

    Joined:
    Aug 10, 2018
    Messages:
    990
    Resources:
    0
    Resources:
    0
    Hmm, so I threw in some: print("Removed Leak") throughout the code and it doesn't appear to be displaying this message.

    Edit: Nevermind, it appears to be working.
     
  16. LtCabble

    LtCabble

    Joined:
    Jul 23, 2019
    Messages:
    5
    Resources:
    0
    Resources:
    0
    Hey Dr Super,

    i'm using this System since you released it and it worked fine until reforged. The Debug Print pressing ESC does not work anymore since then (Debug is set to True).

    If i put a normal Print("Hello") in function Lua_Test_Action() it works, but nothing else is getting printed anymore. The thing is, i dont even know if the system is working at all because of that.

    At the moment i'm trying to get my map working again, because it desyncs at completely random times since reforged (At least i think that's the problem. There are no error messages at all, it just puts you back in the menu).
     
  17. Uncle

    Uncle

    Joined:
    Aug 10, 2018
    Messages:
    990
    Resources:
    0
    Resources:
    0
    So after importing this script and Bribe's [Lua] Perfect PolledWait (GUI-friendly) into my map I started getting consistent desyncs when playing online.

    I disabled both of these scripts and the desyncs stopped. So I can't say for certain which script was causing it since I disabled both at the same time, but I figure it's worth looking into. I can test just this when I get a chance.
     
    Last edited: Mar 18, 2020
  18. Dr Super Good

    Dr Super Good

    Spell Reviewer

    Joined:
    Jan 18, 2005
    Messages:
    25,930
    Resources:
    3
    Maps:
    1
    Spells:
    2
    Resources:
    3
    Access to the functions that were used to track garbage collector stats is no longer possible since 1.32 since all the garbage collector stuff is now handled internally and is not a concern for the user.

    The actual mechanics of the system should still operate correctly and clean up leaks.
     
  19. LtCabble

    LtCabble

    Joined:
    Jul 23, 2019
    Messages:
    5
    Resources:
    0
    Resources:
    0
    Luckily i got some testing in and i'm 99% sure now, that the desyncing is caused by the gc script. I tried many things before doing that but nothing helped. After deactivating it we could play some games without problems, one even lasting an hour (Game was over then). We played with 3 and 4 Players.

    Interestingly my map did not run into problems at all, even though i removed all custom code to activate lua. My map is extremely leaky now, in old wc3 it would have survived a maximum of maybe 20 minutes.

    @Uncle I have Bribe's [Lua] Perfect PolledWait (GUI-friendly) script aswell. So far my map seems to be working again so i asume it's save.
     
  20. aka Orion

    aka Orion

    Joined:
    Jan 18, 2012
    Messages:
    26
    Resources:
    0
    Resources:
    0
    Hey Super good,
    Thank you for the hard work you are doing!

    Does this still work? The test map doesnt even load with the "network test" trigger . it runs after i delete it , but i see no signs of it working. Also i created lots and lots of leaky triggers in my map and tested it with and without the garbage collector and my memory usage stayed the same .

    Does this work with the same variable changed multiple times in the same trigger(example below)?

    Set VariableSet TempGroup = (Units in (Region centered at (Position of (Attacked unit)) with size (00.00, 700.00)) owned by (Owner of (Attacked unit)))

    (some trigger funcions with TempGroup)

    Set VariableSet TempGroup = (Units in (Region centered at (Position of (Attacking unit)) with size (700.00, 700.00)) owned by (Owner of (Attacking unit)))

    (more trigger funcions with the other TempGroup)

    @Dr Super Good