2024-01-11

Project Raygine #13 - packaging progress 5%

First a nice GIF for how the editor looks and feels like:

Raygine editor gif showing playmode with a ship limited in a playfield

That GIF is a few days old, but I haven't worked on that part since then. Before I get too burried in making a game inside the editor, I want to implement the build process: Running the project standalone.

The plan is that the build should not involve running GCC or anything - just a few scripts to create the build inside the editor, triggered by the user (just like in Unity / Defold / other such engines). But for doing this, I need to do a few steps:

The first step is done by now. It turned out that my make file was ... very poorly set up. I fought several build problems to get it working, but the builds are now faster and it's outputting both binaries.

I am skipping the second step for now; I don't have yet the pipeline for preparing the files like doing an ASTC compression and so on. That is for much later.

So I am working on the last step now: Embedding the content into the binary. For that; I am simply appending the file index and files at the end of the binary. I hope that's fine for the handling of the executables. If not, I would generate simply an extra file that contains the same data. I want to have it all bundled into one file, because I tend to dislike the mess of many files for an installation. A game running as single executable is something I always enjoy seeing. IDK why.

Anyway, it's coming along: The runtime in itself has builtin commands to append a directory to the end of the binary. It needs to be executed in the editor folder, because it also appends all the script files. I am not sure if I want to keep that; I could do the same for the editor release: appending the script files of the editor to the binary, but I think it's better to have the editor open for the user to modify the scripts. I am almost done with the embedding step. Once that is done, I will start making the runtime launch properly. That means: I needs to load all the files from the bundled content. This is going to be the most tedious part: Every load operation needs to be wrapped to be funneled through the package reading code. For the lua scripts, this is actually the easiest, since I can simply add a module loader. For the raylib functions that load things from files, I will change the lua bindings so that they check if the file is present in the bundle and if it can be loaded from there.

Still, it's going to be "fun", because I need to handle file paths again, something which has already been a terrible time sync when I worked on the asset database thing (it's not a database, it's way too crude to be called like that).

So much for now, much work needs to be done!

🍪