ericoporto / ImGi

AGS Script Module for Immediate Gui (based on rxi's Microui)
https://www.adventuregamestudio.co.uk/forums/index.php?topic=58842.0
Other
2 stars 2 forks source link

Enhancement: support rendering at half frame rate #11

Closed ericoporto closed 3 years ago

ericoporto commented 3 years ago

Need to evaluate if it matters. But in full HD games the drawing may be a bit heavy. If this is true, maybe skipping and only dealing with the ui in even frames would help a little bit and may be easy to implement.

I am not sure yet if most of the per frame cost is the drawing but I suspect it is... Maybe I need to figure a way to profile this thing.

ericoporto commented 3 years ago

For FullHD (1920x1080) I had to run at a third of the frame rate for it to work fine, when running at 60fps. I think I will auto adjust this at game start in the module so it works a little bit better for people picking it up.

I still need to eventually figure a proper solution for the performance of it.

Because ONLY rendering is skipped, everything else is processed normally, so the ui doesn't miss click or similar.

ericoporto commented 3 years ago

While there are benefits going for a third of the drawing rate, I can't find much benefits by lowering even further. There's a cost of blowing up and redrawing a DynamicSprite of 1920x1080 at least once per frame that makes my PC fans fly apparently.

I can see that the MB usage varies around 100MB, even though it's relatively high, it's really low compared to the amount of memory available on any device nowadays, so if there's a way to double the RAM usage and cut the processing in half, it would be a good bet. Maybe in the future I should consider some caching.

ericoporto commented 3 years ago

With no rendering at all, ImGi still costs 1% of processing with a medium complexity GUI, so there's probably some improvements on the non-rendering part two - even though the payoff may be lower.

ericoporto commented 3 years ago

Added some workaround on https://github.com/ericoporto/ImGi/commit/81a2255cd8a6271baa202140dbee84d0d9cf212b