Magic Hoard App

Comments Off on Magic Hoard App

And here’s the version of the Magic Shop app that I promised last week for the newest edition:

Magic Hoard Windows App

Unlike last week’s app, this one is much simpler as items in the new edition are not ascribed actual prices. Instead, it’s mostly just a way to generate random results that include randomized special features.

What It Does

Select a treasure table.

Each table comes with a predefined chance for each special feature (e.g., at 25%, since there are four different special feature types, on average each item will generate one special feature, while at 100% it will always generate all four features). You can change the rate for a table by moving the slider (the rate is saved for the session, but not for when you close and reopen the app).

Click Add Item from Selected Table to randomly roll an item (plus possible special features). It’s added to the top of the list in the output box.

Click Sort List to sort all the items in the box alphabetically by item name.

Click Clear List to empty the list. Unless you click Clear List, switching between tables and special feature chances will not change anything about the already generated items in the list (e.g., you could generate three from table A and then one from table D, and all would be in the list).

Installing the App and Editing Modifiers

Extract everything in the .zip file to its own folder. Run the .exe file; it’s looking in its own folder for the .txt files.

As with the previous app, everything uses statistical weights to determine when it shows up. Read last week’s post for a description of how that works.

The files and their formats are:

  • AllItems: A list of every item (without special features), in the format [Treasure Table]|[Random Weight]|[Item Name]. If you add a new table name, you also have to add it to the TreasureTables file.
  • SpecialFeatures: A list of every possible special feature, in the format [Random Weight]|[Feature Table]|[Feature Name]|[Feature Description]. Unlike with AllItems, you can add a completely new table of features here and it will automatically added (e.g., you could add entries for a new Previous Owner table fully within the text file).
  • TreasureTables: This file purely saves the default special feature chances for each table, in the format [Treasure Table]|[Percentage Chance]. Percentage chance must be an integer between 0 and 100, and new tables added have to also have at least one entry in AllItems. This is where you change the default special feature values for good if you don’t like the defaults I picked out.

Known Limitations

In order to keep it as extensible as possible using just the text files, I didn’t include the “pick two properties” entry on the Property table, so it will never generate more than one Property special feature.

There’s a weird bug that I can’t quick track down such that sometimes, when you make a bunch of items with a high chance of special features, items with the same name will have exactly the same (or almost exactly the same) special features. I haven’t been able to generate it reliably, and if you get it, clearing the list, changing the percentage slider and generating a few items, then changing it back and clearing again seems to fix it for the session. Programming is hard, y’all.

Magic Shop App

1 Comment

PCs with ready cash plus visits to a large city equals attempts to stock up on magic items. I’m always too lazy to actually roll up the available items in a town, instead relying on asking, “what are you looking for?” and giving it a percentile chance. It’s expedient, but it doesn’t really amuse the players the way an actual list of shopping options would.

So the Magic Shop app does all the complicated rolling to create a list of randomized magic items, hopefully making my (and your) players much happier with their shopping trips!

Magic Shop Windows App

As with the last one, it’s only for Windows, and I don’t have plans to try to get it onto mobile (since it’s much easier to use pre-game). Also like the last one, it’s an .exe file that I solemnly promise isn’t a virus.

What It Does

Set the shop’s Available Funds (defaults to 50k gp) and the maximum price of any particular item in the shop (defaults to 8k gp).

Remove any item types you don’t want to be for sale in a particular shop (e.g., if you just have an armorer’s shop, you could remove everything but Armor and Weapons).

Click Generate Items and the shop stock gets randomly populated.

Rather than risking getting stuck in a loop trying to spend the last little bit of money, the random engine stops checking once it gets to something it can’t afford with its remaining funds (and adds whatever’s left to the read-only Unspent Funds box). It’s pretty likely to leave a lot of funds left over if it rolls something very valuable, so you can click the box with the unspent funds in it to try for another cycle; the smaller the number gets, the less likely you are to add any new items.

Clicking Generate Items clears everything from the previous set and makes another one.

Installing the App and Editing Modifiers

Extract everything in the .zip file to its own folder. Run the .exe file; it’s looking in its own folder for the .txt files.

Pretty much everything in the program uses the concept of statistical weights: basically, all the items in a list have their “weight” converted to a chance of getting picked. If there are three items in a table, with weights of 50, 40, and 10, the first item gets picked on a roll of 1-50, the second 51-90, and the third 91-100 (and, indeed, I mostly generated the weights by reversing them out of the standard random tables). Unlike a standard random table, you can add new items to a list and you don’t have to adjust the rest of them; for example, if you added a fourth item with a weight of 20, the roll would change from 1-100 to 1-120 and everything else would be slightly less likely overall.

With that in mind, the files and what they have in them are:

  • AllItems.txt: The Main list of items, this contains everything that’s not a modular weapon or armor. The format is [Item Name]|[Item Type]|[Item Tier]|[Item Rarity]|[GP Value]|[Random Weight]. The types, tiers, and rarities have to be spelled exactly the same as those in the following documents (you can add/remove types, tiers, and rarities, but have to do so in both places). GP Value and Random Weight have to be positive integers. And that’s true of all the following documents (and, in general, if you alter or add a name in one document, you have to make sure it’s changed or added in the same way in any other document that uses that variable type).
  • ItemTypes.txt: This is just a list of types (armor, potion, ring, etc.) and a random weight. I averaged across all item tiers for these, so if you want to just generate treasure from a particular tier (e.g., minor items have much higher chance of potions and lower for weapons), you’ll have to edit the weights in this file.
  • ItemTiers.txt: This is just a list of tiers (minor, medium, and major) and a random weight. I picked arbitrary numbers, so this is the first place to edit if you want more items of a particular tier than you’re getting.
  • ItemRarities.txt: And, finally, this is just a list of rarities (common and uncommon, which correspond to lesser and greater). Again, I picked arbitrary numbers, so change these if you want to see more common or uncommon items.
  • ArmorAndWeaponChances.txt: This is the master table for generating magic weapons and armor, based on the tables in the Ultimate Equipment Guide (they basically specify an item of a particular enhancement with one or two special abilities of a particular equivalent, rather than the core rulebook’s super random method). The format is [Item Type]|[Item Tier]|[Item Rarity]|[Base Enhancement]|[Plus Table for Special Ability 1]|[Plus Table for Special Ability 2]|[Random Weight]. Note that in this file currently, the only types are armor and weapons, but this subtable will be called whenever the item name is “[Modular]” (see the examples in the AllItems file); so if you wanted to make, say, random Amulets of Mighty Fists with weapon-type effects, you could add a new set of tables here.
  • ArmorAndWeaponTypes.txt: This is a giant list of every possible weapon and armor. The format is [Item Name]|[Item Type]|[Item Subtype]|[GP Value]|[Random Weight]|[Complexity]. Complexity isn’t actually used by the program; it was mostly for sorting. Note that rather than create a very complicated method for assigning special materials to items, they’ve been pre-added here (e.g., Longsword includes variants for Adamantine, Mithral, etc.). If you’re getting materials you don’t want, or you want to add special material chances for the more obscure items (I didn’t make, say, special material versions for Battle Aspergillums), you need to change it here.
  • ArmorAndWeaponMods.txt: This is where the special abilities live. The format is [Special Ability Name]|[Item Type]|[Item Subtype]|[Plus Table]|[Bonus Equivalent]|[GP Value]|[Random Weight]. Note that, true to the books, items will either have a bonus equivalent or a GP value, never both.
  • ArmorAndWeaponPlusToCost.txt: Finally, this translates the final plus equivalent for weapons and armor into a GP value (e.g., a +2 weapon with +3 worth of special abilities would find the Weapon|5 entry in this table and add 50000 gp to all its other costs).

Known Limitations

I took a few shortcuts with this one:

  • As noted above, this generally assumes that minor items will be more common than medium, which will be more common than major, but that any can show up in a particular store if it has the money for it. Which is to say, results will be similar to but not exactly the suggested breakdowns for number of items of various tiers at different ranks of city.
  • Also as noted above, I included special materials in a brute-force way rather than figuring out a truly modular solution.
  • Finally, I punted on weapon special abilities that discriminate by damage type or other fine particulars (e.g., you can roll a disrupting spear or a vorpal mace, and the firearms-only special abilities are in there and will show up on bows even though I didn’t add any firearms to the list). It shouldn’t happen very often, so I figured having to reroll that one when it happened would be fine given the added complexity required to get it to work right.

If you use it, I’d love to know what you think and any errors you can find.