Engine performance on older mobile devices based on total number of material tags

Hi, I am doing my triangle logic puzzle game in Defold which I think for application of my size is very good choice. (And I am very thankful for your work). I know that Defold allow for maximum 32 different material predicates that can be used in render pipeline. But I wonder if 32 tags isn’t to much for mobile devices, especially older ones. I can’t find in documentation general rule if adding more tags require more operation and what is optimal number tags I can have if I want to run my game on older mobile devices. Is it 10-12 or maybe a bit more or less or I can have 32 tags without performance issues. Thank you

2 Likes

The 32 comes from us using a bit mask in a 32bit integer. It doesn’t mean that you’ll automatically use 32 different materials at the same time.

You are still in control of what you render at any given momemt, and should be able to control what you present on those lower end devices.

When in doubt, profile!

For instance, what is your current performance bottleneck on the lower end device, and is it a problem or is it ok?

2 Likes

Does it mean that for example if I have 3 different visual themes in my game and always only one is used in render pipeline I could safely have 32 tags if every theme use no more than for example 14 (this would make it easier to make predicates for specific purpose than having one predicate used in different context)? I have one theme which resembles pencil drawing style and my triangle figures look like they were hand draw and calculating this effect in fp is most problematic. Of course I don’t calculate it for entire screen but only for every triangle on board and I get around 33 fps when having more triangles on my device Redmi 9 which I consider not so powerful (on my second device Samsung galaxy I still easily get 60 fps). I was wondering if having less predicates can helps with performance. Also having lower precision in fp gives only slightly better performance. Pencil hatching effect was already optimized by its original author (I got it from unity asset store).

I’d have to double check the code to remind myself a little bit.
I don’t remember the details good enough.

I was wondering if having less predicates can helps with performance

It sounds like you’re having performance problems so I suggest you look into profiling.
In general, different predicates will trigger a different draw calls, however even a low end device should be able to handle 32 draw calls imho, so perhaps it’s something different that takes time for you?
E:g. a script?