I've reduced my project file massively and it's still crashing in GS Viewer!

Initially once I'd finished building my game it was 195MB. When I tried testing it through the GS Viewer app it wouldn't open and I noticed a warning on the bottom left of the Creator saying it needs to be below 150MB to play properly (without performance issues). I got it down to 120MB and it then said it needs to be down to 50MB.

I've been researching a lot on this forum and by the sounds of things a lot of people have submitted apps a lot bigger than this with no issue. The 50MB is apparently just so that mobile users can download it without wifi if its that size. I get that, no problem.

My issue with it not playing on GS Viewer though, has got me confused. Ok, so my game consists of probably 60% animations. I got my game to play just now for 2 seconds on my device (I had reduced the project size down to 77MB). Here are my stats:

Performance

FPS: 59.87

Memory Usage

Images: 125.2MB
Sounds: 11KB
Game Engine: 1.4MB
Other: 10.1MB

Total: 136.7MB

So the above are stats after I'd gone through the whole process of optimising my game. I've gone through all the forum articles about reducing things: using jpegs instead of pngs (and altering the xml yadda yadda), changing some pngs to either PNG-24 or PNG-8, deleting unwanted actors/images/sounds. I even did that list of '31 things optimise your game' that some people don't agree with it seems.

Can anyone give me a clue as to why my game's not right? I can't reduce anymore images down, as the remaining animations have a lot of alpha in them which I don't want reducing the quality from. In terms of the device I'm using (which may turn out to be a big factor here), is an old iPod Touch (4 Gen I think).

Please help!!! I am SO close to finishing!

Answers

  • TheGabfatherTheGabfather Member Posts: 633
    edited September 2013
    I've never had a game go above 50mb, and I haven't used Viewer in a looong time, so there might be something I do not know about but:

    Have you tried doing an Ad Hoc build? At the end of the day Viewer is still an emulator. However, since we're talking about crashing and not performance issues, it might not make much difference.

    Have you tried using Xcode Instruments to see your game's Memory consumption? You'll be able to see a live reading straight from your device and it should give you an idea of when the spikes happen that could be crashing your game (I'm just assuming it's a memory issue).

    Also not to diss your code, but perhaps there are a few faulty Rules in there. Does your game crash on startup? Or when you do a certain action? If you're able to pinpoint that, perhaps you can start taking out Rules one by one (you can just tick "Off" temporarily) until you see the possible culprit.

    Also your iPod Touch isn't that old, but then they are still weaker than the iPhones so it could be your possible culprit.
  • 1LuVP4nc4k3S1LuVP4nc4k3S Member Posts: 62
    Hi there, thanks for your quick response!

    You may be right about the faulty rules, although I'd need to dig around quite a while I think (I have a LOT). In terms of lag when I preview the game in Creator it takes maybe 5 seconds to start the whole game. I have noticed recently that when I press my 'Next Level' button (which resets the scene) that it freezes GameSalad in my Windows Creator. But once I try it in Creator on mac it works fine. So I'll check out the code around that.

    Thanks very much, and I'll report back and let you know.
  • 1LuVP4nc4k3S1LuVP4nc4k3S Member Posts: 62
    Ok, so I checked the code around where it freezes but its exactly the same to an older version where it didn't freeze. The biggest difference between the two versions is that I added music. Do you think may be having trouble resetting a scene using a music file?
  • 1LuVP4nc4k3S1LuVP4nc4k3S Member Posts: 62
    Actually the code was slightly different in another actor which I've now rectified but the thing still happens on my device.

    I connect my device to the mac, open gamesalad, open GS Viewer on my device, select device in the Creator (on mac) and then after the loading bar finishes on my iPod screen, the screen goes black and there's a small pinwheel spinning in the bottom right.

    This goes on for about 20 seconds, then the first 3 seconds of my game plays and then the app crashes out. So frustrating!

    Any thoughts? I'll keep on looking at my code, but now nothing stutters when I preview it on my computer, so why is it still screwing up on my device??
  • Fal01Fal01 Member Posts: 460
    @1LuVP4nc4k3S,

    Have you tried taking everything off your iPod? Photo's, music, all other apps etc.

    It might help.

    If that doesn't work you might have to remove your actors one by one until you find the culprit.

    It’s not a bug – it’s an undocumented feature

  • 1LuVP4nc4k3S1LuVP4nc4k3S Member Posts: 62
    @Fal01 thanks for the suggestion but I'm using a shared device so don't want to affect those parts.

    In regards to checking the actors, I think i will just have to try that.

    I did however think that maybe my XCode hadn't built GSViewer properly as it didn't have all ancillary components. But I did all that and deleted GSViewer and reinstalled and I still come up with the same problem.

    I'm wondering if maybe I can try testing my app another way, instead of through GS Viewer? If I were to do it through XCode, what would you need to do to get the gamesalad project in the correct format for XCode to read?

    Sorry for this type of question - I'm still getting to grips with XCode!
  • 1LuVP4nc4k3S1LuVP4nc4k3S Member Posts: 62
    I think you guys are right. I've now tested my app directly on my device (i.e. not using the GS Viewer) and it still quits at the same point.

    So it looks like i'm going to be checking every rule now - bummer......

    Thanks for your help though...
  • 1LuVP4nc4k3S1LuVP4nc4k3S Member Posts: 62
    Ok, so upon more investigation I've potentially isolated where the problem lies.

    I have 5 scenes:

    - Loading
    - Welcome
    - Instructions
    - Game
    - About

    I knew that the Loading always appeared fine before the app would crash, so that's not a problem. I checked the Instructions and About scenes by putting them at the beginning of the app because I knew that all they had was at least 1 background image and a couple of buttons. They were both fine and didn't make the app crash.

    Then I checked the Welcome and Game scenes, of which both have either PNG sequence animations or the bulk of the app's code (Game scene). Within the Welcome scene, by turning rules off and on, I found out that the PNG sequence was making it crash.

    @TheGabfather and @Fal01, I need your help please! I've already compressed all my PNG sequences in my app to PNG-24 or PNG-8 and made sure i'm not using rule timers and replacing them with 'if scene/game time = X' etc. What else can I do???

    Really don't know :(
  • SlickZeroSlickZero Houston, TexasMember, Sous Chef Posts: 2,870
    Are all the imported .png's 72ppi?

    You can also try to turn off the animation and see if it crashes still, or completely rebuild the animations again and see if that helps.

    And timers are not a bad thing. It's when you use too many timers that it becomes a bad thing. Maybe try using a timer instead of the other method, just to see if it is in fact that particular actor/event that is making the game crash.
  • 1LuVP4nc4k3S1LuVP4nc4k3S Member Posts: 62
    @SlickZero - thanks so much for answering.

    All my PNG sequences are imported at 72ppi. I've done some further testing and the only things causing my app to crash are indeed my PNG sequences. In my Welcome scene I have a 1 one PNG sequence (animation) that contains a simple timer that says after X seconds delete the actor. Then underneath it there's another PNG sequence that says after X seconds animate. If I turn off both these actors (or one by one to test each time - makes no difference) it makes the app crash.

    In my Game scene I have two actors that have animation on them. One of them is fine and doesn't make the app crash - ignore that one. The other however has a few rules that trigger different PNG sequences. In total that actor accesses 3 different PNG sequences.

    I've turned each of those rules on/off separately per test and they each crash the app. *As far as I'm aware* I don't think its my code logic and is works perfectly and as it should when I preview my game in the Creator. Its just when I play it through GS Viewer or even when I create an .app file and install on my device.

    Any ideas would be greatly appreciated! So far, the fact that all of you are responding is an enormous help - so thank you!
Sign In or Register to comment.