Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Asset Lifetime v2 - Optimized Scene Transition #2757

Open
6 tasks
leggettc18 opened this issue Apr 28, 2023 · 3 comments
Open
6 tasks

Asset Lifetime v2 - Optimized Scene Transition #2757

leggettc18 opened this issue Apr 28, 2023 · 3 comments

Comments

@leggettc18
Copy link
Contributor

leggettc18 commented Apr 28, 2023

Kenix3

  • At game boot load all authentic game assets, load all HD assets that are NOT in overlays/scenes/objects. Load HD gameplay_keep. Load all HD GI objects.
  • Create actor asset load/unload functions for all actors.
  • On scene transition, load all assets necessary for a scene. Since we aren't streaming load rooms for v2, we should probably preload all rooms in the scene.
  • On actor spawn and scene transition for each actor in the scene, load all assets necessary for an actor when it is spawned in. We will need to add a function in SoH's actor struct that loads all of it's necessary assets. Run this when the actor is spawned.
  • When transitioning scenes, unload the appropriate keep (dungeon or field)
  • When all instances of an actor are despawned, we run the actor asset unload function. In the actor asset unload function we unload all of the assets that the actor depends on.
@briaguya-ai
Copy link
Contributor

On scene transition, load all assets necessary for a scene. Since we aren't streaming load rooms for v2, we should probably preload all rooms in the scene.

i think this part needs to be broken down a little:

  • figure out how to get all the assets necessary for a scene
  • decide where to/how to/if we need to store that information
  • actually do the loading

i started poking around a little and got lost at the "Figure out how to get all the assets necessary for a scene" part

@briaguya-ai
Copy link
Contributor

figured i should link the PR with discovery work i did on this #2840

@Malkierian
Copy link
Contributor

Building on briaguya's PR there, I now have #4652 which addresses determining a scene's object and actor lists, and loads everything on transition initiation. It persists all alt textures and overlays, as well as normal audio, and a few objects (like gameplay_keeps, title screen logo, etc). It also unloads the previous scene's assets, but only (in the case of actors and objects) if the next scene doesn't need them. I honestly don't think individual asset lifetime is necessary at this point, as even with the 4K reloaded pack I was using around 5GB of RAM with the way I have things setup there. This likely can be closed when that gets merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants