Memory Release

SlickZeroSlickZero Houston, TexasMember, Sous Chef Posts: 2,870
edited November -1 in Working with GS (Mac)
So spawning and destroying actors locks up the memory on the device. Is there any other functions that lock up memory as well, or is it just the spawn/destroy?

And does anybody know if the memory gets released when you change scenes, or if you reset the scene, or is it locked up until you stop the game?

Comments

  • quantumsheepquantumsheep Member Posts: 8,188
    Constraints and timers also will affect memory. And as far as I can tell, some memory is released when you change scene.

    Cheers,

    QS :D

    Dr. Sam Beckett never returned home...
    Twitter: https://twitter.com/Quantum_Sheep
    Web: https://quantumsheep.itch.io

  • SlickZeroSlickZero Houston, TexasMember, Sous Chef Posts: 2,870
    Ahh okay, cool. Thank you, kindly QS.
  • xyloFUNxyloFUN Member Posts: 1,593
    I am having memory problems too (both, mentally and hardware ;-)

    A little while ago I've made an instrument which offers two sound choices. This is done via a scene change and I am not happy with how it performs.
    My samples are small and I reuse quite a few by altering the pitch so that I don't need 14 individual ogg files in memory.

    The problem is that when I change the sound, I have to briefly touch each button once to get rid of the noticeable lag which occurs the first time I touch each and every key.
    The lag is around 500 milliseconds and happens on the whole keyboard.

    If there was a way to do this with GS, I'd save a lot of time because right now, the only solution I see is to script it as I still want to add more features down the road.

    Is there a way to force a scene change AND empty the memory at the same time?
    Even if it takes a tad longer to load, I'd prefer to wait a few more seconds instead of messin' with the keys.
  • SparkyidrSparkyidr Member Posts: 2,033
    To stop the initial lag :

    Have an actor in the scene that plays ALL your sounds in one hit as soon as the scene starts....but at 0 volume.

    That way, they will already have been played that first time, and the lag "should" not be there.

    I've used this technique a few times, and it's worked for me.
  • SlickZeroSlickZero Houston, TexasMember, Sous Chef Posts: 2,870
    I also noticed in my sound effects when I lowered the pitch with Gamesalad, it had lag in the beginning of the sound every time it played. So I put the pitch back to normal and it went away. Don't know if my issue is the same issue you are having, though. Otherwise, Sparky's method looks good, I wish I thought of trying that on mine now.
  • HoneyTribeStudiosHoneyTribeStudios Member Posts: 1,792
    Yeah, I put play the sounds silently once at the start too. You just have to be careful not to overload older devices or your game might not load up (Took me a while to figure out why I was having that problem when i first installed GS viewer!)
  • SlickZeroSlickZero Houston, TexasMember, Sous Chef Posts: 2,870
    I wonder if changing it from sound effect to music has any affect on the lag, or vice versa?
  • Rob2Rob2 Member Posts: 2,402
    SlickZero said:
    I also noticed in my sound effects when I lowered the pitch with Gamesalad, it had lag in the beginning of the sound every time it played. So I put the pitch back to normal and it went away. Don't know if my issue is the same issue you are having, though. Otherwise, Sparky's method looks good, I wish I thought of trying that on mine now.

    The lag when you change pitch is down to the method of pitch change which is basically just to slow the whole file down so the frequency drops. Any gap at the beginning of your sound will be lengthened so trim as close as you can.

    Pitch change will always result in timing changes as well unless time compression/expansion is also incorporated. I expect the pitch shifting being used by GS is pretty basic, better methods require a lot more grunt/cpu.
  • SlickZeroSlickZero Houston, TexasMember, Sous Chef Posts: 2,870
    Yes, you are absolutely right. It's the silence at the beginning of the file that got stretched out that creates the lag on my project. Made it in Garageband as a loop, so I couldn't chop off the beginning because it would throw off the loops timing, so i had no choice but to keep it at the original pitch, and go back to Adobe Audition to alter it there without losing the original integrity.
  • xyloFUNxyloFUN Member Posts: 1,593
    SlickZero said:
    Yes, you are absolutely right. It's the silence at the beginning of the file that got stretched out that creates the lag on my project. Made it in Garageband as a loop, so I couldn't chop off the beginning because it would throw off the loops timing, so i had no choice but to keep it at the original pitch, and go back to Adobe Audition to alter it there without losing the original integrity.

    The easiest way to get rid of the silence which garageband inserts at the beginning (as well as the excess silence at the end) is to use Audacity.

    Also, shifting the pitch up and down a few semi tones does not produce a noticeable effect because it is only a few milliseconds that get added if you shift down and the other way, it would have the reverse effect (shortening the silence should there be any in the first place).
Sign In or Register to comment.