Skip to content

GitLab

    • GitLab: the DevOps platform
    • Explore GitLab
    • Install GitLab
    • How GitLab compares
    • Get started
    • GitLab docs
    • GitLab Learn
  • Pricing
  • Talk to an expert
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
    • Switch to GitLab Next
    • Menu
    Projects Groups Snippets
  • Get a free trial
  • Sign up
  • Login
  • Sign in / Register
  • solarus solarus
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 229
    • Issues 229
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
    • Requirements
  • Merge requests 10
    • Merge requests 10
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages & Registries
    • Packages & Registries
    • Package Registry
    • Container Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar

GitLab 15.0 has launched! Please visit Breaking changes in 15.0 and 15.0 Removals to see which breaking changes may impact your workflow.

  • 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