GameDevTecnico / cubos

A still very barebones game engine focused on voxels and data-oriented programming
https://gamedevtecnico.github.io/cubos/
MIT License
83 stars 23 forks source link

Allow identifying assets in code from their path #1177

Open RiscadoA opened 3 months ago

RiscadoA commented 3 months ago

Problem

Currently assets are only identified by their UUID. This is great for automated tools and stuff, where human eyes are not needed. But when a dev wants to refer to an asset and needs to manually identify it, be it in scene asset files, or in code, its not readable at all, nor fun, to have to store an UUID there.

Solution

We should also allow assets to be identified by their path. For example, instead of:

static const Asset<Scene> RedCubeSceneAsset = AnyAsset("1aa5e234-28cb-4386-99b4-39386b0fc221");

We could write:

static const Asset<Scene> RedCubeSceneAsset = AnyAsset("/assets/scenes/red_cube.cubos");

This should be a matter of: