Android build on older device not rendering game objects (SOLVED)

Ah, that’s probably because I used the wrong print function on android :frowning: (each platform always does something slightly weird)

I’ll make new editor :slight_smile:

Alright, another editor which I hope will print out the erroneous values for us:

OSX

2 Likes

Thanks, now I see the loggings with logcat. Here are Defold logs from crash and from working device. Those full logs with all the device loggings were most likely useless anyway.

Crash
defold_logs3.txt (1.8 KB)

Working device
working_device_logs2.txt (3.7 KB)

1 Like

Alright, thank you so much for this info!

So, this is the input to the erring glDrawElements:

W/defold  (24492): WARNING:GRAPHICS: MAWE: DrawElements:
W/defold  (24492): WARNING:GRAPHICS: MAWE: prim_type: 4
W/defold  (24492): WARNING:GRAPHICS: MAWE: count: 36  00000024
W/defold  (24492): WARNING:GRAPHICS: MAWE: type: 5125
W/defold  (24492): WARNING:GRAPHICS: MAWE: first: 0  00000000
E/defold  (24492): ERROR:GRAPHICS: DrawElements(1311): gl error 1280: 'GL_INVALID_ENUM' from glDrawElements

The error it gives is GL_INVALID_ENUM, and looking at the input enums prim_type, a.k.a mode in the documentation, and type:

  • Prim type 4 corresponds to GL_TRIANGLES

  • And type 5125 (or 1405 in hexadecimal), is GL_UNSIGNED_INT.
    Although, in the gl.h I looked at in our current Android SDK, that enum isn’t defined(!)

The GL_UNSIGNED_INT means that there are indices higher than 65535, which is quite a lot.
By the looks of your game, I guess you’re not using 3d models, but only sprites?

Have you by any chance increased the game project setting sprite.max_count to something high?

2 Likes

Thank you very much! These are excellent news indeed!

When I decreased the sprite max count from 16384 (which seemed to be the maximum in editor when we added this value) to 4000 everything started working on Zenpad also. We maxed those values when the first default count of some resource was exceeded and they didn’t seem to cause any harm being so high :smiley:

We are not using any 3d models but only sprites in the game.

2 Likes

Good to hear you found a solution!

Yep, you guys rock!

I still suggest that this would somehow be fixes on the engine’s side as well to prevent weird problems with some devices since this setting was working before. When I got time I will test what happens for example with 16383 sprite max count if it is somehow error by one or something like that that causes the cast to GL_UNSIGNED_INT.

2 Likes

In cases like this we’re are the mercy of both the mobile vendor graphics driver and the Android SDK, when they change behavior.
I’ll try to think of a good way to deal with this, not sure how yet though.

2 Likes

I made some research just for fun and noticed that largest working maximum count of sprites is 8192. Luckily this is enough for most of the usages I think.

1 Like