Ultima Ratio Regum 0.9 is mostly about procedurally generating the game’s items:
With the item generation itself complete (and with coins and currencies also generating), the next thing was to get items appearing in shops. This meant returning to the code that generates all possible items, and then integrating that with the code for generating a shop; now when a shop is first created the game creates a list of possible items that might appear in that shop from the much wider list of items that civilization creates, and then it puts one on each of the “stall” tiles within the shop. If the list runs out, it then reshuffles the list and “deals” out items again. This means that for some shops you’ll see similar items cycling relatively quickly, such as armour shops for example, while others – such as book shops – continue to produce a large range. Some shops, such as general stores (can spawn any low- or medium-quality item from that civilization), antiques shops (can spawn any high quality item from that civilization), curiosities shops (can spawn any medium- or high-quality item from any other civilization), can therefore have extremely large libraries that cycle around again. In turn, because some shops define particular categories (e.g. “low quality novel”) rather than specific items (a specific low-quality novel), variation can also occur there. In the picture below you’ll see a range of different shops I’ve collected from various places, selling various different sorts of goods. In all cases I’ve tried to make sure the colours of the items are logical for what the item is, and that each category of item has a different character. For example, in the top-left of these you’ll see rings and necklaces (I suspect it is obvious which is which) with the rings in this shop being turquoise, jade, silver, iron, and platinum. The others are necklaces, whose colour (dark grey, silver, gold) again reflects the actual material you see in the image of the item. In the other examples here you can see shops selling armour, various kinds of ammunition, shields, wine, wooden and pottery goods, pocket watches, antiques, ambergris, spices, maps, mining tools, and almost anything else you could think of.
The second step was to get their images appearing correctly. Every generated item naturally has a generated image, and we need to move these out of the separate program I design the graphics in (this being far, far faster than testing them within the game itself) and into the game. This might seem like a totally trivial thing, but in the graphics-creation program all the variables that might lead into the creation of an item are randomised, because in the real game they would be connected to generated civilizations – that don’t exist in the graphics creation program! So every “leadership = random.choice([‘Monarchy’,’Theocracy’,’Representation’,’Stratocracy’])” had to be corrected to “leadership = civ.leadership” for the appropriate civilization, and so forth across every variable (policies, aesthetic styles, home terrain, names of settlements, etc etc etc) that might feed into every possible generated item. This wasn’t particularly cognitively demanding but did take a little while – making the graphics separately and importing them in is still a hundred times faster, even with this tiresome final step, but this did take a little while to fully implement. Nevertheless, with this done, you could then look at any of the items on sale in a shop, and – drumroll! – get a lovely generated image and a little description to go with them. Here I am browsing through a general store:
The next step was to restructure the inventory. When I began working on 0.9 the inventory looked like this…
…and that was fine, but now I had all the items generating, it was immediately clear that some of these categories were going to become absolutely swamped with stuff (i.e. the trade goods category) while others would be relatively lacking, and that this would both generate an interface issue (and an aesthetic one) but would also make it trickier to locate the exact items you want to do something with, at a proper speed. As such, five new categories in the inventory have now been added – “weapons” (melee, ranged, etc), “ammunition” (musket balls, gunpowder, arrows, bolts, etc), “games” (board games, but also more later on), “tools” (pickaxes, shovels, watches, etc), and “survival” (the three basic resources for travelling, i.e. water, food, and supplies), each with an appropriate new icon and the rest of the sequence appropriately re-ordered. (“Keys”, “Notes”, “Scrolls” and “Tablets” do not presently exist, but will be popping up in the future). This then yields this:
With the inventory now updated the next step, of course, was to create the interface for buying / selling / trading. This is a pretty crucial part of the game so I took some time over this. The first thing was to figure out what I could fit into the screen’s size, and although it would have been lovely to fit in a) images of the items you’re thinking of buying/selling, b) images of the currency you’ll be using, c) a list of the items you’ll be buying/selling and how much it’s going to cost you, and d) any comments or questions from the person you are buying/selling from/to, it quickly became clear only three of these could fit and something would have to go. As such, the left side of the screen shows you the item you’re discussing (a) then on the right-hand side you have a list of what you are currently trading (c) and words from the person you’re haggling with (d). You can then look at the various things the person has for sale and select the ones you want, and on the right-hand side the price will update and show you a list of all the things you presently intend to buy. This looks like this in a specialist store…
…and something like this in a store with multiple item categories, e.g. a “General” store, an “Antiques” store, or a “Curiosities” store:
You then select what you want to buy by pressing enter on the items you want, and then when you press enter you are given the option of adding them into your inventory or shipping them to any other nation you are thus far aware of.
Now then, what about trading and selling? Given the lack of fantasy elements and more generally the tone of the game, we’re not going for the sort of in-game inventory where you can hold as much as you want (a la Dark Souls) nor the sort of in-game inventory where your carrying capacity is limited by an essentially arbitrary number of things (a la Dungeon Crawl Stone Soup), nor something where carrying capacity is a matter of the size of your items and organizing them appropriately (a la Resident Evil 4). After a lot of consideration and trying to combine both the interest in some of the detailed trading mechanics I have in mind here, and a degree of realism, and some long-term strategic choices it should be interesting for the player to make, I’ve settled on a two-part inventory system. Half of the inventory is the normal inventory as above, where your character carries items; all items now have a weight value, and over that weight value it takes you twice as long to move around (in-game time, not player experienced time) or three times if you really overload yourself. All items now show how much they weigh. In turn, there is a second value now, size. This value does not relate to how much you can carry, but does relate to how much you can ship to other nations to trade. You can therefore carry items yourself to other places to trade, but the more efficient method is to ship them ahead of you – but this requires advance planning of where you’ll be going next. Each nation has a limited amount of warehouse space it automatically gives you, and this space can be increased by purchasing more room in that state. Then, when you travel somewhere else, you can sell the items you have in your inventory and the items you shipped there. In this regard I was partly inspired by the rise of letters of credit in the European banking system during the Reformation (for a fantastic history of this see the novel “Q”) and also partly by things like the Hawala system, which in a very different way “abstracts” out what is being moved around and traded. I think this system both reaches a high level of realism re: what the player can carry, but also allows for major and distinctive trading mechanics, and encourages strategic thinking re: planning out your future moves, where you’ll need money, where you’ll be able to get money, and so forth.
Aside from this, various other things have also now happened. You can now find currency exchanges in market areas…
…and also when you enter and leave cities, something new now happens! This menu appears…
…and you have the option to just go on (assuming you can afford it, if the city has an entry or district cost), back out, exchange currencies at the border of the city, buy supplies, boost how much storage capacity you have in that city (infinite in your home city), or (later) you’ll be able to fast-travel to some other land location, like taking a ship to another location but instead with a horse, carriage, etc.
(You can see a tiny bit of final polish is needed here, but you get the idea)
Lastly, going back to shops, there is now a complex calculation for how much you can sell things for. Selling something in its home nation will always yield a lower price than it was bought for; nations with protectionist or planned economy policies will give you more money, but nations with free trade or mercantile policies will be far less impressed. In other nations, meanwhile, you are guaranteed as a basis a 15% boost in the sale price of anything you sell, and then many other factors come into play. For example, nations with policies clearly related to the item you’re selling will give you more money, so if you’re selling a history book to a trader from a nation with the “Antiquarian” intellectual policy, then naturally they’ll pay you far more. There are opposites to this, however, so philosophy and history books do not do well in states with the “Populism” cultural policy (it’s almost as if there’s a comment about the real world here). Some of these are complex, for example wine will sell better in a “Monastic” nation but only so long as the wine is of medium or high quality, but not low quality (since the monks have high tastes); while spirits will sell extra well in a “Conscription” nation but only at low and medium quality (since the conscripts can’t afford the highest quality drinks). There are also calculations whereby some nations will be particularly fond of goods from other nations regardless of what is being sold, and that boosts all prices – while other nations have the opposite, and dislike goods from particular places. It’s a complex set of calculations, and I haven’t listed all the factors here, but basically I wanted to ensure that a) it was logical to the player where things would fetch a high price, but also b) that this calculation was something the player would come to uncover in a given world, organically developing a sense of what the particularly good trade routes are.
Oh, and appropriate armour and jewellery and so forth now also appear on NPCs! There are of course many variables that determine what sorts of things they’ll be wearing, and especially what might be on a necklace or a ring that person is wearing, but this nicely adds to the variety of the game world – and, of course, now guards and soldiers are no longer walking around witout any clothes on, which I think we can all agree is a massive improvement.
Right, I think that’s everything for now! This is such an exciting update and I’m really pleased to finally be able to share it. There might be one last update before the actual release, but if not, come back on DECEMBER 31ST for the 0.9 release, and all the procedurally generated items you could ever want!