April 26 - Moon, Moon

Performance improvements continues! Save files are smaller, load and save times are down, memory usage is down, and performance is up. Alright, see you next week.

Oh wait! I made the moon brighter. That means it should be much easier to see at night without a torch. I also added an always visible FPS counter to the Options screen, and made it so changing the options will update your settings in realtime so you can see the impact it has on your FPS. The "save" button has been replaced by an "undo" so if you want to revert your changes make sure to hit that instead, otherwise your changes will save automatically when you close the window.


Finally, we've been working on improving the appearance of skin, and some of those changes have gone in.

This feels short for how much work it was, maybe I'll get into some of the nitty gritty. There are still a couple of rendering spikes and some bad script spikes that need to be ironed out, and if you're getting performance issues and want to report it, including your seed (hit tilde) or your save can make it easier to track down the issues. Reducing file sizes and save/load times was simple in concept but harder to implement: I don't save parts of the map that don't need to be saved. That is, the parts the player hasn't touched yet. Since I use seeded randoms to generate the world, if I use the same seed to generate the same part it should look the same every time. Thus if the player hasn't come in and changed things yet I can just re-generate it every time it's needed instead of storing it in the save file. This results in smaller file sizes which means it takes less time to load and less time to save.

There's a lot you can do to reduce memory (besides drinking), but it's usually complicated, time-consuming, and trades CPU time for RAM. An easy way is to compress your textures, so I did that. The biggest change (and also the most complicated) is to only load parts of the world into memory as needed, which I did a bunch of work towards. Reading terrain data needs to be super-fast, because it's done constantly. That means I need to store as much of it as possible in as simple of a data structure as possible. The more steps in between the longer each individual read takes and walking around becomes noticeably laggy as the world is loaded/unloaded constantly as you move around. I can shrink my data structure and load data into it quickly in the background, but since a good 50% of the game is placing and removing blocks then I have to do a lot of rewriting of the underlying code to get it all changed.

Continue Reading in the Dev Forums >>

<< Return to Devlogs

This website exists thanks to the contribution of patrons on Patreon. If you find these tools helpful, please consider supporting this site.


Follow on Twitter Support on Patreon
Make campaigns and save encounters / combats / dice rolls and more. One step!



Recovery Email (Optional):