My Treasure Generator is FINISHED!!!

GEC: Discuss gaming, computers and electronics and venture into the bizarre world of STGODs.

Moderator: Thanas

Post Reply
User avatar
Korto
Jedi Master
Posts: 1196
Joined: 2007-12-19 07:31am
Location: Newcastle, Aus

My Treasure Generator is FINISHED!!!

Post by Korto »

After months of working on it (although, to be honest, a good bit of that time was spent avoiding working on it), after four solid 10 to 12 hour days :banghead: of debugging the bloody thing, it's finished! It lives! It lives! Ah hah hah hah hah hah hah hah hah hah hah hah hah hah!!!!!!!!

Um, yes, excuse me there, I seem to have gone a little, umm. Well, never mind.

What I now have is a treasure generator that you put in the amount of money total you want, and then it randomly determines what the treasure is made up of, using weighted probabilities for different items as befits the world and the kind of treasure source (hoard, cache, noble estate, the Lord's treasury, a house, someone's pocket, etc.

For instance, a 2000p (note - the "dollar" of my world is the silver penny. All values are listed in pence) cache may look like this
Jewellery
1 Scarab, made of Gold. worth 170.65p; Quality 75%; 0.12cn.
1 Brooch, made of Silver. worth 167.17p; Quality 50%; 3.48cn.
1 Bracelet, made of Silver. worth 121.9p; Quality 75%; 2.18cn.
1 Belt, made of Bronze, Hair. worth 91.42p; Quality 250%; 73.61cn.
1 Bangle, made of Silver. worth 80.45p; Quality 250%; 0.72cn.
1 Coif, made of Platinum, Feathers, Steel Stone, Turquoise, Beads. worth 58.51p; Quality 250%; 0.43cn.
1 Pair of Bracers, made of Tin. worth 25.6p; Quality 50%; 26.66cn.
Jewellery total value 715.7p, encumbrance 107cn

Art Works
Armeenie Painting about Children; worth 44p, Quality 200%, 20cn
Dwarven Lace about Hunt; worth 190p, Quality 100%, 5cn
Armeenie Leatherwork about Bountyhunter; worth 25p, Quality 250%, 10cn
Swamper Scrimshaw about Children; worth 10p, Quality 100%, 10cn
Swamper Embroidary about Geometric/Philosophical; worth 34p, Quality 200%, 10cn
Elven Lace about Maiden; worth 8p, Quality 20%, 5cn
Art Works total value 311p, total encumbrance 60cn

Craft Goods
6 Bronze signet ring worth 10p each, total 1.8cn
1 Large china bowl worth 7.9p each, total 3.92cn
3 Quality Large china bowl worth 31.45p each, total 11.76cn
1 Quality China pitcher worth 42.38p each, total 14.75cn
Craft Goods total value 204.63p, total encumbrance 33

Magical Items
Half Mask, power Inconsequential, Temporary, origin Dwarf, focus Mental, major purpose Defense; Worth 50.5p
Power Inconsequential (1), exhausts: 15, Passive, latency: Turn, purpose Miscellaneous.


Coins and Gems
7 Bits (worth .07p, .22cn)
5 Farthings (worth .5p, 1.56cn)
2 Pennies (worth 2p, .06cn)
1 Medium Average Garnet, worth 700p, .05cn
195 Tiny Badly Flawed Moonstones, worth 15.6p, .02cn
Coins and Gems total value 718.17p, encumbrance 1.94cn
While some poor peasant you mugged (god only knows why. Everyone knows peasant's don't have anything worth stealing. That's why they're peasants!
Jewellery
1 Locket, made of Tin. worth 0.21p; Quality 10%; 0.3cn.
Jewellery total value .21p, encumbrance .3cn

Craft Goods
1 Torch worth .01p each, total 28.9cn
2 Foot of iron wire worth .02p each, total 1cn
1 Quill pens worth .02p each, total .4cn
5 Sling pellet worth .02p each, total 1.05cn
Craft Goods total value .14p, total encumbrance 31

Coins and Gems
1 Bits (worth .01p, .03cn)
Coins and Gems total value .01p, encumbrance .03cn
It can display in "Hardcore" format, where it shows everything (which is what you see here), "Softcore" (aka Players) format, which bunches items, glosses over, and hides values, "Appraisal" format, where is automatically does an appraisal check on everything, and puts on the price the player's think it's worth, and "Looting" format, where it is told the maximum amount of shit they can carry, and it does Looting rolls to see how well the PCs grab all the best stuff (important detail for the Dragon Hoard below...)

It can understand different regions (although it only changes the coins in use. I thought briefly about making it change all the other things, livestock, raw materials, craft items, and decided "Bugger that for a game of soldiers"), and as I've put as much as possible in the database (a standard Access database), it's relatively easy to modify!

It saves, it reloads, and it tut-tuts you if you don't give it all the information it's after.


And finally the major dragon hoard worth 1,000,000p :shock: in player's view may look something like this...
Hundreds of pieces of peasant jewellery
Scores of pieces of middle-class jewellery
Scores of pieces of noble jewellery

Halfling Stained Glass about Love
Scores of pieces of art weighing zounds of pounds

A few Cords of Oak
A single Cord of Ash
Dozens of Medium Furs of Fox
Dozens of Medium Furs of Raccoon
Dozens of Medium Furs of Otter
A few Large Furs of Seal
A few Large Furs of TreeCat
A few Large Furs of Wolf
A few Large Pelts of White Wolf
Hundreds of Pounds of Whale Bone
A single Barrel of Wood Tar
A few Kegs of Tallow
A single Keg of Lard
Scores of Bricks of Salt
A single Slab of Beef
A single Barrel of Salted Pork
A single Barrel of Salted Fish
Dozens of Ingots of Lead
Dozens of Ingots of Iron
Dozens of Ingots of Tool Bronze
Scores of Ingots of Copper
A few Kegs of Honey
A few Kegs of Wax
A handful of Wheels of Gruyere Cheese
A single Barrel, 4 Kegs, 2 Quarts of Feta Cheese
A few Barrels of Oranges
A few Kegs of Pickled Oranges
A few Barrels of Fresh Fruit
A few Kegs of Candied Fruit
Hundreds of pounds of assorted materials

A single Two-man leather tent
A few Med. wood & leather chest
A single Small wood & leather chest
A single Med. wood & iron chest
A few Twelve-foot wooden ladder
A single Windlass
A few Rowboat
A single Water Balance
A single Church bell
A single Sitar
A single Large iron kettle
A few Woolen sheets
A single Linen bed curtains
A few Medium wooden table
A single Quality Wooden chair
A few Fine carpet
A single Quality Padlock
A handful of Brandy keg
A few Beer barrel
A single Quality Beer barrel
A few Ale barrel
A few Quality Ale barrel
A single Quality Ale barrel
A single Bitter barrel
A single Quality Vinegar barrel
Hundreds of pounds of assorted goods

Dozens of Bits
A few Farthings
Dozens of Pennies
Dozens of Shillings
Dozens of Soveriegns
A few Crowns
A few Medium Jacinths
A single Medium Sapphire
A single Medium Pearl
A single Large Ruby
A few Medium Opals
A single Large Jargoon
A few Medium Rubys
A few Medium Sapphires
Scores of Tiny Aquamarines
Dozens of Tiny Rubys
A few Very Large Jacinths
A few Large Opals
A single Medium Pearl
A few Medium Opals
A single Small Ruby
A few Very Large Sapphires
A single Large Peridot
A single Large Agate
A few Medium Sapphires
OK, I admit I only got the computer to do that to see if it could.

You only got saved from seeing the hardcore of the hoard by the 60000 character limit. :D
“I am the King of Rome, and above grammar”
Sigismund, Holy Roman Emperor
User avatar
LaCroix
Sith Acolyte
Posts: 5196
Joined: 2004-12-21 12:14pm
Location: Sopron District, Hungary, Europe, Terra

Re: My Treasure Generator is FINISHED!!!

Post by LaCroix »

Sounds nice - what kind of construct are you using? Are you iterating over a full list for every instance or did you break it down into several lists for treasure sizes?
A minute's thought suggests that the very idea of this is stupid. A more detailed examination raises the possibility that it might be an answer to the question "how could the Germans win the war after the US gets involved?" - Captain Seafort, in a thread proposing a 1942 'D-Day' in Quiberon Bay

I do archery skeet. With a Trebuchet.
User avatar
Korto
Jedi Master
Posts: 1196
Joined: 2007-12-19 07:31am
Location: Newcastle, Aus

Re: My Treasure Generator is FINISHED!!!

Post by Korto »

Treasure size doesn't affect it, it's the same for 20p as 20,000,000 (except for magical items, the more money, the proportionally more magic items), picking from the same lists. Although it does affect the value of individual pieces, for example the algorithm for working out the value of a piece of art starts by rolling 1d(amount of money left in art budget) to find the commission, so the average commission for a piece is directly affected by the amount of money floating around. The better the commission, the more skilled the artist and the higher-quality the piece (on average. Assuming the computer dice don't betray you). It also reduces the sheer bulk of stuff.

There are seperate lists for Coins & Gems, Jewellery, Raw Materials, etc (basically the groups shown), and of those, Raw Materials, Craft Items, and Livestock have multiple probability and average number appearing lists, one each for each situation; hoard, cache, estate, farm, house, shop, merchant caravan, commoner, noble, and pocket.
It also checks maximum sizes, so you don't carry a barrel of beer in your pocket.

Incidentally, there's well over 500 different types of craft items in the craft list.
“I am the King of Rome, and above grammar”
Sigismund, Holy Roman Emperor
User avatar
LaCroix
Sith Acolyte
Posts: 5196
Joined: 2004-12-21 12:14pm
Location: Sopron District, Hungary, Europe, Terra

Re: My Treasure Generator is FINISHED!!!

Post by LaCroix »

Good thinking - I like the concept. What game is it for?
A minute's thought suggests that the very idea of this is stupid. A more detailed examination raises the possibility that it might be an answer to the question "how could the Germans win the war after the US gets involved?" - Captain Seafort, in a thread proposing a 1942 'D-Day' in Quiberon Bay

I do archery skeet. With a Trebuchet.
User avatar
Korto
Jedi Master
Posts: 1196
Joined: 2007-12-19 07:31am
Location: Newcastle, Aus

Re: My Treasure Generator is FINISHED!!!

Post by Korto »

Well, I made it with my Classic D&D game in mind, but it should be usable for any game that the items make sense for. A gold necklace is a gold necklace, after all. About the only thing in there that's games-rules dependant are the Looting and Appraisal skill checks (although, considering I modified the skill rules away from D&D, it doesn't even fit those rules).
It'll be easy to adjust the way the dice are rolled, however, to fit any system.
“I am the King of Rome, and above grammar”
Sigismund, Holy Roman Emperor
User avatar
Skgoa
Jedi Master
Posts: 1389
Joined: 2007-08-02 01:39pm
Location: Dresden, valley of the clueless

Re: My Treasure Generator is FINISHED!!!

Post by Skgoa »

I only skimmed the OP, you basicly implemented the Knapsack problem? What strategy are you using to find and choose your solution?
http://www.politicalcompass.org/test
Economic Left/Right: -7.12
Social Libertarian/Authoritarian: -7.74

This is pre-WWII. You can sort of tell from the sketch style, from thee way it refers to Japan (Japan in the 1950s was still rebuilding from WWII), the spelling of Tokyo, lots of details. Nothing obvious... except that the upper right hand corner of the page reads "November 1931." --- Simon_Jester
User avatar
Korto
Jedi Master
Posts: 1196
Joined: 2007-12-19 07:31am
Location: Newcastle, Aus

Re: My Treasure Generator is FINISHED!!!

Post by Korto »

(Had to google "Knapsack Problem")

OK, well the first thing is that I'm using the D&D concept of "Encumbrance", which is a combining of weight and bulk into a number representing inconvenience. The idea is a big bulky beanbag can be just as difficult to carry as a 20kg barbell. This works as a bit of a cheat, really, since I no longer have to worry about specific shapes of the items. In effect, all items have turned into a liquid who's encumbrance can pour in and fill containers neatly.

That being said, the program does not really solve the problem, instead it simulates someone trying to solve the problem while under time pressure. You tell it the maximum encumbrance allowed, and the Looting skill of the person picking the items.

It then picks a random item from the treasure list, works out its worth (money value divided by encumbrance), and repeats this process a number of times depending upon the person's looting skill; at the end of this, it saves the best item, marks off the amount of encumbrance used up, and does it again (with a refreshed number of picks). It keeps this process up until it fails to find an item that can fit within the encumbrance limit within the number of picks given by the Looting skill.
This can mean that things are missed, good treasures go unnoticed, but that sort of thing happens. A beautiful ruby, unnoticed down the back of a couch. Luxury furs buried in rabbit pelts. Life's a bitch sometimes.

The number of picks given by looting - Well, I use 3d6 for skill checks, so the program does too, and people normally have skills ranging from 10 to 12, although may go as high as 14 (theoretically it can go well over 20, in practice, no)
They get a base number equal to skill/3 (round off), and then need to roll their skill or under on 3d6* for each additional pick. So someone with a skill of 10 would likely average 3.5 picks a turn. Someone with a skill of 12 would average 7 picks a turn, a 14 would average 15.

*Someone with a skill 18+ can still fail due to Overrun Dicetm
“I am the King of Rome, and above grammar”
Sigismund, Holy Roman Emperor
User avatar
Spoonist
Jedi Council Member
Posts: 2405
Joined: 2002-09-20 11:15am

Re: My Treasure Generator is FINISHED!!!

Post by Spoonist »

That is really great. I love such details when I'm playing. Seeing the lists I'm boggled by the amount of effort you must have put into it. Did you get help?

Which are the categories/lists and how do you control the distribution between them? As in if GM wants to make art a bigger/smaller part of the trove.
User avatar
Korto
Jedi Master
Posts: 1196
Joined: 2007-12-19 07:31am
Location: Newcastle, Aus

Re: My Treasure Generator is FINISHED!!!

Post by Korto »

OK, there are seven categories: Coins & Gems, Jewellery, Raw Materials, Livestock, Craft Goods, Art Works, and finally Magic Items. Each category has a chance of being present, and a share of the wealth if it is present. To lay this out, for the standard treasure hoard:
Category......................Chance(%)..................."Shares of the Wealth"
Coins & Gems.............90...................................1d20e1* (av 13.8 )
Jewellery......................90..................................1d20e1 (av 13.8 )
Raw Materials..............60...................................1d20e-2 (av 5.5 )
Livestock.......................0.....................................1d20 (av 10.5, except it has 0% chance anyway)
Carft Goods...................80...................................1d20 (av 10.5 )
Art Works.......................60...................................1d20 (av 10.5 )
Magic Items...................30**................................1d20e-1 (av 7.2 )

Once all shares are rolled, money is allocated to each category depending upon its shares.
At the moment, the % chances are displayed for the DM to modify on the fly, to make something more/less likely or non-existent. I could display the dice-roll for the shares for that to be modified too, but at the moment I haven't (why not, I'm not sure. I'll probably make the modification today)
All this data, and more besides, is all in the database files which can be easily changed. I tried to avoid hard-coding.

No, I didn't have any help, although over the last few days I may have wondered about psychiatric.

You can get an immense wealth of variation just by having seperate lists that multiply off each other. For instance, in the Art database, there's the item itself (29 different choices), and which culture made it (7 different choices) as an absolute minimum, so 29 x 7. Most items however also have a Subject (85 different choices), and the subject could call up other lists (eg Faith (8), Geographical Area (21)). Sculptures also roll on the Material list (6 different choices)
I don't actually know how many different artworks there are. I could work it out, but not now. It's probably scary. And I just thought of adding a "Painting Medium" list, water colour, oil, and any others. The cool thing is, all I've got to do would be to add it to the database, and the program will automatically use it, no reprogramming required.
I will say though, that the "Multiplying Lists" effect is mainly in the Art Generator, a reasonable look-in in the Jewellery generator (Item Type (44) x Material(s) Used (106) ), and used for creating gems (Type (51) x Size (5) x Quality (5) ).
BLOODY HELL! I just realised I can use the Origin and Subject lists (and any other I feel fit) in the jewellery as well, no reprogramming required. I already set it up to do so when I made it able to roll Faith for holy symbols, and Subject for charms (you know, the charms for charm bracelets). It's all just database driven.


"1d20e1, 1d20e-2" :?
* You know how wussy AD&D players will roll "4d6 pick the best" for their stats? That, in this format, would be described as "3d6e1", where they roll 3 dice, and then an extra 1. Now, if they were rolling "4d6, pick the worst 3", that would be "3d6e-1". So 1d20e1 means "Roll 2d20, pick the highest 1" and 1d20e-2 means "Roll 3d20, pick the lowest one".

** In the magic generator, the first thing it does is roll up how many items there are, which depends on the amount of money it has available. It can roll 0 items, in which case all money is shifted to Coins & Gems and it moves on. So, it's a 30% chance to have a chance of magical items. For a total 2000p hoard, items seemed to come up <> 15% of the time.
“I am the King of Rome, and above grammar”
Sigismund, Holy Roman Emperor
User avatar
Korto
Jedi Master
Posts: 1196
Joined: 2007-12-19 07:31am
Location: Newcastle, Aus

Re: My Treasure Generator is FINISHED!!!

Post by Korto »

Worked it out. There's 27937 different art treasures.
If you want to take different workmanship qualities into account (which I personally don't), 1229228.
“I am the King of Rome, and above grammar”
Sigismund, Holy Roman Emperor
User avatar
Feil
Jedi Council Member
Posts: 1944
Joined: 2006-05-17 05:05pm
Location: Illinois, USA

Re: My Treasure Generator is FINISHED!!!

Post by Feil »

Looks pretty cool. I really like how you have classified things by their source, so you don't end up with peasants carrying priceless artwork and warlords hefting 60 pounds of rice in their backpacks.

Suggestions:

Rescale your currency to get rid of those decimal places. If 0.01p is the base currency unit, list prices in x, where there are 100x to a p.

Use only 2 significant figures. Your prices represent estimates, anyway.

Use numbers for everything, not "a few" or "dozens" or "scores". If a player wants to make a pair of earrings out of Very Large Sapphires, and another player wants to put three Very Large Sapphires on his sword, your party needs to know whether "a few" is 2, 3, 4, 5...

Compress and total the value, weight, and encumbrance of similar items, but keep the lists available to look through. People aren't going to want to take down twenty lines of treasure when they could just write "$45000 worth of coins and gems, weighing 45 pounds (20 encumbrance)" or "8800 dollars worth of food and drink, weighing 3400 pounds (15000 encumbrance)." However, being able to look through the horde when you get it and see what kinds of pretties they can pull out of it for personal use, rather than sale, is a really cool feature that you shouldn't take away.
User avatar
Spoonist
Jedi Council Member
Posts: 2405
Joined: 2002-09-20 11:15am

Re: My Treasure Generator is FINISHED!!!

Post by Spoonist »

Feil wrote:Use numbers for everything, not "a few" or "dozens" or "scores". If a player wants to make a pair of earrings out of Very Large Sapphires, and another player wants to put three Very Large Sapphires on his sword, your party needs to know whether "a few" is 2, 3, 4, 5...

Compress and total the value, weight, and encumbrance of similar items, but keep the lists available to look through. People aren't going to want to take down twenty lines of treasure when they could just write "$45000 worth of coins and gems, weighing 45 pounds (20 encumbrance)" or "8800 dollars worth of food and drink, weighing 3400 pounds (15000 encumbrance)." However, being able to look through the horde when you get it and see what kinds of pretties they can pull out of it for personal use, rather than sale, is a really cool feature that you shouldn't take away.
Uhm, you are completely missing the genius here, there is a soft list and a hard list totally negating most of what you say above.
Also it looks at a hording skill that lets you either get the good stuff or the bad stuff negating the rest.
As for the value that i've snipped - it doesn't matter since its game world dependent. If he uses cents in decimals or not is completely irrelevant since it depends on GM fiat.
It can display in "Hardcore" format, where it shows everything (which is what you see here), "Softcore" (aka Players) format, which bunches items, glosses over, and hides values, "Appraisal" format, where is automatically does an appraisal check on everything, and puts on the price the player's think it's worth, and "Looting" format, where it is told the maximum amount of shit they can carry, and it does Looting rolls to see how well the PCs grab all the best stuff (important detail for the Dragon Hoard below...)
Post Reply