User Tools

Site Tools


user:draugthewhopper:treasurelevels

Treasure Levels

It seems to me that it would be useful to have more control over the types of items created by randomitem/treasurelists, whether in monster loot tables, random treasure, or shops.

Abstract:

Allow maps to pass “level” info through several stages.

Example:

We arbitrarily give a magic shop a “level” of 5. This may already affect some shop attributes, but we plan on expanding it as below.

The shop tiles “inherit” this “level 5”, and so when they generate random sellables, they pass this info on to their treasurelist. If you want some tiles to have a level that does not match the shop (e.g., an exclusive or expensive area), then you can override those tiles by changing the “level” value in their arch. Ideally, you could also specify their level as an offset from their parent map (e.g.: +1, +2, -3), instead of an absolute.

The treasurelist gets some secret sauce that lets you control what items get generated for a specific level. For example, the treasurelist says that for any spellscroll in a lvl 5 treasurelist, the scroll can be anywhere from level 1 to level 5. Or, it can be anywhere from level 1 to level {parent + 2}.

As a more complex option, perhaps the selection could be weighted, so a level 5 shop would generate lots of level 4 and 5 scrolls, a moderate number of 1 - 3, and a very few of level 6 and 7.

Abstract:

Spawn weapons and armor based on a level system.

Example:

Assume (somewhat arbitrarily) that armor has the following levels:

Cloth: 1 Leather: 3 Ring: 5 Chain: 8 Plate: 12

With adjustments of the shop tile item generation from the previous example, a level 8 shop could spawn plenty of Ring and Chain mails, a few Cloth and Leather armor, and occasionally a Plate mail.

However, careful design of the mechanism could allow for “special” armors, such as saying a 'Cloth Armor +2' is actually considered level 3 (base level 1, plus 2), and thus is a rarity for a level 1 shop, but commonplace in a level 3 shop.

Implementation:

When a treasurelist is evaluated with $level info present, assume some amount of default spread. Typically this will be {$level -1,$level,$level +1}.

Perform a random check to see if we should generate an item outside this range (15% chance level is as low as 1, 5% chance level is as high as +3)

  • If generating an item at lower level, pick a random number between $level and 1.
  • If generating an item at a higher level, pick between {$level +2,$level +3}
  • If generating an item within the default range, just pick randomly between the available values.

Once a level is selected (e.g., 4), build a list of items that can be at that level: {Ringmail -1,Leatherarmor +1, Clotharmor +3}

Pick one from the list, but strongly weight it toward items that don't require a strong modifier (the -1 and +1 items should be much more frequent than the +3)

user/draugthewhopper/treasurelevels.txt · Last modified: 2020/08/31 16:20 by draugthewhopper