User Tag List

Results 1 to 8 of 8

Thread: RAM intensive game, crashes on startup

  1. #1
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleUniversal Windows Platform Export ModuleSWF Export Module
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Universal Windows Platform Export Module (Steam)

    Join Date
    Aug 2010
    Location
    Sweden
    Posts
    351
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    RAM intensive game, crashes on startup

    I'm having problems with my latest game in that it crashes on when the main game frame loads. When I restart my iOS device it works, leading me to believe it is a RAM issue (I still get memory warnings.) Once the game does start it flows in 60fps, with only the occasional slowdown. It is a very graphic intensive game, with a 11000x3000 frame filled with large graphic objects, where all are active objects (I have to manipule the RGB channels realtime, so the backgrounds can't be background objects.)

    My question is really how do I avoid this issue with startup-crashes? I've tried to make sure the largest objects aren't created at start, but rather spawned later on, but it doesn't seem to do any difference. Does it make a difference to have the objects not created at start? or the load on call function?

    Is there other things you can do to keep the RAM down? I'm not doing image compression, it makes the graphics look like ****, and I'm using mp3's for the large soundfiles.

  2. #2
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleiOS Export ModuleMac Export ModuleUnicode Add-on
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    AyreGuitar's Avatar
    Join Date
    Jan 2011
    Location
    Wales, UK
    Posts
    1,113
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I doubt that not creating an object at the start saves any memory (I tried to do my Paper Face app a while ago using that kind of system and had to change it later to use Active Pictures that loaded external images due to it being a real memory hog, even though most of the objects were not on screen, just waiting in the wings to be created)
    Load on call has no effect on iOS exporter unfortunately

    Best I can suggest is:
    1. Your graphics use powers of 2 for width/height, e.g. 16, 32, 64, 128, 256, 512, etc even if you have to scale them up slightly to get the correct size (they'll fit in memory better without wasted space)
    2. Don't use alpha channels if you don't need them (eg importing a PNG file in picture editor when it has a simple alpha that a single transparent colour or no transparency could do instead)
    3. You don't have to compress ALL your graphics, just do it on the ones that still look OK when compressed

    There's a sticky thread here that has more tips and tricks: http://community.clickteam.com/threads/65324-Guide-to-faster-games-with-less-memory-usage

  3. #3
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleUniversal Windows Platform Export ModuleSWF Export Module
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Universal Windows Platform Export Module (Steam)

    Join Date
    Aug 2010
    Location
    Sweden
    Posts
    351
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I have read that thread. Is there any graphics that doesn't look bad with image compression? For reference, here's how the game looks: http://www.jm-j.com/meadowland

    How exactly does alpha-channels and the such work? Is that information that is embedded in the file being imported, or embedded in different file formats? Does it matter what the file format is when being imported into mmf?

  4. #4
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleiOS Export ModuleMac Export ModuleUnicode Add-on
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    AyreGuitar's Avatar
    Join Date
    Jan 2011
    Location
    Wales, UK
    Posts
    1,113
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Lots of graphics can look fine with compression - it depends if they need lots of colours that are close together and whether they need a smooth alpha channel (compression limits the alpha channel transparency to about 16 levels I think) - ideally they'd be created with compression in mind, eg using a 256 colour palette
    You can set the compression on or off per object using the object's properties to see which ones look good enough.

    A quick test would be to set them all to use Color reduction (from the app's properties - assuming all the objects use Default) and see if this solves your crash problem. If it doesn't then you've saved yourself lots of time reworking your graphics and the problem must be somewhere else.

    It's a little hard to see from your example website - some graphics seem quite smooth and detailed, others quite blocky - the blockier stuff could be stored at a smaller size and scaled up, which should save memory. Your grassy platforms may need an alpha channel to look good, but the 16 levels that color reduction allows should be enough.

    You can see if an imported image is using an alpha channel by going into the picture editor for the object and clicking the alpha symbol (looks a bit like a fish!) above the magnification slider. This then reveals 2 radio buttons:
    Transp. Color
    Alpha channel
    Whichever one is set is the type it's using (if it doesn't need a smooth, soft edge or any transparency at all, try changing it to Transp. Color)

    Which device are you testing on? You might find you have more memory to play with on an iPad 2 than an iPhone 4.

    Another option is to have a condition to detect the memory warning and jump to another frame that warns the user that memory is tight and suggests resetting the device before continuing (again, something I did in my recent Paper Face app after seeing something similar in another app)

  5. #5
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleUniversal Windows Platform Export ModuleSWF Export Module
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Universal Windows Platform Export Module (Steam)

    Join Date
    Aug 2010
    Location
    Sweden
    Posts
    351
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I did try to set the game to color reduction, just to see what looks good and what doesn't, and very, very few items does look god, and those that do, I have set compression to. But you might be right, reworking the graphics could be an idea. Funny thing though, I did try to rework some of the graphics into a more texture based style, so instead of using large png graphics with alpha, it was something like 256x256 blocks, without transparecy. The game dropped like 20 fps, and I had to put the large graphics back in. No idea as to why that happened, but my guess is that it's the changing of RGB that does it. It seems to work slower the more objects there are.

    Thanks for explaning how the alpha-channels work, will be looking at it.

    The problem is that the game crashes even before it gets a memory warning (both on a iPad 2 and an iPhone 4S, doubt it will work on an iPhone 4.) When I restart the device, I get a warning, but at least it started. I did plan on creating a screen at start that warns about this, in case I can't fix it properly.

    Would maube making alot of the graphics global, and having a screen before the game start containing that graphic, fix some of the problems? Kinda like a preloader, so it doesn't have to load everything in the game at once?

  6. #6
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleiOS Export ModuleMac Export ModuleUnicode Add-on
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    AyreGuitar's Avatar
    Join Date
    Jan 2011
    Location
    Wales, UK
    Posts
    1,113
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    But did changing to color reduction stop the crashing (despite it looking bad)? If it did, then it looks like changing your graphics might be the way to go. If it didn't then there's no point, the crash must be something else.

    Not sure if a preloaded would work (I think it clears the memory between frames anyway), but worth a try.

    Looking at the MMF2 help file for iOS color reduction will use:
    65536 colours for opaque images (no transparency)
    32768 colours for unique transparent colour
    4096 colours for alpha channel with multiple transparency levels

    Use this as a guide when reworking your graphics, ideally with an art package that can handle these different colour levels so you can see the results sooner.

  7. #7
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleUniversal Windows Platform Export ModuleSWF Export Module
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Universal Windows Platform Export Module (Steam)

    Join Date
    Aug 2010
    Location
    Sweden
    Posts
    351
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks, I'll take a look at it.

  8. #8
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleSWF Export Module
    happygreenfrog's Avatar
    Join Date
    May 2011
    Location
    I.L.T.D.O.I.R (I.L.T.D.O.I.R's Location: The Dimension Of Infinite Recursion)
    Posts
    4,304
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    One thing to do is to avoid using alpha channels as much as possible, especially on objects that don't have any transparent pixels (and also try to not use them on objects without semi-transparent pixels). Then Image compression won't make your graphics look nearly so bad.

Similar Threads

  1. Program crashes on startup.
    By velocitas in forum Multimedia Fusion 2 - Technical Support
    Replies: 15
    Last Post: 11th December 2013, 03:09 PM
  2. My game crashes for me, but not for my friend...?
    By Ethan in forum Multimedia Fusion 2 - Technical Support
    Replies: 11
    Last Post: 27th April 2011, 12:54 AM
  3. Can HWA speed up apps that are memory intensive?
    By LB in forum Hardware Accelerated Runtime
    Replies: 3
    Last Post: 31st January 2010, 08:16 PM
  4. HWA for intensive calculation on GPU
    By felinex in forum Hardware Accelerated Runtime
    Replies: 1
    Last Post: 13th January 2008, 03:48 PM
  5. Game crashes when it tries to go to 'Next Frame'
    By Mantoid in forum Multimedia Fusion 2 - Technical Support
    Replies: 6
    Last Post: 5th March 2007, 02:27 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •