Code Monkey home page Code Monkey logo

monsterdatabase's Introduction

Making the database

Data

A directory of all MM, FF, and MMII monsters and where they are found by frequency, based on terrain as listed in the back of MMII.

Note that this is substantially different from the charts in the back of the DMG, not just because of the different monsters, but because there is a smaller list of terrains (i.e., MMII does not list scrub or rough; marsh is renamed swamp).

In addition, there are several Conditions missing: artic and sub-artic are combined into “cold”, Faerie and Sylvan is missing, as are “Pleistocene” and “Age of Dinosaurs” both of which seem to have been rolled into parts of “tropical”.

One other difference in the MMII tables is that fortress, patrols and character encounters are rolled into the main tables. In DMG, a flat 10% of “men” encounters are with character types and patrols are a full 25% of encounters in inhabited areas and fortresses are 5% of all uninhabited area encounters.

Setup

The core is a database file of monsters (MMIIlandmonsters.txt) which is fed into a program (parse.pl) along with a type for the database (this can be anything but the current data file only contains land encounters so I usually call it “land”). For example:

./parse.pl <MMIIlandmonsters.txt land

Parse.pl then produces a database in the form of a directory structure such that the monsters which are common in tropical civilized forests are found in

land/tropical_civilized_forest/common

Parse.pl deletes the contents of existing frequency files when it runs.

Reading the database

Where do you find monster X?

To, for example, find where trolls live and their frequency in each terrain:

grep -rHi "^troll$" */*

Which returns a list like this:

land/cold_civilized_desert/rare:Troll
land/cold_civilized_forest/uncommon:Troll
land/cold_civilized_hills/rare:Troll
land/cold_civilized_mountains/rare:Troll
land/cold_civilized_plains/rare:Troll
land/cold_civilized_swamp/uncommon:Troll
land/cold_wilderness_desert/rare:Troll
land/cold_wilderness_forest/uncommon:Troll
land/cold_wilderness_hills/rare:Troll
land/cold_wilderness_mountains/rare:Troll
land/cold_wilderness_plains/rare:Troll
land/cold_wilderness_swamps/uncommon:Troll
land/temperate_civilized_desert/rare:Troll
land/temperate_civilized_forest/uncommon:Troll
land/temperate_civilized_hills/rare:Troll
land/temperate_civilized_mountains/rare:Troll
land/temperate_civilized_plains/rare:Troll
land/temperate_civilized_swamp/uncommon:Troll
land/temperate_wilderness_desert/rare:Troll
land/temperate_wilderness_forest/uncommon:Troll
land/temperate_wilderness_hills/rare:Troll
land/temperate_wilderness_plains/rare:Troll
land/temperate_wildernes_swamp/uncommon:Troll
land/tropical_civilized_desert/rare:Troll
land/tropical_civilized_forest/uncommon:Troll
land/tropical_civilized_hills/rare:Troll
land/tropical_civilized_mountains/rare:Troll
land/tropical_civilized_plains/rare:Troll
land/tropical_civilized_swamp/uncommon:Troll
land/tropical_wilderness_desert/rare:Troll
land/tropical_wilderness_forest/uncommon:Troll
land/tropical_wilderness_hills/rare:Troll
land/tropical_wilderness_mountains/rare:Troll
land/tropical_wilderness_plains/rare:Troll
land/tropical_wilderness_swamp/uncommon:Troll

Pick a random monster of a certain frequency

If you cd into a specific terrain then you should be able to do:

sort -R common |head -1

and get something like:

Dinosaur, Triceratops

or, for that matter

sort -R common |head -10

to get:

Skunk
Rat, Giant
Jackal
Dinosaur, Monoclonius
Dinosaur, Styracosaur
Dinosaur, lguanadon
Wolf
Toad, Giant
Rhinoceros
Falcon, Small

Pick a random encounter for a terrain

The program encounter.pl takes a terrain and returns an encounter using the weightings from the MMII (e.g., very rare is 3%, not the 4% of the MM)

./encounter.pl land/temperate_wilderness_forest/

Dog, Wild

If you want the encounter program to generate patrols and fortresses as per DMG p182, then tag any non-zero item onto the command line:

./encounter.pl land/tropical_wilderness_mountains/ 1

Stronghold:     Small walled castle with keep (medium)

Monster overview lists

You can also do

cat temperate*/*|sort|uniq -c|sort -n|less

to, in this case, get an ordered list with counts for how often each monster appears in a subset of terrains (except it doesn’t list those that don’t appear at all).

Customising the database

We all have monsters we really can’t stand, as well as our own invented ones or ones found in weird JG material or magazines.

Adding a monster is as simple as adding it to the master list for the correct climates and frequencies and re-running parse.pl

Removing a monster is harder as it has to be removed from all the occurances, which is much more of a pain.

I’ve added a program “filter.pl” which takes a master list of “acceptable” monsters and a raw data file such as MMIIlandmonsters.txt and spits out, on STDOUT, a new version of that monster list which only includes the acceptable ones.

The best way to proceed, I think, is to create a list of all monsters using

sort MMIIlandmonsters.txt |uniq >likes.txt

and then edit that list, simply deleting monsters you don’t like, then run filter.pl:

./filter.pl likes.txt MMIIlandmonsters.txt >myland.txt 

and finally, rerun parse.pl on myland.txt to produce a new version of the land encounters database:

./parse.pl <myland.txt land

Replacing Scrub and Rough etc.

My suggestion for replacing the missing terrains would simply to cut and paste an existing terrain and then edit it to fit the missing ones.

Scrub and rough in the DMG seems quite similar to plains, but rough should contain more dungeon-y type monsters as it includes ruins, and scrub is mostly modified to reflect creatures that prefer a bit of cover, but it’s not a huge difference.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.