8000 Function asset loading support · Issue #8 · jarcane/minicosm · GitHub
[go: up one dir, main page]

Skip to content
< 7FFF link rel="preload" as="image" href="https://github.githubassets.com/assets/copilot-e2b89335a66dba00.png"/>

Function asset loading support #8

Open

Description

@jarcane

Something which would be useful to improve user experience when employing procedurally generated assets is to be able to generate them ahead of time during the loading screen, preventing visible slowdown or freeze during game startup.

The best method I've come up with so far for this is to add a new data type to the asset loader, :function, which accepts a function which takes a callback, executes that function, and then the callback responds as if on-done event. Proposal here is vague, because this is about all I've got so far on this idea.

Activity

  1. added
    enhancementNew feature or request
    help wantedExtra attention is needed
    questionFurther information is requested
    on May 22, 2020
  2. CaptainLexington commented on Jun 29, 2020

    @CaptainLexington
    Contributor

    I think since assets is already designed as a function, it might make sense to pass it state and call it during the game loop - I don't think it would even be necessary to call it every frame, maybe twice a second or so - so that you can load (and unload) assets at will during runtime. I recognize this complicates the architecture of start! and game-loop!, and there is an open question about what should be available in the assets map while assets are loading, however.

  3. jarcane commented on Jul 4, 2020

    @jarcane
    OwnerAuthor

    Yeah. In-game loading is not something that was ever really considered; I mostly designed this for small arcade games like the demo. But during dev I experimented a lot with procedurally generating some of the assets with JS image manipulation tools, and I had to ditch it because it was too slow and the processing would hang the thread. If there were some safe async way we could do stuff like that it'd still be handy.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesthelp wantedExtra attention is neededquestionFurther information is requested

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      0