Fail when detecting ambiguous asset references #1936
Labels
Status: Needs Investigation
Requires to be debugged or checked for feasibility, etc.
Topic: Stabilization
Requests, Issues and Changes related to improving stablity and reducing flakyness
Type: Improvement
Request for or addition/enhancement of a feature
Current Status
When referencing assets, for instance tile textures in a block definition, these asset references do not always include a module identifier but are sometimes referenced solely by their name. In module combinations with assets that share the same name, this can be a problem as the game does not know which asset to pick.
Currently, the resolution of ambiguous asset references is buggy and results in weird behavior. This can be reproduced by locally reverting the fix provided in #1934. By now the respective block definitions reside in CoreAssets. Detailed reproduction steps and screenshots of the issue are provided below:
How to Reproduce
CoreGameplay
world withPlantPack
enabled and memorize the seed.F3
) and observe it's side textureCoreAssets:
prefix in OakTrunk.block withPlantPack:
CoreGameplay
world with the same seed as before andPlantPack
still enabledOakBark
CoreGameplay
world with the same seed as before andPlantPack
still enabledCoreAssets::OakTrunk.block
with"tile": "CoreAssets:OakBark"
CoreAssets::OakTrunk.block
with"tile": "PlanPack:OakBark"
CoreAssets::OakTrunk.block
with"tile": "OakBark"
Desired Status
If multiple modules provide assets with the same name, the game is expected to be confused. Theoretically, it should at least pick one of the available assets with the referenced name and not, as it seems to be the case currently, pick an arbitrary other asset to use.
Practically, we want to avoid ambiguous situations and always prefix asset references with the respective module.
Hence, it would be even better to fail the world creation with a reasonable error message when noticing an asset reference that is missing a module prefix and may lead to ambiguity.
The text was updated successfully, but these errors were encountered: