In Clockwork Empires you have a few fundamental game-pieces: agents that do stuff for you (colonists), places on the map they do stuff at (buildings/modules), and things produced by and consumed to build or upkeep the former categories: commodities. In other words, commodities are the food, planks, bricks, and so-on your colony needs to survive and grow. As such, commodities are very important to everything. So it is, by extension, very important indeed that a player knows how many of each commodity they have, what the commodities are good for, and how to make any commodity they don’t have but would quite like to have, thank you very much.

We’ve been working on tightening up these systems, both in the backend code and in the frontend code for expressing what’s happening in-game to the player. Let’s visit some of the work done toward these ends.

Re-Categorized Commodities

Did you notice that we redid the commodity filter categories? This affects both the commodities screen and how you can filter what goods are stored in stockpiles. Basically, the old categories were a guess thought up several years ago before the game was much of a game. Now that we have a game that’s a game, we can see very much better how commodity flow is used in colonies, so we drew little charts on the whiteboard of where commodities came from and how they get used and came up with the most efficient – but still very broad – categorizations we could. They’re much nicer than before.

Construction UI

Ever since moving module construction to the “boxed module” system (where most modules are produced as a single crate that must be deployed on the spot rather than each module requiring a ton of separate ingredients), feedback for what is required to make a module has been fairly poor. You could see that the construction required a boxed module, but that’s obvious. The real question in a player’s mind is: What does that boxed module cost to construct? So now you get something like this:

The power saw requires a boxed power saw, yes, but you can also see all of the ingredients required to make a boxed power saw: six lacqured planks, four iron plates, two steel ingots, and a bucket of cogs. You also can see if you do or do not have all of these ingredients, so now you know what you need to get if you want to build a power saw.

Tangentially, there’s also a pop-up window describing what construction mode you are in because this was not made explicit. This is probably helpful to newer placers:

Commodity Count

We’ve been plagued for some time by a discrepancy between the commodity count you see in the commodities UI not matching the actual number of, say, planks you could find in stockpiles in your colony. In fact, Nicholas went slightly mad over these and become obsessed (“I must have coffee!” he screamed.)

This was essentially a technical implementation problem: Commodities were created and destroyed in various ways and places in code, and player ownership was set or removed in various ways and places in code. Odd cases abound: if a Fishperson is killed and drops a cube of meat outside of civilization, who owns it? If it’s dropped in-civilization, who owns it? If a Bandit steals some goods and is running away, and is killed, how far away is it valid to automatically create an order for a colonist to grab the item? (We certainly don’t want to re-create the Dwarf Fortress lost sock + giant cave spider death march problem.) — And that’s really the fun stuff, the real work was in the boilerplate code for creating and destroying items in the course of everyday workshop production in a way that accounts for job interruption, stacks containing many items, random explosions destroying commodities, and so on.

You’ll be glad to hear that it’s all sorted out now.

Commodity Destruction Order

An interesting case related to the above is the fact that a workshop job with multiple ingredients will first collect all of the bricks, return them to the workbench, destroy them, collect all the cogs, return them to the workbench, destroy them, then spawn the job product. What happens if that job is interrupted at some point? Why, you lose the destroyed items (because they’ve already been destroyed). This could be considered an acceptable cost for allowing work to be interrupted by hostile creatures (as tends to be the case) – but this gets reported as a bug. Why? Because it’s not made clear to the player what’s happened and why. One can imagine a case where we inform the player that their cook has let the cabbage burn due to being chased by a fishperson, but if we’re going to go through the trouble of storing information for a notification we might as well just return the commodity and not introduce an additional cycle of feedback-response.

So, this’ll get cleaned up. What is interesting to me is how players interpreted the events of the game that are an artifact of how the system is implemented as a series of finite state machines, how the development cost of UX is probably equal or greater than pure game logic, and when to decide to use one or the other tool to solve a problem.

Forest Meat

Loading up some long-running player games to look for bugs, I noticed a ton of meat strewn about the sides of the map. This is not ideal for a few reasons: the game is tracking a ton of entities that are barely affecting the game, and if colonists do get around to attempting to haul these low-value chunks of meat home it’ll take them all day to return just one. Plus it’s a bloody mess!

So what was the problem? Well, carnivorous animals weren’t nearly as interested in eating leftover meat as they’re supposed to be! Fixed that up, and now the forest is a much cleaner place – and you may actually have to defend your sausages from roaming foxes.

It is fascinating how one clean-up function of the simulation going off-kilter can have such a major effect.

Module and Building Dismantling

Yes, you now get your materials back when you dismantle a module or building! This should encourage people to be a little more dynamic about building a small building and feeling comfortable with upgrading to newer, bigger, better stuff once their colony can support it.

“Doesn’t this make it effectively free to do everything?” you ask. “Sort of!” we answer, a mad gleam in our eyes. Which is why we’re adding a better maintenance system. But we can talk about that another time.

Enjoy the commodities.