Ergo has finally reached a point where it is mature enough to be used as a proper scripting language.
It is already being used to implement effects, to extend entity definitions, to define dialogue triggers and dialogue trigger handlers, and, as of last week, to generate maps and to define the prefabs that populate them.
That's all good but ideally most of the game should be entirely written in Ergo, with the Fiero engine acting as a skeleton. Right now it's an uneven mix of both, mostly because Ergo was integrated relatively late into the project.
Fiero.Core already handles the basics of Ergo scripting (event/data routing; input) , but most of the more game-specific stuff is being done in Fiero. Ideally, as much Ergo as possible should go in the core project to cement it as the engine's scripting language.
Then there's another problem... ish. Right now, entities are defined in C#. They can be extended by Ergo scripts, but not defined. It's fair, but ultimately, thanks to Fiero's ECS architecture, it's not really necessary to have the definitions available from C#. They could be expressed directly in Ergo, which would be great for modders as it would enable them to add new entities and entity types to the game.
Future work includes writing UI scripts (and possibly defining layouts, which currently is only possible in C#); actor AI scripts (also only possible in C# right now); configuration scripts and more.
Asset loading is another thing that can be done in Ergo, which is being done in C# right now. Most of it relies on JSON files, which is okay, but at this point I might as well just do everything in Ergo.
✔️ Event routing: lets scripts subscribe and respond to game events (via MetaSystem).
✔️ Data routing: lets scripts observe and respond to changes in the game's data (via GameDataStore).
✔️ Entity Definition: lets scripts define additional properties to add dynamically to entities when they are built.
❌ Effects: they bind to events and apply custom logic.
TODO: Move from Fiero.Business to Fiero.Core.
This is proving difficult, and would require some rethinking of the abstractions involved. As it is, EffectDefs are too coupled with the business logic. For example, the notion of an effect's duration differs between real time and turn based games, so the associated modifier can only exist in business code. A better abstraction is needed.
❌ Configuration: lets users configure various aspects of the game.
❌ Asset Loading: lets users specify which assets to load and how.
TODO: Analyze whether Ergo makes more sense than JSON (which is orders of magnitude faster)
❌ UI: offloads the definition of layouts to Ergo scripts so that users can mod them and allows reactive, event-based UX through the event and data routes.
Ergo has finally reached a point where it is mature enough to be used as a proper scripting language.
It is already being used to implement effects, to extend entity definitions, to define dialogue triggers and dialogue trigger handlers, and, as of last week, to generate maps and to define the prefabs that populate them.
That's all good but ideally most of the game should be entirely written in Ergo, with the Fiero engine acting as a skeleton. Right now it's an uneven mix of both, mostly because Ergo was integrated relatively late into the project.
Fiero.Core already handles the basics of Ergo scripting (event/data routing; input) , but most of the more game-specific stuff is being done in Fiero. Ideally, as much Ergo as possible should go in the core project to cement it as the engine's scripting language.
Then there's another problem... ish. Right now, entities are defined in C#. They can be extended by Ergo scripts, but not defined. It's fair, but ultimately, thanks to Fiero's ECS architecture, it's not really necessary to have the definitions available from C#. They could be expressed directly in Ergo, which would be great for modders as it would enable them to add new entities and entity types to the game.
Future work includes writing UI scripts (and possibly defining layouts, which currently is only possible in C#); actor AI scripts (also only possible in C# right now); configuration scripts and more.
Asset loading is another thing that can be done in Ergo, which is being done in C# right now. Most of it relies on JSON files, which is okay, but at this point I might as well just do everything in Ergo.