Working on an Entity and Event Component System

Hello! For the past few days I’ve been on a quest of making a personal “Addon” for godot that I can use for my own projects, the addon in question is an Entity and Events Component system Very inspired by the Synchroni API for Crypt of the NecroDancer’s official modding tools.

The main concepts are like:

  • Game Objects are just holders for the components.
  • Components exclusively call events and store data.
  • Events “replace” signals, events are just methods that take in 1 dictionary with all of the necessary data inside of it as the parameters. More on how they work later
  • Events are able to call other methods that are registered to specific points, usually a method is divided by, “start”, “middle”, “result”, but they can have as many as neede. Each of these points within the events call methods that can either just do their own event OR are able to modify the function’s outcome on the fly by overriding its “params” dictionary.

Event.call_order() is responsible for “setting” the waypoints within the events.

While Event.register_event() puts specific callables into a dictionary so they can be called by Event.call_order(), not exactly sure how else to explain but the screenshots above should make the picture clear ^w^

I’m mostly sharing because I’ve just been super excited to finish this so I can try and use it for a game to put its potential in practice, so far its proven to be great during my minimal testings so I’m super excited to see how effective this can be, mostly just wanted to yap! And feel free to respond if you’d like to dicuss this with me as well, critiques and questions are welcome.

Proper showcases and updates will be posted here in the future.

A few notes: I’ll be making Node, Node2D, Node3D and Control variants for components, was told some of these Really don’t gotta be Node2Ds.

I’ll also be making GameObjects of these 4 node types + Sprite2D.