Create a new Godex Project - reeseschultz/godex GitHub Wiki
Assuming you already have Godex compiled (if not, you can follow this wiki) let's create a new project.
You can create a new Godex project, like you usually do with Godot. Opening it, you will find something like this:
It's familiar, isn't it? Just notice the new editor tab WorldECS
on top.
WorldECS
.
Let's add a Godex, being and ECS module, stores its Component
s and DataBag
s inside a World (more info âšī¸). To add a World in your scene, you just have to add the node WorldECS
:
Automatically, that world will be set as active and all the Component
storages and DataBag
s will be automatically stored in that world.
Entity
.
Create out first To add an entity, you can add a new Entity
node:
â Note: It's not important put your entities under the
WorldECS
node. TheWorldECS
node is globally registered, it works exactly like theWorldEnvironment
you already know.
An Entity
is nothing more than a bare container (more info âšī¸); Its behaviour is defined by its components that you can add using the inspector at your right side:
Add two Component
s to it: The MeshComponent
and the TransformComponent
. You should have something like this:
đĄ Make sure to set a
Mesh
(if you want a material: assign it directly on theMesh
; right now it's not fully implemented the material override and the UI to create a material is not fully working so create it and then drag and drop [It will be fixed soon đ¤]).
Compose the pipeline.
If you try to play the scene, you will have a black screen: not only because the camera is missing but also because there are not systems in the WorldECS
, so nothing is running. Let's fix it.
Click on the WorldECS
, it will open the editor where you can create a new pipeline:
- Add a new pipeline.
- Rename it.
- Set as active pipeline.
Time to add the System
s we need. Click on the button Add System, and add the systems:
ScenarioManagerSystem
MeshUpdaterSystem
MeshTransformUpdaterSystem
Put a Camera
and a Directional Light
on the scene:
Play the scene, and voila! Your first ECS cube đđ¤
You can download the created project here: HelloWorldECS.zip
âŦ ī¸ âĄī¸ Godot and Godex can be used at the same time, more details on the Next page