“Periodically, individual dwarves are struck with an idea for a legendary artifact and enter a strange mood. Dwarves which enter a strange mood will stop whatever they are doing and pursue the construction of this artifact to the exclusion of all else. They will not stop to eat, drink, sleep, or even run away from dangerous creatures. If they do not manage to begin construction of the artifact within a handful of months, they will go insane and die soon afterward.” – Dwarf Fortress Wiki
Strange moods abound in the office. It must be Autumn.
I was seized with the strange mood recently after I got annoyed when implementing a new feature – more office code, I believe. Writing and testing my code required me to make a change to the Lua scripts, open the game, build an office, test the feature, see my stupid mistake, shut down the game, change the Lua script, open the game again, and continue ad infinitum. Uggh. Inspired by Casey Muratori’s Handmade Hero approach to hotloading – even though our approaches are totally, conceptually dissimilar – I decided to add the ability to reload Lua scripts on the fly to the game. The UI code is crude and nasty, but it looks something like this:
You get a button for reloading a script, and the “Edit” button will actually open your script in Komodo IDE if you have it installed on your machine, which is pretty slick. (Why Komodo? It’s what David uses on his machine.) So far, it seems to have made life better, but we are limited in our ability to make life better by our ability to remember to use it. Does this mean that the tools we use need to be in our face for us to remember how to use them? I’m not sure yet.
Offices snuck into Revision 43, but they don’t really do much other than providing the backend for new Vicaring operations. In actuality, an office consists of a big pile of scriptable UI elements that you can hook to do whatever. In conjunction with rewriting the military code to be faster/better/actually work/not drop guns everywhere, we’re adding military controls to the barracks for each unit to configure that military unit’s behaviours.
The actual content of this window will, no doubt, evolve; however, you have a “boolean toggle” row (indicating what weapons this group will use), and a “choose one of the following options” order for indicating what this military regiment should do (train, patrol, man the emplacements, build military engineering projects, or assault a specific point.) Having better/programmable controls means that we are finally embarking on the military master plan, so hopefully we will stop having people dropping all their guns any day now. A lot of the code for this actually working is dependent on me finishing the new decision tree AI which runs before/after/on top of/in conjunction with the existing jobs system to handle things that aren’t, really traditionally, jobs with utility, so visible progress on this system in the experimental build may not show up for awhile.
We will, I am sure, talk more about military emplacements in a bit.
Daniel and David were also seized by Strange Moods on Monday, and promptly started digging into the office code. David’s mission: create a barbershop where you can receive medical treatment. We are still arguing about the role of leeches in modern medicine, but it seems like bandages might be something that you might receive in a barbershop. Daniel has been creating a Public House where people can go to sit down and receive a glass of Foaming Ale. A related piece of code involves having “building supplies” for offices (A cabinet of bandages and leeches, for a barbershop; a terrifying booze vat where they just pour all the alcohol available in the colony into some sort of frothing swill for the public house), and giving the offices standing orders (“FILL THE TANKS!”) when there are no jobs in the office jobs queue to fill.
Now, if you will excuse me, I have to go back to the workshop and whisper to myself about my visions for a lovingly engraved pig-tail tunic embossed with strips of dog leather.