https://kotlinlang.org logo
#compose
Title
# compose
s

smallshen

03/03/2022, 12:58 AM
What is the best way to handle states that update more than 100 times per second?
k

Kirill Grouchnikov

03/03/2022, 1:02 AM
What would you expect the UI to do? Overload the user with 100 changes every second? I think you would start with how to present those changes to the user, and then figure out how to make it happen in code.
s

smallshen

03/03/2022, 1:04 AM
It updates the x and y offsets
I am using compose in one of my game's mods, it updates around 120 (which is fps) times per second. It contains x pos, y pos, and hp. Updating value took really long time in a situation like this.
k

Kirill Grouchnikov

03/03/2022, 1:17 AM
How many objects / sprites / particles do you have in there?
s

smallshen

03/03/2022, 1:19 AM
Usually around 50-100, and some edge cases could be 300
k

Kirill Grouchnikov

03/03/2022, 1:56 AM
You're probably hitting the limits of what Compose is optimized for in terms of real time gaming engines
4 Views