Calamity Engine Devlog 5
fun scripting edition
Technically attaching scripts to nodes isnt part of the framework, however, it is part of the project compiler (more on that later), so, I drafted up how the scripting system would look like!
how does it actually work
You have a folder called “scripts” where you have .hpp files that look like the image attached. Basically just like unity’s scripting API, so it should be pretty simple to get used to! These “scripts” are just classes that extend the Script component which contains all of the base functions like update, start, etc…. Then, you just attach the script like a regular component and it just works!
This way, once you’ve set up the node tree and attached scripts you basically never have to touch main.cpp ever.
node trees
Basically a fancy way of saying “serialize and deserialize loaded nodes along with their corresponding components”. Exporting a node tree would just take every node under the root node and serialize it into a JSON file.
file access
I’m currently working on a file access API used for loading and writing node trees when needed, that is, of course, cross platform (not sure about wasm yet though).
project compiler (the middleman)
I’ve finally decided how this would be structured. I will have a project structure format (fancy name for json serialized node tree + script collection) that you pass into a standalone project compiler program to turn it into a compilable calamity framework C++ project.
what about the companion app?
The companion app (aka the engine itself) would be an editor made for the project structure format. This way, this one big project is split up into more handleable chunks that I can work on individually. I still have to create the standard project template: something that would compile to all platforms with no extra tinkering required (by tinkering i mean cmake stuff)
ok bye