Affiliation Graphs for Dungeon Stocking — Raw, Random Thoughts

Jul 31, 2013
Mark
Comments Off on Affiliation Graphs for Dungeon Stocking — Raw, Random Thoughts

Random thoughts come with random generators. Early in the week, I was cleaning up a bunch of files from prior programs at work and a good part of it was relationship graph code that was targeted at a program which ended prematurely. Arriving at home, I decided to do a functional check of various random generators. One of those was the monster stocker. As I was testing and looking at the raw output, it struck me that rather than having to manually figure out how the monsters fit in a dungeon it would be cool to build up a relationship model. Keith over at In My Campaign has written about Node Based Megadungeon Design. He also happens to be on G+ so I tossed the idea at him last night. His input is intermixed with my own thoughts and I’ve tried to designate his insight appropriately.

Generating random affiliations is a complicated problem. Ad hoc language is easy to describe verbally — the bugbears in areas #2, #7, and #9 have subjugated the kobolds in #3, #5 and #6. Coding that is significantly more difficult. However, if you simplify the relationship into a few definable terms, one can begin to construct the nature of the affiliations between groups. From there, you begin to place those creatures in actual locations in the dungeon. For now, I am going to ignore physical space and just consider building up a rational model of the creatures within a dungeon.

Step 1 – Plausible Population

Assuming a map is available and general metric of the power rank of the creatures, it is simple enough to generate random population of plausible creatures. For simplicity, I will start with a single level dungeon with a single entrance into the world. Say 30 rooms with about 2/3rds of them populated with one creature or another. Just generating 20 creatures is unlikely to be an interesting population. Instead, pick out your random table of choice and do 3-6 times that number of creatures. Massive list, right?

Make it more interesting. Add in a fractional percentage of higher level creatures. Say we did 3X the number of rooms to start. Add in 1/2X creatures from the next level of power. 1/4 from the 2+ the starting point and perhaps 1/8th from 3+. So we end up with a starting population of 90 plausible rank 1 creatures, 15 rank 2, 7 rank 3, and 3 rank 4+. All told, there are 115 possible creatures for a mere 30 rooms of which only 20 will be actively occupied.

Step 2 – Density

Now we have a major pile of creatures that need to be pruned downwards. Nothing gets culled at this stage. Instead, the target population is evaluated for occurrence of the same beasts. This should not be a simple count of Creature Y showed up Z times. Evaluation should consider the number of creatures that could plausibly appear for each room / encounter. So if kobolds show up 3 times in the initial population but 12 of them can occur each time, the kobold density metric is 3*12=36 rather than 3. Thirty six creatures vs a singular purple worm that showed up from one of the upper level tables is significantly different.

Sum up the total creatures plausible then calculate possible density (total # / total possible). The value is between 0 and 1. Honestly, its slightly above 0 and 1 should hopefully never show up in a rational random table.

Step 3 – Segmentation

Next up, divide the population into two groups — actors and outliers. The actors are the top 10% (or whatever cutoff you choose) of the density metric. The rest are not dominant players in the dungeon but may be present. The group of creatures with the highest density is the starting target of the “lair” monster. Assign every creature an appropriate boolean actor flag.

Step 4 – Starting Relationships

Initial seeding of group dynamics can take many forms. Keith suggested a seeding metric based on alignment, Friendship. I considered one based on hit dice, Dominance. For alignment, depending on your preference, you either have 3 or 9 different models. On the ease of use stand point, use Law/Neutral/Chaos. Those with the same alignment get a 1 for friendship, 0 for one step removed and a -1 for opposing views. Granularity for the 9 could be added but I’m keeping the idea as simple as possible.

For Dominance, just look at HD vs HD at a group level. Nine 1-HD creatures can be treated at the 9 HD metric vs something with 3 HD. This is a rough metric; certainly not useful for with something with special abilities and/or other powers. I think a better metric might be using XP per creature as the relationship value.

Both Friendship and and Dominance are a 1-to-1 relationship. Every creature has a friendship and dominance model to every other one.

Next Steps

I’m out of time for the evening. This is a rough, raw look at how I’d begin to assemble a population in code. The outliers of the population need more significant relationships to the actors. Then cycle the “life” of the dungeon a few times to erode/enhance friendship and dominance. Sprinkle in a few more relationship metrics. Rinse, repeat, or deviate. I cannot predict where the idea is going to flow.

Tags: , ,

Comments are closed.