HTML5 game crash on ios


#1

my game work very good in desktop, android browser but crash in loading page on ios.

I am using ogg sounds and remove comented code with --[[ or ]]–, maybe big atlas?


#2

Yes, it could be a big atlas. But it’s really hard to say. How many atlases do you have? What are their sizes?

If you want your game to run on Android and iOS I would recommend that you build native applications. A standard Defold HTML5 build will most likely not have great performance on a phone browser, unless you’ve optimized your game for mobile browsers from the start.


#3

my maximum size for atlas is 2048x2048, I have 12 atlases but are 512x512 as maximum.


#4

What if you start stripping away content and continuously build and run on Safari on mobile? Will you at some point when you’ve reduced atlas size enough get it to run? It’s a tricky problem to do this kind of debugging on device in a mobile browser. Is there some tool that can output the browser console on your local machine somehow?


#5

You could try running the game on a desktop Chrome browser, where it’s possible to track memory usage per tab through the “Task Manager”.

Check the amount of memory the game tab has allocated, maybe it’s a bit too much for iOS Safari browser to handle?


#6

You could also try connecting your device to your computer, and use the remote Safari debugger, more info here: https://blog.idrsolutions.com/2015/02/remote-debugging-ios-safari-on-os-x-windows-and-linux/

This will enable you to view the console output on the device directly on your computer.


#7

In task I see 360.000K and sometimes 348.000K, I will try with safari debugger


#8

I see this in console:

remote console.loglink
"“
remote console.loglink
”“
remote console.loglink
”“
remote console.loglink
”“
remote console.loglink
”“
remote console.loglink
”"
remote console.loglink
"Running…"
remote console.loglink
"Running…"
remote console.loglink
"Running…"
remote console.loglink
"Running…"
remote console.loglink
"Running…“
remote console.loglink
"Running…”

and the game crash in loading screen, defold logo maybe 51% crash, reset page and again

I edit my atlas 2048 to 1024x1024 and i have the same problem


#9

So you don’t get any errors in the console, does the Safari browser display any information? I have previously seen a small message at the top like; “A problem occurred with this web page so it was reloaded”, is this something you have seen?

I would guess that it could be related to memory usage in that case.

By “edit my atlas” do you mean that you have changed the texture profiles to have a maximum size for iOS, or did you just remove images from the atlas so it resulted in a smaller atlas?

I suggest that you try to create (if you haven’t already) and tweak your texture profiles by setting the maximum texture size in steps and see if you can hit a sweet spot where it works.


#10

yes.

I resize my background image to 1024x1024 atlas[quote=“sven, post:9, topic:9188”]
I suggest that you try to create (if you haven’t already) and tweak your texture profiles by setting the maximum texture size in steps and see if you can hit a sweet spot where it works.
[/quote]

how can make create a profile? this?


#11

Yes! :slight_smile:

You should be able to set a maximum texture size for each profile, so by decreasing it in steps and running to see if it makes any difference.


#12

I have some question, for example I have an atlass in main/UI/, I need put main/ui in path? or with ** i put all the atlas?

this is my profile


#13

More information on how to configure the paths can be found in the Texture Profiles Manual:

**
Matches a complete directory tree, or—when used as the name of a directory—zero or more directories. For instance: /gui/** matches all files in the directory /gui and all its subdirectories.

From the information above I’m guessing that /** would match everything from the root folder and below.
Edit: ** is apparently enough to match everything from the root folder and down. Thanks @Mattias_Hedberg for the correction.


#14

great, I try with Max texture size in 512 but I see some ui object very smalls, I try with 128 and the game in ios is freeze in Starting (preloader page)


#15

“**” matches the whole project no need for the “/”. The default texture_profile uses only “**”


#16

all is fine with profiles, but now the game is “Starting” forever, but not crash, weird!


#17

And does any of the previous tips that Sven provided help?


#18

I have this messge in console:

remote console.loglink
"Assertion failed: Cannot call unknown function JSWriteDump (perhaps LLVM optimizations or closure removed it?)"
https://qkygames.github.io/tuti/One%20Man%20Invasion.js:1link
Error: Out of memory

I try with 512 and 256 in profile, and have the same problem, I remove the background and I continue with problems, maybe sounds? I have 3mb of ogg sound, and put all the sounds in a gameobject


#19

I compile the aspect_ratio example and I have the same problem, game crash or starting forever in my ipod touch 5, I host the game in github, I am using editor 2.0, I try with an empty project (defold logo) and have the same problem


#20

I can not make run a HTML5 game in my ipod, no news?