Hey everyone, when this thread is in the WIP section, I realized I maybe could write some development logs between releasing new versions of the tool, so here it is, my first devlog!
Porting code base over to C++
Throughout the many years I've been working with GM, I've always been writing everything in pure GML, without using any DLLs (except for the 39dll in those times
), as I felt like it was a part of pushing the boundaries of GM. But recently, while working on BBAC, I realized how beneficial it could be to write specific code in C++ instead and that avoiding it just for sake of "being pure GML" does not really help anything. BBAC is a Windows only tool anyways, not a cutting edge game or a tech demo. And so I decided that I will port some of the code base over to C++ (like D3D / MOD and BBMOD loading), as well as create some new libraries that will allow us to do things that are impossible with pure GML.
Job system
One of the biggest GM's disadvantages is that it does not support multithreading. Right now, If you have a lot of bigger models in your BBAC project, the entire application freezes until they are all loaded. To address this, I've been working on a multithreaded job system in C++. The system is pretty simple, first there are created as many threads as there are CPU cores. Each thread takes a job from a shared queue, executes it and then puts it into another queue, which is then accessed from GML (to know that the job has been finished and to get it's result). The jobs themselves are also written in C++ and they are spawned from GML. Here is a little example of a SleepJob, that just makes the thread that is executing it sleep for given number of seconds.
In BBAC, this job system will be mainly used for import and export of models.
Using Assimp to load third party model formats
Until now, all BBAC was able to import was OBJ models, and only in a limited form (they had to be triangulated, had to have normals, etc.). Fortunately, there is an amazing open source library called
Assimp, which allows to load practically any format ever, including the industry standard FBX (you can see the whole list in the link). Part of the DLL that I'm working on is a wrapper for this library. As I'm writing this, I already have a working version of a loader of mesh hierarchies, including their transformation matrices.
Next up will be loading materials, skeletons and animations. BBAC will then of course also support to export the loaded models into a custom binary format, which will be more suitable for in-game use and will be loadable without the DLL. Since rendering of objects consisting of multiple meshes and / or animated models is a bit more complicated and requires more scripts, you can also expect that there will be an example GM:S1.4 and GMS2 project with the scripts included.
I think that's all I have for now! Thanks for comming by and speding your time by reading my first little devlog.
It's already kinda too late for me and I'm sleepy, so it's hopefully not too poop