Skip to content

Remove UpdateGraphics() sequence. #2218

Open
@mateofio

Description

@mateofio

Right now we have:

  1. Update() - does game logic updates - locked to 60fps
  2. UpdateGraphics() - updates the state of drawables based on game logic - locked to 60 fps
  3. Draw() - draws drawables - runs at configured fps / vsync

I would argue that (2) is completely unnecessary. In Draw() we can grab the state from the game objects and then draw it directly.

  • Simplifiy the main loop, particularly with transitions and drawing to other bitmaps. Every call to draw will be guaranteed correct. It will also simplify the game logic and remove the need to carry state between calls to (2) and (3).
  • Remove state from our sprite classes. As as a result we may get better performance and less memory usage.
  • Speedup low framerate scenarios. In cases where we run multiple logical frames per physical frame, we would not update the graphics each time.
  • Pre-requesite to be able to implement an entirely different rendering pipeline such as OpenGL, Vulkan, etc... Just need to create new drawables with a different Draw() method.
  • Pictures
  • Actors
  • Monsters
  • Map Events
  • Tileset
  • Weather
  • Panorama
  • Timer

Metadata

Metadata

Assignees

No one assigned

    Labels

    DrawablesPerformanceRelated to improvements on memory, less CPU or disk usage, battery savings, etc.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions