PixelMap
I happened to see a boosted post on Mastodon, where someone mentioned that most programs handle their configs badly, basically generating full configs, maybe with commented out options and defaults, which upon updates will be rendered worthless if they change. I responded to how I handle my configs, and suggested an alternative solution, which I implemented.
The first version of PixelMap 0.x had all configs statically added to the program, meaning they cannot be changed after the program is compiled.
I managed to reduce the total time to 14 times native by integrating thread_local for Lua states. I will probably stop pursuing this further as now I probably need to micro optimize Lua the integration itself. Could be that as it does not output correctly would be a potential reason why it is slower too.
Worth noting is that the Lua rendering is not completely implemented as it currently does not work with blending.
Of course I would think that adding Lua as a rendering pipeline would reduce performance significantly, but I never imagined it would be to such degree. On Christmas and New Years holidays I had some free time I wanted to spend on a side project, just seeing how it would turn out. As mentioned previously, I started with creating the library loading and all the utility features around that, which was surprisingly both easy and straightforward.
Some should know by now that I have been thinking to add some sort of pipeline or add-on system used for the rendering. The rendering pipeline itself is currently set in stone, where you can only specify what parts to include and it will be done in proper order. I later thought of adding some sort of pipeline string where you can customize this, but I don’t expect people to find it intuitively enough.
One usually forgets the most useful tools right after using them. While I was refactoring a couple of months ago, I had done around 40 commits this day and suddenly realized that it did not render properly. As I had no idea what had caused this, i found out about git bisect. You give it two commit hashes, the first and the last, and it will binary search through all those commits, where you compile and test for each one, and tell if the bug exists or not on that specific commit.
I said I would not do this, but then I thought it would be possible so I spent a couple of hours, i.e. too much time, to implement this for Bedrock worlds: block light. As I mentioned previously, Bedrock worlds does not store light maps as Java does. This means that I need to manually generate the lights for night mode. I thought it would be a simple algorithm:
Find min-max on world.
I have since I wanted to make this program open sourced contemplated over the best licensing for it. Not only have I skimmed through several license types, but also discussed with a multitude of people (sadly no lawyer). Just recently I went through what the existing mappers, those being released as FOSS, had and found three licenses: GPLv3, MIT and BSD. I also figured other issues that I needed to settle with licensing.
I forgot to mention that while Bedrock tries to avoid saving sections in order to reduce storage footprint, it also avoids saving certain data, like light maps. This makes it a whole lot harder to determine light in the world, and I rather avoid generating light, even if it should be straightforward (find light source; breadth first search with reduction and light conditional check), but I guess I have no other choice.
It has finally been released. I spent about an hour to just fix all compilation errors that popped up in Windows, but now it is done. I expect several bugs, and stability going through the roof, due to how Bedrock works, but at least I can focus on other things, like fixing bugs, optimize, stabilize and additional features.
While the log format is rarely used in MCBE, it still is used to add an another layer to reduce overhead while keep the integrity of the database in rare cases of sudden shutdown. I previously ignored it, as the worlds I saw never had any data in the log file anyway. However, it may include certain updates which adds additional information to the world which was added recently, especially if you stopped playing right after you did some changes to your world.