RAM memory constraints..

kinzuakinzua Member Posts: 554
edited March 2012 in Working with GS (Mac)
Hey there folks..

I've been working on a project for quite a while now.
When i preview the game on my phone.. the memory usage starts off from 60mb and goes upto 150.
Is that good or how..
Please suggest.

Comments

  • POMPOM Member Posts: 2,599
    edited March 2012
    150 RAM usage is quite a lot , 3gs might crash at the 120mb point ..
    As for iPhone 4 and 4s , i don't think the app will crash .

    But still 150mb seems a bit too much , is it mostly from images ?

    Photobucket Roy
  • kinzuakinzua Member Posts: 554
    @P-O-M Ya bro.. I have about 200 actors in one scene.. which keep changing their attributes..

    To reduce the number of actors.. i spawn them when required and destroy them when done..
    To ask...

    * Could it be cos that m spawning 8-10 actors every action?
    * Could it be for the magnitude of actors in the scene?


  • CloudsClouds Member Posts: 1,599
    edited March 2012
    @kinzua

    Instead of spawning an actor and then destroying it once it have done it's thing . . .

    Keep the actors (that you would normally spawn) offscreen so they cannot be seen. When you need one, instead of spawning it simply change it's position from it's offscreen position to where it should be (with change attribute) - then when you want it 'destroyed' simply move it back to it's offscreen holding position.

  • kinzuakinzua Member Posts: 554
    Ok.. Here's whats happening..

    I have put a set of 40 actors in my scene.. I am changing their image (from null to required) only when they are supposed to be visible..
    This action.. when i test it on my phone.. results in total memory size of 60 mb.. M not spawning anything now..
    The total size of my project is 2mb..

    Now i added 5 images worth 40kb.. and added them to animate the actor.. when it is rendered..
    The total memory size .. while testing on the 4s.. jumped to 62.5mb..
    I am now required to animate all of those actors... Which by calculation will pump up the size to more than a 100mb..

    Needless to suggest .. that i am still working on the framework.. and the game will crash.. be it on any device.
    Can anyone help me out here? Plz.

    Thanks @Tynan .. i've found a way out and m starting from scratch with a different approach..
  • kinzuakinzua Member Posts: 554
    Plus when my images in totality are 2 mb.. how come while running them.. they go upto.. 44mb.. Without any jazz that is...
    Can some1 help me on this? Am not a coding pro.. Are these sort of programming basics.. or are they a part of GS basics?
  • MotherHooseMotherHoose Member Posts: 2,456
    @kinzua … don't try to calculate the RAM … try the animations and see what actual resources they use.

    I like to use changeAttribute: self.image instead of animate in some scenarios …

    your work sounds so dynamic and exciting with the visual effects you are striving for!

    @};- MH
    "Games lubricate the body and the mind." — Benjamin Franklin
  • calvin9403calvin9403 Member Posts: 3,186
    do you have a lot of constrains in the project? try to reduce them as well
  • LeonardDeveloperLeonardDeveloper Member Posts: 4,630
    @kinzua
    Try unchecking the "movable" box on actors that don't need to move..
  • kinzuakinzua Member Posts: 554
    Hey thanks guys... m considering all your advices.. and seemingly it works..

    Though m still away from what i desire..i'll keep goin on..

    Thanks @LeonardDeveloper @MotherHoose @calvin9403
  • calvin9403calvin9403 Member Posts: 3,186
    also try to use behavior interpolate as much as you can in the project
  • tenrdrmertenrdrmer Member, Sous Chef, Senior Sous-Chef Posts: 9,934
    @kinzua Ram usage is determined by image dimensions and not the file size. Make sure your images are as small as they can be without sacrificing quality. if your actor is 40x40 scale the image down to 80x80. don't make it any larger than in needs to be. so you can avoid being in a higher RAM container than needed. The RAM containers are 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024

    If you can squeeze even one side of the dimensions into a smaller container it will lower the ram used.
  • kinzuakinzua Member Posts: 554
    @calvin9403 really? I was under the impression that it slows down performance.. so i restrained from it.. Thanks for the advice.. My project lacks smoothness.. i guess u just chiseled it.. :)>-

    @tenrdrmer considering that.... my light bulb just lit up.. just that i'll require a tidy bit more of effort to save RAM..still <:-P
  • LeonardDeveloperLeonardDeveloper Member Posts: 4,630
    Ram is a bit fat at the moment with our games but as soon as native code comes out it will act as a slimming tablet and laxative :D
Sign In or Register to comment.