Game crahes after a while playing with it

Hello.
I’m developing a landscape spaceship game and when I test it in my laptop it works fine but when I test it in a Huawei P30 Lite and in a Samsung Galaxy Tab it crashes.
In the Properties of the game:
-The resolution is 1200x600.
-No changes to game size.
-Scale mode linear.
No black bars in mobile.
I used anchor behavior for my GUI and for the elements of other layers.
The game only crashes when you are playing and make the devices unresponsive during some seconds.
One of the options of the main menu is a characters guide and you can navigate through it with two buttons without the guide crashing.
Is there anything wrong with my game properties?.
What can I do to solve this problem?.
What can I do to make my game suitable for all devices?.
Thank you in advance for your help.
Greetings,
Eva

Although it may appear to run fine on your laptop, there could be underlying issues that aren’t surfaced. For starters, could you run it again on your laptop, but after a few seconds of it starting press crtl + shift + i, and then click on the console tab. Are there any red lines or error messages?

Excuse me. I pressed ctrl+shift+i but nothing happens.
My laptop is a Mac.

Ah, in that case use Option + ⌘ + C. You may need to turn on developer tools first though.

Excuse me again. I am a completely newbie to Gdevelop. I have opened my project in Gdevelop and I’m pressing the keys as you said me in one of my scenes events tab but I’m afraid that I’m not doing something well because nothing happens again. When I test my game I do it from my project with the preview not from a browser. I don’t know any other way to test my game because I don’t know very much about Gdevelop yet.

Ok, I’m not familiar with the Mac version of GDevelop.

The best I can do then is help you check your resources are valid while in the GDevelop editor. This may not solve your problem, but it will ensure bad resource file path isn’t the issue :


Click this icon image in the top left of the editor.

Expand Game settings and select Resources :

image


Right click on the right hand panel, and select “Remove Resources with Invalid Path” :

image

Now try the game on the mobile devices again and see if that makes a diffrence.


The other thing you could try is run it in debugger over Wifi/LAN :

image


You’ll get a URL that you can browse to on your tablet. If you open the console (this button image on the top right) in your debugging tab, you might catch some error messages.

2 Likes

Thank you very much for your answer. I tested again in both devices after doing what you said and now it takes more time to crash but still crashes. This is what the debugger says about errors.


EDIT: When it crashes it leaves all the variables with value 0. Only the direction keys work.
The pause button and the shoot button don’t work.

If you run the game in debug mode on your laptop, does the same error message appear at some stage?

Are you using json anywhere? To load/save data?

This screenshot was made from the laptop because the debugger didn’t load in the other two devices.
I don’t use JSON anywhere in my game but I save the high score with the storage conditions.
Maybe something is going wrong with the saving/loading process.
I save the high score in a game over screen and when you complete the game like this:



Just some comments which I doubt will make a difference :

  1. Check the storage read and writes are for numbers (you’ll have to double click the actions to confirm)
  2. Change LargeNumberToString(Variable(ScoreLocal)) to VariableString(ScoreLocal).

What do you do that causes the crash? Is it the same thing every time?

You mention you can navigate through a character guide with two buttons without it crashing. What do you mean by that? Does using other buttons cause it to crash?

My game starts with an intro screen and a splash screen that takes you to a main menu with play, score, characters guide and quit options.
When you start to play the first scene there is no crashing but when you start to play the second scene, some seconds later, the game crashes in mobile devices but not in the laptop.
In this second scene you pick a key to open the mine stances and when you get into the stance the variables (number of spaceships, score) become 0.
My GUI has four buttons on the left to guide the spaceship and other two on the right to shoot and pause.
When the game crashes in this stance for some unknown reason the direction keys keep on working well until the game stops and “restart” itself. The shoot button don´t work.

The characters guide only has two buttons to move forward and backwards. No crashing here.

Would the crashing be caused by pressing to buttons at the same time?.

Memory overload / code indentation maybe?.

EDIT
This is a snapshot of the console from Toggle Developer Tools.


I create Particle Systems for the smoke of the spaceship.
Thank you very much

I don’t think this has been said yet. To access the console errors MrMen was talking about while the game is running:

Start the preview
Go back to the editor
Click View
Select Toggle Developer Tools

This is windows though, but I’m sure there’ll be something similar in your menus.

image

2 Likes

Thank you very much!!