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: Screenshot from 2021-01-12 10-32-28

It's familiar, isn't it? Just notice the new editor tab WorldECS on top.

Let's add a WorldECS.

Godex, being and ECS module, stores its Components and DataBags inside a World (more info ℹī¸). To add a World in your scene, you just have to add the node WorldECS:

Screenshot from 2021-01-12 10-38-42

Automatically, that world will be set as active and all the Component storages and DataBags will be automatically stored in that world.

Create out first Entity.

To add an entity, you can add a new Entity node:

Screenshot from 2021-01-12 10-43-50

⭐ Note: It's not important put your entities under the WorldECS node. The WorldECS node is globally registered, it works exactly like the WorldEnvironment 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: Screenshot from 2021-01-12 10-49-48

Add two Components to it: The MeshComponent and the TransformComponent. You should have something like this: Screenshot from 2021-01-12 11-00-10

💡 Make sure to set a Mesh (if you want a material: assign it directly on the Mesh; 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:

  1. Add a new pipeline.
  2. Rename it.
  3. Set as active pipeline.

Screenshot from 2021-01-12 11-15-47

Time to add the Systems we need. Click on the button Add System, and add the systems:

  • ScenarioManagerSystem
  • MeshUpdaterSystem
  • MeshTransformUpdaterSystem

Screenshot from 2021-01-12 11-19-08

Put a Camera and a Directional Light on the scene:

Screenshot from 2021-01-24 18-30-34

Play the scene, and voila! Your first ECS cube 😃🤟

Screenshot from 2021-01-12 11-25-19

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