My Game loads on the GS Viewer (IOS) but then it Crashes once it's about to actually Show

f78692@hotmail.comf78692@hotmail.com Member Posts: 5
edited May 2017 in Tech Support

I have tested my game multiple times previously and it has always worked, but I haven't tested it in around a month, I have pretty much finished it that time but now I can't test it. I click on my iPhone and the game begins to load on my phone, once the bar has loaded fully it pauses for a few seconds and then the app just crashes. When I go back on the app and click on Recent games the game shows up on the list but once I click it the app just crashes again.

I tried to load one of my unfinished games and that seems to load fine, any help would be greatly appreciated. (Just noting that I tried it on an iPhone 5S, iPhone 6 and an iPhone 6S)

Thanks in Advance,
Fahim Jahangir

Comments

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949

    This is one of those time-consuming things where you have to turn off rules until you determine the problem. My first step would be to add a new blank scene with a touch is pressed actor that takes me to the original first scene that was crashing. If you then preview it and it doesn't crash, it tells you there is a rule in the first scene causing the crash. Things like tableCellValue (or other table functions) and Timers and Loops are good places to start... again, turn them off one-by-one until you figure out what's causing the crash.

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • f78692@hotmail.comf78692@hotmail.com Member Posts: 5

    Thanks for the quick reply, I appreicate it, guess it's going to be a long night neutral:

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949

    It might be. Log Debugging Statements are great for this when testing on a computer. On an actual mobile device, it's trickier because you can't view those. What I sometimes do is set up a system where you use a Display Text behavior with an attribute in the expression editor and then change the value of the attribute as you go through the rules. So you'd be concatenating a value onto the end of the attribute every so often:

    [rules or behaviors]
    Change Attribute game.text to game.text.."1"
    [rules or behaviors]
    Change Attribute game.text to game.text.."2"
    [rules or behaviors]
    Change Attribute game.text to game.text.."3"
    etc.

    That way, depending on what kind of delays you have in your app, you can watch the value of game.text to see at what point it crashes (e.g. 1 or 12 or 123). If that proves too quick to see, you can also save the value to an attribute or table and load that value (again in a Display Text behavior) on your initial scene that doesn't crash. Then you'll know where it left off right before it crashed.

    I've probably confused you so feel free to ask questions! :D

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • The_Gamesalad_GuruThe_Gamesalad_Guru Member Posts: 9,922

    Check for functions related to tables that start off trying access row or column zero. This happens when you use an attribute to define a row or column. The attribute generally starts at zero. This will cause a crash since there is no row or column zero.

  • f78692@hotmail.comf78692@hotmail.com Member Posts: 5

    I'm surprised that I actually understood what you meant haha, when I first glanced at it I thought oh no, but I see what you are saying, it's just I got it working yesterday but only once, I then began finishing my game and the next time I tried it it just crashed again and again, I tried loading it from a blank menu but the game still crashes instantly that's why I don't think I would be able to try that method because the game doesn't show at at 95% of the time. Could it be something to do with the size of the game possibly, It's game with 81 levels in total they are fairly simple levels but there is a lot of code in each level.

    As for the Functions related to tables i'm 90% sure I don't have any functions relating to tables it's all pretty basic, I just use the variables to store everything then I load them up on the menu.

  • fmakawafmakawa Member Posts: 565

    It's crashing on a blank scene without any code? Perhaps its a memory issue with GS and your computer? Test it on a higher spec computer perhaps? Or have the GS people take a look

    As for the Functions related to tables i'm 90% sure I don't have any functions relating to tables it's all pretty basic, I just use the variables to store everything then I load them up on the menu.

    There might be something in this. How are you loading and saving your attributes? When I was still new I once built a whole game only to realize at the end I had been saving and loading value the wrong way the whole time!

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949

    @f78692@hotmail.com said:
    I tried loading it from a blank menu but the game still crashes instantly

    What do you mean? Did you create a completely new project file with nothing in it and test that? Or did you create a single blank scene in your current project and test that? What happens when you try both of those things?

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • jasonnowakjasonnowak Member Posts: 67

    I've actually had this issue on brand new projects and complex ones. Is the game portrait per chance? I've had many issues working with Viewer in that orientation.

    It sometimes helps to have the device in landscape while it loads and then rotate it when loaded. A weird trick that's helped me a lot!

  • f78692@hotmail.comf78692@hotmail.com Member Posts: 5

    fmakawa - Yes i created a new scene and made a button where it would take me to the intial menu when the button is clicked but I have the same problem, it crashes immediately, it doesn't even load the new scene I created, I tried to load multiple different scene's but it has the same result.

    tatiang - i mean i created a new scene in the same project and tried to load that scene first instead of my menu scene but the game crashes immediately. the scene's don't even show for a second. Other projects I have created load fine, I have an older version of the game that load's fine most of the time, but the latest version just continuously crashes immediately so i'm unable to test it at all currently (apart from on the GameSalad Program of course)

    jasonnowak - Yes the game is portrait, but an older version of my game is also portrait and it works pretty well, i'l give the landscape mode tip a try though, il try anything at this time.

  • f78692@hotmail.comf78692@hotmail.com Member Posts: 5

    jasonnowak - it worked the first time I tried to load it in landscape, seriously thank you so much, it's such a relief, and to everyone else who posted to help thank you so much for the suggestions and taking time to read my post. Now I can get some real feedback finally for my game.
    Thanks once again everyone! :)

Sign In or Register to comment.