Monday, July 5, 2010

"Sorry, We're Out"

This last weekend I spent most of my free time working out an algorithm for my equipment table, intended to make things a little more interesting. Principally, I mean to have it calculated automatically whether or not a particular object will be available for sale, based upon the actual prevalence of that object in the area where the market is to be found. What this means is not a flat random result for every object - certain things will always be found in certain areas, without fail. Beer, for example, will always appear on the list if one is in Germany, or indeed most anywhere in Europe. Wine, cattle, cereals, leather goods and a wide variety of other things will also be constants on the list. Anything that has worldwide distribution, in short.

Beer isn’t worldwide, so if I’ve done the table right, the further away from northern Europe one gets, the more likely it would be to start appearing on the list as not available. If all goes well, at any given time about half the number of obscure things on the list should wind up being unavailable a lot of the time ... and some things being virtually ALWAYS unavailable ... unless one moves into the sphere of that item’s production.

For example, a lot of the gems which I listed two posts ago. Although they are fairly common, and cheap, many of them are highly localized in their availability and as such I woudn’t expect to see them on my equipment list. Other things that I expect to see drop off for my European based characters includes fur clothing, foodstuffs like spices or various distilled liquors, plus many of those things to be found at the apothecary’s and so on.

I am looking forward to what this will mean when it comes to player expectations. The game is usually played so that wherever one might happen to be, there’s no trouble buying a silver mirror or a bit of wolvesbane. What happens when you need something desperately from the local market town and it just isn’t there?

And worse, there’s no definite expectation a shopclerk can have of when the stuff may arrive next - unlike even the late 20th century, there’s little or no means to determine if foreign goods are going to arrive. Anything produced locally will always, pretty much 100%, be available for purchase, but stuff that is shipped in will be there ... well, when its there.

I do expect that the equipment table for any region can be generated again once per week ... which potentially different results. However, in the case of things that might have a less than 10% chance of being there, another week probably won’t help. Players may have to wait months for some items, mostly because some things in my world are painfully rare.

A particular example is a metal prosthetic hand which one can purchase to replace the appendage they’ve lost - that matches the function of a real hand by virtue of magic ... magic that is maintained by the monthly use of a expensive substance called ‘faerie oil.’ This is not a substance that is famously available.

Which, off hand, gives them a reason to keep agents or trustworthy henchmen in a particular town. “Wait here, Schmidt, and when it arrives, buy it!” I can see players keeping five or ten agents in various local trading towns throughout a given region, in the hopes that one of them will get lucky where it comes to very specialized goods - such as medicines or certain addictive substances - such as opium.

It does also suggest that a player should determine for themselves where certain substances come from - such as faerie oil or opium - in order to be more certain to get a hold of them, if waiting fails miserably. I have already come across a couple of items which have a less than 0.8% chance of turning up in Luneburg, the location of one of my two online parties. That would mean an average wait of just less than two years.

It occurs to me that within this new feature there must be some means of creating a random treasure table that works. As I’ve said in the past, the thing I hate about treasure tables is that they are functionally dependent on handing out gold - this being the only practical wealth for both party and DM. It is all well and good to talk about creating treasure that is more complicated, such as beer barrels, carved furniture and sheep ... but a problem arises in determining how many of these things to hand out, and how much they’re worth when the party attempts to sell them in the local town.

And there is a problem in WHAT to give. You can’t have twelve treasures in a row that all include 20 complete cowhides and forty silver spoons. If you produce a random table that hands out random items, you’re going to get repeats of things and those repeats are going to be treated by the party as a joke. “Hey, I’ve got fifteen silver plates with the image of the king - how many have you got?”

Trust me ... if you’re going to create a table with non-gold and non-gem items, you need to have hundreds of items, or you’re wasting your time. Go big or go home.

There may be a solution to all three problems - a) that the random generator decides what to give; b) that availability may lead to a determination of ‘stock’ that would solve the how-much-to-give-out problem; and c) that bringing objects into a town that are not available, versus those that are available, might give a clue as to how much a party gets when selling those items off.

In short, for the last, something rare and comparatively low cost might bring in a higher gain than something expensive, yet common. What an interesting effect that might have when it comes time to divide up the treasure after a campaign?


Adam Thornton said...

It does sound like you're about to go down the perhaps-obvious path, which is:

1) you know the amount of raw materials available in your world

2) you have a pretty good idea of what kind of labor any given item will require to produce, and the rate at which raw materials can be extracted from the environment

3) you can generate plausible-sounding color descriptions for items--e.g. silver plates with the King's Head on them are six times as likely as said plates with the Archbishop on them. If you're willing to put in the time for a random descriptor table, then you can go ahead and get this generated. Note that this is only needed for fairly uncommon things in the first place. That is, we can probably agree that there are indeed items that are interchangeable at the level of granularity you care about: every day, the town produces 600 loaves of bread. Or perhaps 100 loaves of pumpernickel, 400 loaves of just-plain-bread, and 100 loaves of rye, but you don't really (perhaps) need to account for them individually by baker, precise weight, and precise variety.

4) set up a giant "production run" where you generate a decade's worth of inventory based on these random tables. Store each item in a database with a unique ID, as well as its date of manufacture.

5) come up with a consumption rate: if an item of type X typically lasts ten years, then on any given day it's got something like a one in seven thousand chance of breaking. Don't forget that breakage is transformation and that the pieces may be recyclable into raw materials.

6) figure out what moves to where and what gets consumed in the process, by assigning items probabilities of moving along trade routes

7) run the simulation for as long as you have time/patience/disk space

And then, when your players camp out in Warsaw on Day 4475 of the World's History Since Inception, why then, you *know* what items come to the city's merchants on that day and all days following. You'll also want to generate a Starting Inventory for Day Zero of more durable goods to reflect that the world didn't really begin from scratch on Day Zero.

I mean, sure, the vast, vast majority of the things you generate will never come into play, but, hey, computer time and disk space are cheap, and it's not as if you don't have much of the input data already generated. Think of it as individual-item RFID tagging in your simulated world.


Golgotha Kinslayer said...

The complications, for me at least, in creating a by-location equipment list that shows what items are actually available is in making something that may seem random, but actually is not. The items available in a given shop depend on local demand, how much of that local demand has already been met, distant suppliers, complications in moving those goods to this spot, et cetera. They can be reduced to a percentage chance (as Hackmaster does), but are really based on people in the game world buying, selling, and moving product. Where I get stuck is in creating something that still has that 'maybe it is, maybe it ain't' effect (and will change over time in a reasonable fashion) that accounts for such non-random NPC and pc actions.

Alexis said...

Hah, Adam.

I have no plans to do any of that. Ever. But it was very funny.

Alexis said...

Admittedly, if anyone wants to design a game that incorporates point (6), I have the data streams you'll need and it could be a seller.

Alexis said...


The making something that seems random but actually is not is the thrust of the post.

FYI, my economic system is not actually based on demand (which is presumed to be static in a pre-industrial world), but upon supply. This is simply because in creating the system, production was a known variable, while demand was - by virtue of the world being in my head - unknowable. Therefore, “the items available in a given shop” do not depend upon local demand, but upon the shop’s distance from supply. The greater the distance, the less likely that the supply will be available, and therefore the item can’t be had by the players.

This gets me out of the need to create a virtual model, such as Adam suggests above, and also gets me out of accounting for ‘NPC actions.’ I need only generate a likely percentage which a die is then rolled against. At some point, the player moves close enough to the supply that the percentage is always 100%. Alternately, as the player moves away from the supply, the percentage steadily drops - usually by very few percentage points per 20 mile distance.

This works because the number of suppliers of all goods (more than 7,000 suppliers producing 270 goods) is so pervasive in the system I’ve already created. And as the system is already in place, and already working, the introduction of the availability I suggest in this post is merely one more calculation which can be made thoroughly automatic when I generate a list for a particular market. The principal issue, for me, is that I have to generate a new list once per week of game time.

However, I do have it so that it takes me less than 60 seconds to generate a list, so this isn’t an enormous burden.

Steve Lalanne said...

I see a potential bookkeeping problem: let's say a PC wants to buy a mirror in a certain community. The DM rolls on the table and the result is "not in stock". Presumably, the DM would make a note of this in case the same PC or another character also shops for a mirror in the same place within a certain time period (i.e., before the new table is generated). Because the DM can't remember everything, he'd probably want to make a note of the availability of mirrors in that locale.

One solution would be to have the table indicate whether items are actually available (i.e., their actual stock level, expressed as a quantity), in addition to showing chance of availability. This could be an additional column labelled quantity where the DM notes actual availability as shown by the roll (it'd be blank until a roll is made). This could be a single value for the region, or it could be broken down further (e.g., "Milan: 3; Perugia: 0").

Alexis said...

The system is designed not to produce a die roll, but to actually incorporate the 'in stock' occurrence automatically when the table is generated. You must understand that my equipment tables are all generated as I need them, and that I generate a different table for different market cities. Thus, I don't have an output for Milan vs. Perugia likelihood, but two entirely different generated tables for Milan and Perugia, and for the other estimated 1300 trading cities in my world (the number keeps going up as I add new cities to the system).