Random Generator Scripting

Map of Paris (1569)

Map of Paris (1569)

When running city-based adventures, players will often ask NPCs for directions to random establishments that probably do not warrant a keyed location on your map prior to the question being asked (e.g., a random blacksmith, general store, inn, or bookseller). At that point, it is helpful to have some pre-canned directions to provide based on how rare the type of establishment they are trying to find is. I have uploaded a script to this site (available via the link or the menu below the site banner) that allows the user to pick the number of direction sets to generate and how many districts the city contains (although these can be quarters, neighborhoods, etc.). I should note one important debt: the descriptive content of the script is based on a blog post at Blog of Holding.

Here is how to use the direction sets generated by this script:

  1. It is assumed you already have: A city map indicating districts (or equivalent), each having at least one marked/named street
  2. When the players ask a NPC for directions, use the next set on the list you pre-generated.
  3. Determine (based on your campaign type, city size, etc.) whether the location sought is a common, rare, or unique location. Check the results to see if the location is in the current district or another as described in the entry. Technically, you could use the script for a single district city (just choose two districts from the drop-down and ignore district indications).
  4. The first direction entry in the result tells you how many blocks down the relevant district’s main street before the first turn in the directions. If you have more than one main street, role to determine which is being referenced; also either make a judgment call or roll to determine direction along street for block-counting purposes).
  5. Next, there is an indication of which direction the turn is off of that main street.
  6. There are then separate indications of how many blocks on the side streets and the number of turns (these details should be improvised and noted for later reference; ignore these if they don’t make sense given the nature of your city).
  7. Finally, there are a couple of short phrases to add some unique descriptive flourishes to the final location.

I hope some other DMs/GMs find this useful; let me know about any problems with the script and I will make corrections.

Final Note: The version of the script on this site is designed for pseudo-medieval/medieval settings (although it may work in other time periods). I will be releasing the source code to all my generators sometime this year, though, and it should be trivial for those familiar with coding to swap out the descriptions to better match their setting at that point.

"Feiernde Bauern" ("Celebrating Peasants"), artist unknown, 18th or 19th century

“Feiernde Bauern” (“Celebrating Peasants”), artist unknown, 18th or 19th century

Today I have posted a new Perl script to my blog that will generate hundreds of random non-leveled (i.e., commoner) NPCs in a plain text file, including basic physical characteristics, psychological features, and information about employment (the script is available here and from the header menu above). The program is a companion piece to the leveled NPC generation script previously published on this blog. While that script was for creating rival NPC parties and the like, this one is primarily for generating NPCs to drop into your campaign whenever your players drop into their local tavern to collect rumors or stop a random passerby on a city street.

Notes and Caveats:

  1. It would be remiss on my part if I didn’t acknowledge the influence on this script of Richard J. LeBlanc Jr.’s NPC generation charts in his D30 Sandbox Companion publication. I strongly recommend clicking that link and buying all of his D30 products in both PDF and print (the latter available here).
  2. There is one more NPC generator script yet to be uploaded: one that generates the entire population of various types of city districts including both leveled and non-leveled NPCs and using some of the demographic assumptions introduced in third edition Dungeons and Dragons. I will post that within the next month or so (it needs a bit more polish).

I have just posted a new script that produces random encounter tables using the information contained in the appendices of the AD&D Monster Manual II. The actual program, written in Perl, can be accessed here on its own page (also linked in the blog header).

D&D Demotivator by Greenish

D&D Demotivator by Greenish

Feature Highlights and Explanations

  • Each table contains nineteen semi-random entries numbered two through twenty. The DM should role 1d12 and 1d8 to get a result when a random encounter is indicated.
  • Two dice are used in order to produce a bell curve, with the entries towards the middle of the table being the statistically more likely results. The tables take advantage of this fact by placing monsters marked in the MMII as common in the middle of the table, uncommon to either side, and rare/very rare monsters on the outer limits of the table (i.e., those least likely to be rolled). The exact distribution is:
    • 5 common monsters numbered 9-13
    • 4 uncommon numbered 7-8 and 14-15
    • 6 rare numbered 4-6 and 16-18
    • 4 very rare numbered 2-3 and 19-20.
  • Users of the script choose the type of area for which the table is being generated and the presence and prevalence of the monsters that can populate the tables changes based on these choices. Here are the available selection criteria (all based on the lists on pages 139 to 155 of the MMII):
    • Dungeon (specifying a level between 1 and 10)
    • Outdoors (specifying Civilized or Wilderness and geographic region: Mountains, Hills, Forests, Swamps, Plains, or Deserts)
    • Water (specifying freshwater or saltwater and whether the encounter is on the surface or in the depths)
    • Astral and Ethereal Plane Encounters
  • Similar monsters (minimal animals, dragons, giants) that appeared in the MMII as part of a single list have been combined into one line. This was done to prevent monsters with several variations from being over-represented in the random encounter tables. DMs should roll appropriate dice to pick from the sub-types when one of these entries is indicated.

Caveats, Limitations, and Areas Needing Improvement

  • The drop-down menus on the interface page are not conditional since this is not standard functionality on WordPress. Please pay attention to the selections you make since it is possible to choose nonsensical combinations!
  • There are typographic errors in some of the entries. These are artifacts of the optical character recognition process used to extract the text of the charts from a PDF of the MMII. I have corrected those noticed during the coding process, but there are no doubt more.
  • Unfortunately, the frequency lists used to populate this script are separate from the index in the MMII. This means that book and page number information are not available on the entries. This information can be found, though, on pages 156 to 160 of the MMII. If time and inclination allow, I will try to insert page numbers into this script — it is likely to be a slow and laborious process, though.
A healthy haul

A Healthy Haul (Perhaps a Type A?)

It’s taken a bit longer than anticipated to get posting again, but today I have released a new random generator, the Treasure Package Generation Script (also linked above). This Perl script creates treasure packages using the system outlined in the back of the AD&D 1e Dungeon Master’s Guide and Monster Manual. A few quick notes about that system and this tool:

  1. Each treasure package has percentage chances for different types of treasure appearing. It is possible to have a package generated with no treasure!
  2. I have also incorporated the gemstone descriptions from the DMG so you will know whether that topaz is translucent, transparent, or opaque! Seriously, though, this can be very useful when describing the treasure to PCs who don’t have a background as jewelers.
  3. This script produces a RTF document for download instead of a plain text file like my other random generators to date. You can change the file extension to TXT if that’s a concern, although you should then make sure to open the resulting file with a text editor that respects formatting/spacing (i.e., Wordpad, MS Word, or OpenOffice instead of Notepad).
  4. If you are running the script multiple times, be sure to clear your previous selections if you don’t intend to generate another set of the same treasure packages.

Future enhancements to the script will likely include the random generation of specific jewelry descriptions rather than just the terse indication of material given in the DMG. As usual, feedback and suggestions are most welcome and I will do my best to correct errors brought to my attention!

Colchester Castle under Construction

Colchester Castle under Construction

It’s been quite a spell since my last post, so I thought it might be a good idea to check-in to confirm that this blog is still a live project and to outline some plans for the next few months. There has been a logical reason for the prolonged delay since my last update, leaving aside general laziness and a busy summer schedule. This issue was that the next section of my commentary covers the Dwarven people and there were too many spoilers for my ongoing campaign to address that subject. While some of those secrets have yet to be discovered, my players have made significant progress in their investigation of Curabel’s Ancient Dwarven civilization and it will now be easier to cover that subject here without spoiling the campaign.

With this problem no longer holding things up, I will relaunch the campaign setting Bible annotation shortly. In addition, a number of additional random generation scripts written in Perl are almost ready for upload here — these will cover non-classed NPCs (compatible with just about any system) and treasure package generation (potentially useful in other games, but designed for AD&D 1E). Based on the site traffic, the random weather generator has been the most popular post on this blog, so I think these might also be of interest. Finally, I will also start posting annotated play reports from my ongoing campaign that has just reached its 66th session (covering 264 hours of weekly gaming).

Anyway, that’s enough planning — now it’s time to bring some of these ideas to fruition.

paladinI have published a random generator that creates leveled NPCs (also linked above) using the rules in the AD&D 1e Players Handbook and Dungeon Masters Guide. The output, which can be downloaded as a plain text file, includes the usual stats along with the (sometimes very odd) random personality fields from the DMG. Users of the script can choose to create random NPCs, or choose specific classes, races, and/or levels. One caveat: choosing a combination not allowed in the 1e rule-set can generate malformed NPCs. As with the weather generation script, I would appreciate any feedback about the usefulness of this tool and/or improvements that could be made.

One last note: I have separate random generators for creating non-adventurer NPCs and populating city districts that I will post at a later date (they are a bit more complex).

Apocalyptic Weather

An unlikely scenario using my random generator.

I have just posted my campaign’s random weather generator script (also linked at the top of the page). Written in Perl CGI, the script allows users to specify a climate region (e.g., arctic, tropical), season (winter, spring), and month within season, before choosing whether to download the results as a semi-colon delimited text file or just print the results to the screen. Those results will include thirty days of weather generated by my original code partly based on the rules in Kim Mohan’s Wilderness Survival Guide (TSR, 1986). While similar results could be achieved by rolling dice, I have found this script to be a wonderful time-saver.