For some days I have been working on converting most of the bitmap-based UI in Survivalcraft to procedural drawn one. Along with that I am doing large refactoring of the code that handles the UI to be less rigid and easier to extend.
To give you some background of that work, in 1.24 every panel was hand drawn. Furnace, crafting table, inventory, chest, vital stats etc. As you can imagine, to maintain these panels required a lot of work. Horrible, mechanical work mostly. Bitmaps are inflexible, ugly in high-res, and are increasing download sizes and memory usage. I knew for a long time that they will have to go.
Because one of the features in 1.25 will require me to extend the list of these panels (hint, hint), I decided now is the time for a change.
For example, here’s how the procedurally drawn furnace panel looks like:
All the slots, text and even the arrow is procedural, everything declared in my homebrew XAML-derivative. For the coders out there, I even have attached properties. How cool is that :-)
Fonts are still bitmap-based unfortunately, even though they use a much improved rendering engine compared to what’s built into XNA. I’m not really up for making a cross-platform vector font renderer…
All this has interrupted my work on the actual game features, but I should be back on them shortly! Some major refactoring is needed from time to time if the game codebase is to stay healthy.