Memory Leak Check for 3ICE

The perfect one step solution for creating Ice/Sliding Mazes in both Reign of Chaos and The Frozen Throne. It is the only decent system around and it even works in RoC, is lagfree, perfectly optimized, fast and reliable. The included TerrainKill feature frees you from the tedious task of creating a thousand kill-regions.
User avatar
manstie
Posts: 310
Joined: Wed Jun 17, 2009 9:27 am
Account: manstie
Location: Perth, Australia
Contact:

Memory Leak Check for 3ICE

Unread post by manstie »

Basically, it's your sliding system, changed to Speed[GetConvertedPlayerId(GetOwningPlayer(u))] for the player unit.
Then all the events are added by trigger in the initialization...
Then...

Code: Select all

Booster
    Events
    Conditions
        (GetUnitFlyHeight(GetTriggerUnit())<1)
        ((Triggering unit) is in H) Equal to (==) True
    Actions
        Set Speed[(Player number of (Owner of (Triggering unit)))] = (Speed[(Player number of (Owner of (Triggering unit)))] + 0.50)
        Wait 0.10 seconds
        Set Speed[(Player number of (Owner of (Triggering unit)))] = (Speed[(Player number of (Owner of (Triggering unit)))] + 0.50)
        Wait 0.10 seconds
        Set Speed[(Player number of (Owner of (Triggering unit)))] = (Speed[(Player number of (Owner of (Triggering unit)))] + 0.50)
        Wait 0.10 seconds
        Set Speed[(Player number of (Owner of (Triggering unit)))] = (Speed[(Player number of (Owner of (Triggering unit)))] + 0.50)
        Wait 1.00 seconds
        Set Speed[(Player number of (Owner of (Triggering unit)))] = (Speed[(Player number of (Owner of (Triggering unit)))] - 0.25)
        Wait 0.05 seconds
        Set Speed[(Player number of (Owner of (Triggering unit)))] = (Speed[(Player number of (Owner of (Triggering unit)))] - 0.25)
        Wait 0.05 seconds
        Set Speed[(Player number of (Owner of (Triggering unit)))] = (Speed[(Player number of (Owner of (Triggering unit)))] - 0.25)
        Wait 0.05 seconds
        Set Speed[(Player number of (Owner of (Triggering unit)))] = (Speed[(Player number of (Owner of (Triggering unit)))] - 0.25)
        Wait 0.05 seconds
        Set Speed[(Player number of (Owner of (Triggering unit)))] = (Speed[(Player number of (Owner of (Triggering unit)))] - 0.25)
        Wait 0.05 seconds
        Set Speed[(Player number of (Owner of (Triggering unit)))] = (Speed[(Player number of (Owner of (Triggering unit)))] - 0.25)
        Wait 0.05 seconds
        Set Speed[(Player number of (Owner of (Triggering unit)))] = (Speed[(Player number of (Owner of (Triggering unit)))] - 0.25)
        Wait 0.05 seconds
        Set Speed[(Player number of (Owner of (Triggering unit)))] = (Speed[(Player number of (Owner of (Triggering unit)))] - 0.25)
Image

samtre
Posts: 82
Joined: Thu Nov 27, 2008 6:43 am

Re: Memory Leak Check for 3ICE

Unread post by samtre »

would'nt it be better if you use For Each Integer A/B?

Code: Select all

    Booster
        Events
        Conditions
            (GetUnitFlyHeight(GetTriggerUnit())<1)
            ((Triggering unit) is in H) Equal to (==) True
        Actions
            For Each Integer A 1 to 3, do Actions
                   Set Speed[(Player number of (Owner of (Triggering unit)))] = (Speed[(Player number of (Owner of (Triggering unit)))] + 0.50)
                   Wait 0.10 seconds
            Set Speed[(Player number of (Owner of (Triggering unit)))] = (Speed[(Player number of (Owner of (Triggering unit)))] + 0.50)
            Wait 1.00 seconds
            For Each Integer A 1 to 7, do Actions
                   Set Speed[(Player number of (Owner of (Triggering unit)))] = (Speed[(Player number of (Owner of (Triggering unit)))] - 0.25)
                   Wait 0.05 seconds
            Set Speed[(Player number of (Owner of (Triggering unit)))] = (Speed[(Player number of (Owner of (Triggering unit)))] - 0.25)
it makes it look neater anyway.... and i think it gives you less time to load this trigger.......

User avatar
3ICE
Admin
Posts: 2629
Joined: Sat Mar 01, 2008 11:34 pm
Realm: Europe
Account: 3ICE
Clan: 3ICE
Location: Hungary
Contact:

Re: Memory Leak Check for 3ICE

Unread post by 3ICE »

Beautiful. No leaks. Elegant solution. You rewrote my system to use arrays :)

This was my original plan actually. (Except I will also make the sliding units an array to avoid the calls to GetPlayerId(GetOwningPlayer(u)), and be able to use udg_H with udg_Speed - much faster.)

One small note:
Speed[GetConvertedPlayerId(GetOwningPlayer(u))]
should be
udg_Speed[GetPlayerId(GetOwningPlayer(u))+1]
to get rid of that ugly BJ function. (GetConvertedPlayerId = Player number of = BJ function)

And samtre's solution is off by one:

For Each Integer A 1 to 3, do Actions
should be
For Each Integer A 1 to 4, do Actions

and

For Each Integer A 1 to 7, do Actions
should be
For Each Integer A 1 to 8, do Actions


--3ICE

EDIT: Never mind the last part. I found the reason: The waits are different: 0.10 vs 1.00
Last edited by 3ICE on Sat Sep 05, 2009 8:50 am, edited 4 times in total.
Reason: nvm last part
ImageImageImageImageImage
Image
ImageImage

samtre
Posts: 82
Joined: Thu Nov 27, 2008 6:43 am

Re: Memory Leak Check for 3ICE

Unread post by samtre »

i knew this was coming........................

If you see his trigger it is 3 and 7 waits, the last one in his triggers have no waits, so i'll just skip them.

User avatar
3ICE
Admin
Posts: 2629
Joined: Sat Mar 01, 2008 11:34 pm
Realm: Europe
Account: 3ICE
Clan: 3ICE
Location: Hungary
Contact:

Re: Memory Leak Check for 3ICE

Unread post by 3ICE »

Just a quick note: I found my mistake before you corrected me. :P
ImageImageImageImageImage
Image
ImageImage

User avatar
manstie
Posts: 310
Joined: Wed Jun 17, 2009 9:27 am
Account: manstie
Location: Perth, Australia
Contact:

Re: Memory Leak Check for 3ICE

Unread post by manstie »

Oh my god! Gah! I'm shocked to stone! Is 3ICE actually happy with what I've done?!

Okay, I'll change it to GetPlayerId(GetOwningPlayer(u))+1

I didn't use integer [ strikeout ]>>>loop<<< [ /strikeout ]A/B because it kinda bugged up when I tried before.

Hah, just noticed that in JNGP, it shows BJ functions in red. :lol:
Last edited by manstie on Mon Sep 07, 2009 10:23 am, edited 5 times in total.
Image

User avatar
3ICE
Admin
Posts: 2629
Joined: Sat Mar 01, 2008 11:34 pm
Realm: Europe
Account: 3ICE
Clan: 3ICE
Location: Hungary
Contact:

Re: Memory Leak Check for 3ICE

Unread post by 3ICE »

Looping is actually slower than your solution.

But looping makes the map size smaller by a few bytes.

EDIT: It is NOT called "Integer A/B"! It is called "loop".
ImageImageImageImageImage
Image
ImageImage

User avatar
manstie
Posts: 310
Joined: Wed Jun 17, 2009 9:27 am
Account: manstie
Location: Perth, Australia
Contact:

Re: Memory Leak Check for 3ICE

Unread post by manstie »

Jesus! That puts the first line of my other post out of the way...

Are you happy at the fact that I redirected someone to your website from The Hive Workshop who was looking for a sliding system? [here] :roll:

EDIT: I used the GUI version of the player number because I get my JASS based off converted ones... (That's if I can't find the function name in JNGP search thingy).
Image

User avatar
3ICE
Admin
Posts: 2629
Joined: Sat Mar 01, 2008 11:34 pm
Realm: Europe
Account: 3ICE
Clan: 3ICE
Location: Hungary
Contact:

Re: Memory Leak Check for 3ICE

Unread post by 3ICE »

Yeah, but you should still be proud of yourself.
manstie wrote:Are you happy at the fact that I redirected someone to your website from The Hive Workshop who was looking for a sliding system? [here] :roll:
He says it doesn't help. I did not post because I don't want to get involved. EDIT: Oh my god I just noticed my blog links are all totally broken! Nobody should ever have access to the postID and yet the default link to my sliding system is was "/?p=253" instead of "/3ice-sliding-system-for-roc-v3/". Fixing... EDIT2: Looks like the settings were reset. But surely not by me... EDIT3: Fixed.
manstie wrote:EDIT: I used the GUI version of the player number because I get my JASS based off converted ones... (That's if I can't find the function name in JNGP search thingy).
Okay. But manually adding +1 to GetPlayerId() is faster than calling a function to do it for you. Check the source of GetConvertedPlayerId() in Jasscraft or JNGP and you'll see. (Hopefully :P)
ImageImageImageImageImage
Image
ImageImage

User avatar
manstie
Posts: 310
Joined: Wed Jun 17, 2009 9:27 am
Account: manstie
Location: Perth, Australia
Contact:

Re: Memory Leak Check for 3ICE

Unread post by manstie »

Lol. What a noob. I bet he cried because he didn't get a direct link to download it.

What's the postID? :roll:
Last edited by manstie on Tue Sep 08, 2009 8:57 am, edited 2 times in total.
Image

Post Reply

Who is online

Users browsing this forum: No registered users and 69 guests