Skip to content

GitLab

  • Menu
Projects Groups Snippets
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
    • Switch to GitLab Next
  • Sign in / Register
  • solarus solarus
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 222
    • Issues 222
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
    • Requirements
  • Merge requests 8
    • Merge requests 8
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Packages & Registries
    • Packages & Registries
    • Package Registry
    • Container Registry
    • Infrastructure Registry
  • Analytics
    • Analytics
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
    • Value stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Solarus Games
  • solarussolarus
  • Issues
  • #1395

Closed
Open
Created Jun 22, 2019 by Hugo Hromic@hhromicOwner

Video memory management with large maps

Summary

Video memory usage grows unconditionally when the player explores any given map because map chunks that are no longer required are not offloaded. The more the player explores the map, the more memory is consumed regardless of parts of the map not being visited anymore. In general, this is not a big problem because many maps are small enough to not exhaust available video memory, however in quests with large maps or in devices with small video memory (e.g. Raspberry Pi) this can become an issue. On discord, it was discussed (and proposed by @stdgregwar) that implementing a simple LRU eviction policy for these chunks can help greatly in managing video memory for map textures.

How to Reproduce

A very useful quest to showcase the problem quickly and test a possible solution is the PathFinder quest from @llamazing. On startup, this quest generates a large map that later is used for the player to explore. Instructions to use this quest are in the quest itself and requires a mouse device.

Quest Repository: https://gitlab.com/llamazing/pathfinder

To show how video memory is being consumed without being released, simply move the Hero to a distant part of the map and use a video memory monitoring application (e.g. sudo vcdbg reloc in a Raspberry Pi device) to observe video memory usage. The farther the player moves in the map, the more memory will be consumed without being released until eventually exhausting it and the game becoming glitchy. Ideally, these parts of the map that become far away from the Hero should be released from video memory as it is not necessary to keep the entire map textures loaded all the time.

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking