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.
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 in the top left of the editor.
Expand Game settings and select Resources :
Right click on the right hand panel, and select “Remove Resources with Invalid Path” :
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 :
You’ll get a URL that you can browse to on your tablet. If you open the console (this button on the top right) in your debugging tab, you might catch some error messages.
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 :
- Check the storage read and writes are for numbers (you’ll have to double click the actions to confirm)
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?.
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
Select Toggle Developer Tools
This is windows though, but I’m sure there’ll be something similar in your menus.
Thank you very much!!
Hi again. My game keeps on crashing but no errors concerning sprites, etc are registered in the console.
Would you please tell me a possible cause for this.
Thank you in advance.
Have you tried debugging the game in using the network preview to play in on the console, and viewing the debug console in the editor?
Yes. And no errors there.
I finally managed to test the game with the network debugging and it crashes more or less like at the same time that the game installed does.
Memory leak perhaps?.
Resolution / screen size?.
Could you send here the full project?
Or to the GDevelop team if you prefer to keep the project private.
My Private Message on this forum are open!
(Please add a short description of the problem with the message because I’ve a lot of messages without context it’s hard to follow.)
I’m sorry again. These errors were registered in the console using the network preview.
Thank you very much.
I’ve been working on my game errors and now the console shows this:
Thank you very much for your help!.
Those errors indicate you have formatting errors in your events or expressions. It appears one or more of your events is using something named “Achievements”, which is a string field or variable, and you are inputting something without wrapping it in quotes. This will not work and/or will crash longterm.
Likewise, you’re passing an invalid expression or text to a variable or field somewhere, although it sounds like you need to enter numbers. Unfortunately, it seems like you have an invalid name for whatever this is, as it is just listing “” in your errors.