#Idioms for asset metadata

3 messages · Page 1 of 1 (latest)

vagrant kiln
#

Are there any good idioms for storing and managing structured metadata for assets?

As a simplified example, I have various levels that I want to include, and since I'm writing in a top-down view, there is an image asset serving as the background, as well as related metadata such as the scale and coordinate offset.

Each level will also have associated entities and code, but in terms of how I'm thinking about data, a full level feels more like a complete Scene that references the background. The background itself should be a distinct asset, but the metadata is specific to that background image and might change if, say, I were to change to high-res versions, but wouldn't require any other changes to the scene.

So what's the best idiom for this? One option would just be to store the metadata alongside the image as a distinct asset, loaded using my favourite serialisation format. But then there's no inherent link between the two. I guess I could use asset dependencies?

Another would be to write a wrapper around ImageLoader that accepts metadata as settings, but then I would have to put the metadata somewhere and then I don't get a Handle<Image> but something else.

tawdry juniper
#

For option 1, yes: custom asset format, with asset dependencies

#

Honestly I would call that the canonical and idiomatic way to do this