We are still out of the office until January 4th, 2016, at which point the terrifying cogs of progress begin turning once again. Today’s blogpost, therefore, is put together out of whatever images I can find on my computer. Which is okay, because we’re really interested in Trade Depots today, and I took a lot of screenshots of Trade Depots. But first, a little history.

Here is the first version of the Character Info screen for Clockwork Empires, circa January 2013 (right at the point where, maybe, we had little characters running about and doing something.) For those of you who are wondering how much optimization has already gone into the game, we seem to be running at 28 FPS here despite… not rendering much of anything.

One year later, we had moved to this:

This is taken from David’s design notes, which he sent to me to try to clean up the UI. The version on the right is *fairly* similar to what we still have today, albeit there is a Great Big Whacking Emotional Widget on the right hand side of the character display now. So… UI is a constant, on-going evolutionary process. The screen you start with is not necessarily the screen you end up with.

So here is *where we are, right now* with the state of the Trade Depot:

Concerned citizens are welcome to speculate: is this UI pulled from Dwarf Fortress? Well, yes and no. Certainly the idea of the barter system and its basic mechanism is very similar to Dwarf Fortress, with a two column display representing goods for trade and goods to be traded for. At one point we had commodities arranged in both windows like in the commodity UI window, but doing it as a horizontal display like this seems to clean things up nicely. Your proposed trade is displayed on the bottom, and there will be some indication as to the relative economic worth of your offer versus the other player’s offer.

At present, Novorus Traders will actually arrive in your city to deliver goods. I’m not sure if this will actually make it into version 46A, or if the traders will just magically show up and the goods will be hidden in space somehow, via the invisible hand of Cog. The reason for this is that traders currently run using the AI mission control system that we wrote for simple things like “fishpeople march through your town and kill everything”, and it does not necessarily scale all that well to recovering from such an event. The term we use in the office is “Bethesda Failure-Case”, directly inspired by Fallout 4: if something goes wrong, do we have a minimum viable level of support in the game for cleaning up and handling the failure in a robust manner?

As a good example of a “minimal viable failure”, here is a band of Novorus Traders assaulting a wandering Obeliskian with preserves. Not really what we want, or how we want to handle it.

In Dwarf Fortress, there are a number of failure cases that are handled when a merchant arrives: the merchant may fail to arrive, the merchant may fail to leave, their goods may be seized, their goods may be damaged, you may give wood products to the elves. The correct way to scale this system is by using a decision tree to run missions, which means I will probably hijack the decision tree code used by the military (and hopefully to handle things like “I’m on fire!”) and extend it to run missions with full crews of AI characters. This sort of hierarchical mission-planning is a very common thing in game development, especially for strategy games.

Other notes: goods can be reasonably expected to be different depending on which empire you are negotiating with, and your relative state of hostility. This, in turn, can feed into the foreign office that Daniel has been working on, and the global state of Empire-to-Empire negotiations in the overworld, once we have overworld meta-state working.

So that’s push number one this month for me: finishing trade. I had hoped to get it into 46, but there were just too many moving parts. Push number two… well, you’ll just have to wait and see..