Jump to content
  • entries
  • comments
  • views

Junky Treasure

Sign in to follow this  


Thinking about treasure lately. When I set out with the SENG engine (the game engine behind Temple of the Abyssal Winds), I was just going to make up any treasure you found by hand. So, in the quest where you defeat the orcs, something like a 10000 gold reward is needed. I would look through the available items, think quizzically for a moment, and say, "Ah yes, how about a Greataxe +10, 2 healing potions, and 800 gold. Sounds about right!"

Well, this turned out to be tremendously boring once I had done it twice. So I introduced an algorithm. In the game file, chest X has 10000 gold worth of treasure, and the game would generate the treasure automatically. Much less boring.

My current algorithm is to generate items randomly (less than the amount of treasure), until we get somewhere between 50% and 75% of the desired total amount, and give the rest as coins. Here's an example:


In this case, 10000 gold was desired, and we ended up with:

  • A Greatsword +5, worth 2350.
  • A Masterwork Greatsword, worth 350.
  • A Quarterstaff +5, worth 2300.
  • A scroll of Ice Storm, with 800.
  • And 4200 in gold.

    So, that works OK. And I'm definitely not going back to the "by hand" method! But, this method has a tendency to generate a bunch of mediocre to poor items. It would certainly be more exciting if one good item were to turn up more often (at the expense of all the blah items). It would be super-exciting if, once in awhile, a great item (worth more than 10000 gold, even) showed up.

    Anyone have any experience with RPG treasure generation that they liked? Other thoughts?
Sign in to follow this  


Recommended Comments

sounds like you might be interested in using loot tables, with added weights to each loot item.

Share this comment

Link to comment

sounds like you might be interested in using loot tables, with added weights to each loot item.

Sounds interesting... do you have a pointer with more details?




Share this comment

Link to comment
Well i don't have a link handy on the topic that i can vouch for, but something like "implementing loot tables" should give you some good stuff. The basic idea is that for every chest and/or enemy type(or even area encounters), you have a table telling it what items can drop, and how rare that should happen. Your idea isn't bad, but it likely requires an additional parameter telling the rng system how likely it is to spawn certain items. With loot tables you have a bit more control over when/where certain items are likely to show up. It really depends on which method is more likely to suit your needs.

Share this comment

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!