Closed idanarye closed 11 months ago
Entities should obviously get serializable IDs - Bevy's builtin Entity
won't work because we can not guarantee the relevant IDs are not in use when a level is loaded from scratch. So probably a UUID.
There is no need to give every entity a UUID, and this can be done in Vpeol - say with a struct VpeolUuid(Uuid)
component. Any entity that has that component will automatically get a UUID assigned to it - this is not something the level-editor can edit (unless they manipulate the .yol
files). Additionally, Vpeol will maintain a UUID->entity hashmap, so that entities that refer to other entities that refer to a VpeolUuid
entity can quickly find it. This hashmap will be populated in a populate system (a bit misleading, since it does not populate the entity's components, but it still populates a resource so this kind of works) that runs before all the other populate systems - so that they can all depend on it.
If I want to use that for #23, it can't be in Vpeol - it has to be part of Yoleck itself. So YoleckUuid
instead of VpeolUuid
. And maybe YoleckUuid
should not be a YoleckComponent
. Actually - does it even have to be a Bevy
component of its own?
This is a dup of #3
Some entities need to refer to other entities. For example - a key that opens a specific door. We need a way to represent this and to provide UI for editing this.