Scenes and ECS
Set up and manipulate the data of your entities
Last updated
Set up and manipulate the data of your entities
Last updated
Scenes are written in XML format, and read by the engine to create your game's environment.
The XML file should follow the following format:
Each entity have two optional fields, id
and name
.
id
is the index of the entity, and will override any other entity at this index
name
is a string, and help navigate your scene panel, as well as provide a way to select a specific entity by name in your scripts
If the id
field is not defined, its value will be last + 1
, and if the name
field is not defined, its value will be an empty string.
You can then define every components an entity should have, and their values. You can find the list of native components and their fields down below.
To add your own script to an entity, the process is the same as a native component. Create a tag of the same name as your script, and you can specify any public field you want to override.
Only fields of type float
, ulong
, string
and Entity
can be applied.
A few test scenes are included in the engine to test basic features, all the source code is available on GitHub.
If a scene is named main
, it will serve as the default scene when launching the game's executable. Otherwise, the selection will follow the file opening order, which depends on the filesystem iterator.
Scenes are hot-reloaded, which means that saving the XML file will reload the scene.
When the scene is reloaded, the current modifications inside the editor will be lost.