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

Add UUIDs for resources #702

Open
mrDIMAS opened this issue Nov 20, 2024 · 0 comments
Open

Add UUIDs for resources #702

mrDIMAS opened this issue Nov 20, 2024 · 0 comments
Milestone

Comments

@mrDIMAS
Copy link
Member

mrDIMAS commented Nov 20, 2024

Fyrox resource system uses file names as their id, which adds a lot of headache in the following situations:

  1. References must be fixed when a resource is moved across file system - this is very problematic, because it requires scanning the entire assets directory and loading each asset to look for resource references. If such reference is found, then it must be changed and the resource must be written back.
  2. It is impossible to substitute a resource with more efficient representation for shipping builds - devs usually work with "raw" resources (such as jpg/png for images, fbx for 3d models, and so on) and these formats aren't very good for final game builds. Such resources could be pre-processed for shipping build to have more engine-friendly representation. For example all images could be converted into a format that have all mip-maps generated, 3d models can be converted to simple vertex+index buffers and so on. If the resource system used UUIDs, then this issue simply wouldn't exist because a resource data (file) associated with the UUID can be replaced entirely.
  3. There might be some other very specific cases so this list might be updated.

UUIDs can be added pretty easily, but this system requires adding special metadata files near each supported resource. This metadata file must contain the UUID and maybe some other information. The name of the file must be the same as the resource but with .meta extension.

The engine must automatically create such files for every supported resource when it starts. So the UUID of a resource will always be loaded from metadata file and will be stable.

@mrDIMAS mrDIMAS added this to the Fyrox 1.0 milestone Nov 29, 2024
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

1 participant