Posted March 19, 2025 by gingerbeardman
#performance
When I built Shark Turtle in 2023 I was concerned about maintaining fast updates and animation, but was aware that most of the time the screen would be static. How to strike the right balance in performance?
My first solution was to come up with a dynamic frame rate system that gave me the best of both worlds:
This did work, but I abandoned it…for reasons I can’t remember.
Instead I manually keep track of the dirty status of the grid and score “HUD” areas of the screen, only redrawing each of them when they have actually changed. So, drawing is frequent drawing animations but if you don’t do anything literally nothing is drawn on the screen.
You can see this in the video above where updated screen areas are highlighted in translucent orange.
With more development time I could make the grid dirty tracking work in columns so that only the changed columns redraw, but it was not to be.
This all means the game uses very little power most of the time. I put time into optimisations like this because it makes for a better experience for players.