Friday, December 18, 2015

Developing a Social Interaction Mechanic - Part II

Goals

This next post will focus on the goals of the mechanic. Since we're building this mechanic for a very specific purpose (representing non-guaranteed informational exchanges in D&D), we need to keep a few aims of the system in mind:
  1. Strategy. The system should provide a degree of choice, allowing players to make meaningful decisions based on the abilities of their character and the situation at hand.
  2. Meaningful outcomes. Completing an EM should have a meaningful outcome which can change a given situation to a previously-inaccessible one. This also implies that there should be some incentive to completing an EM.
  3. Simplicity. When I say this, I'm being relative. The system has to be balanced: it should account for the various nuances of social interaction but remain simple enough that it takes only a few actual seconds to determine an outcome. Note that, since D&D combats can offer take over half an hour to complete, the total running time of the interaction can stretch out, but individual steps should be easy to complete.
  4. Progression. Failing an EM must never deadlock the game, but instead progress to a new state. Similarly, progression must be ensured within the sequence: even if we take half an hour to complete a full interaction (which may happen if say, a legal trial is taking place or a person is under interrogation), each step should reveal some new information.
If we do not follow these aims, the system runs the risk of being boring, over-complicated or having no effect.

Features

Now let's consider some of the features of human communication.

  1. Information is transmitted, usually imperfectly. All instances of communication involve information transfer, as touched on in the last post. There is a sender and a receiver of meaning, The sender relays some information to the receiver, who then interprets the information. There are several ways in which meaning can be lost: the Internet is particularly prone to this. Wiio's laws comment on these problems, remarking on the inherent differences in language, culture, personal beliefs and the weaknesses of the transfer system all as ways in which meaning is distorted or destroyed.
  2. The meaning of a message depends on prosodic features, nonverbal communication and word choice. Messages, even ones using the same words, can have very different meanings depending on how the message is produced and the context of its production. Sarcasm and irony are great examples of this: just consider how many different meanings can be obtained from the phrase "You look terrible" (some of them: mockery, pity, concern, even admiration...) Furthermore, message meanings can depend on the relationship of the sender and the receiver: the above phrase is interpreted very differently when a stranger says it compared to, say, a parent.
  3. Interpretation of a message's features depends on the receiver's prior knowledge. This idea builds on 1 and 2, as ultimately it concerns how the features of meaning are misinterpreted. Jargon provides a good example of how the features of a message require certain prior knowledge of the receiver, but this can apply to many other features of communication: if the receiver does not know that a particular inflection suggests sarcasm, or that a certain gesture symbolizes approval, or even if they don't speak the language, they are incapable of fully comprehending the message.
So based on these factors, we can see some goals which overlap with features. Progression can be ensured by the continual transmission of information: each successive "pass" informs the receiver further, allowing new options to open up, thereby satisfying the need for strategy, as new options require deeper choices. Furthermore, message meanings depend on features which provide different nuances, another level of strategy which can be categorized for simplicity. And, of course, enough information can lead to a final interpretation and action, providing a meaningful outcome. So now we can experiment with how to actually implement this system!

Designing the Mechanic

Based on the needs and features we've outlined, I'm inclined to rely on a connected, acyclic directed graph to represent the systematic progression from each state of information-sharing to another, until a given "goal state" is reached. This doesn't require any actual implementation yet; we'll get to that in a future post. For now, we can construct a graph that obeys the following rules:
  • Each vertex represents a state of information
  • Each edge represents the addition of new information in a given form. While there are multiple ways to add new information, they will result in different states (e.g. the receiver may trust the information differently, or misinterpret it...) depending on how addition takes place (the given form). Since information is always added (we can't take away information), edges are directed and acyclic (can't get back to an earlier state).
  • Vertices with an outdegree of 0 are "goal states."
The fact that we consider the graph to be acyclic means that every state - even those in which communication fails - has a small effect on the progress towards a meaningful outcome, which we need to be able to quantify. This becomes rather difficult as the number of states increases: if there are a thousand different states (easily doable with a routine outdegree of 10, which would require only 4 "rounds" of exchange, since 10^(4 - 1) = 1000), we would need more and more information to store changes.

This of course assumes we always have around 10 choices. If we limit the number of outdegree of the vertices, however, we can decrease the number of vertices we need to keep track of significantly. Furthermore, we can limit the number of vertices by adding prerequisites to certain edges. Certain choices only open up when we're at a certain vertex. Without jumping too deeply into implementation, if we have a vertex representing a particular state of information, the specific details of that information may naturally lead to other information being uncovered (if directions to an address were being provided, we'd have to know how to get to point B from point A before trying to understand getting from point B to point C).

Furthermore, we can categorize states of information based on multiple factors. Adding information can have multiple effects, depending on the success of the addition. Failure will naturally tend towards certain responses (frustration, anger, confusion...) that will not occur during success, while the way in which information is added will naturally provoke certain new emotional states between the sender and the receiver.

Conclusion

This has been a bit theoretical, but it should provide some good groundwork before diving into methods for implementing the mechanic. Let's review where we stand. The mechanic should allow for clear, comprehensive and meaningful player choices. These choices should allow progression to a clear goal without the players getting lost or confused. Additionally, the mechanic should represent the imperfect exchange of information inherent to conversation, which eventually leads to a decision point at which the parties decide how to act based on this information. Given this, we can use a tree graph to "store" the information: each vertex storing multiple attributes of the current state of information and a list of possible choices to move to another state, while aiming to keep the number of states low enough that the system is easy to use.

In the next post, I'll start on an implementation of these ideas.

Tuesday, December 15, 2015

Developing a Social Interaction Mechanic - Part I

Introduction

As of now, whenever social interaction comes up in my D&D games, it's a clusterfuck. There's a bit of actual acting roleplay, which is a bit clunky (mostly for me since all my off-the-cuff characters are essentially the same), and a bit of narration (I explain as DM what the NPCs say or do or want), which is hard to make interesting. The whole situation is disorganized and stressful: it's totally up to me how much information I do or don't share with the players, and usually I don't even know myself (since I generally just write down a few characters and their motives before starting an adventure).

I don't want to do that anymore when there is an alternative: come up with a social interaction mechanic.

Many DMs have tried different ways of doing this. When I started playing D&D with 4e, we used skill challenges from time to time, which were really railroady. Other times, a simple one-off skill check (roll Diplomacy, roll Bluff, roll Intimidate...) was all that we did.
Other worthy efforts I have seen have been a card system and a modified diplomacy check. I'm sure there's a lot more out there, but I also have a good feeling it will come across the biggest problem with representing social interaction in a RPG:

Social interaction is made up of a vast and complex matrix of relationships, emotions, beliefs and physical actions which are obvious to anyone who is capable of social interaction.

Most D&D players are not very familiar with creating fireballs out of pure energy or headbutting a hobgoblin off a bridge, but if they're in your D&D group they are capable of social interaction (the skill at which varies between people of course). So most of us are aware of patterns of social interaction - things to expect or do. We know that, for instance, a hungry person might be more irritable, or a grieving person may not be in the mood for levity, or that a superior may expect a certain degree of etiquette from a subordinate, and we modify the way in which we interact with these people appropriately.

And most of the time in D&D, these expectations are met: the baron is upset by the rudeness of the players; the lost child is grateful to be found; the pirates are excited by the prospect of riches. But occasionally there are situations where it is difficult to know how best to proceed.

Say the players are investigating a close NPC friend's murder in a small frontier village. The villagers can be assumed to be generally suspicious of the players: in a dangerous region like this, outsiders could mean trouble. Authorities are less accommodating and will harass foreigners. However, certain qualities are valued highly among the villagers: strength, resourcefulness and honour are all of importance. The social structure is one of clans, divided along family rather than professional lines. Keeping the peace among villagers is more important than fair justice, as each clan cares for its own and is indifferent to the plights of the others.

These are all beliefs held by the members of the village about how their world works. It means they will not be coerced or threatened into disclosing information, and any outsider must prove their worth if they want to be treated warmly. If the players march into town, traipse into the bar and say, "Barkeep, what can you tell us about the murder of William the Wanderer?" the barkeep will politely say "never heard of him" and ignore these arrogant strangers. Anyone else questioned will likely say the same thing, and if the players continue nosing around they will be escorted out of town.

If, however, a single player comes up to the bar and, noticing a prominent hunting trophy on the inn wall, asks the barkeep to tell the story of how the stag was killed, the player can use the barkeep's beliefs and emotions to gain an "in" to the village's culture. The player may respond appropriately to the barkeep's story, speaking at the right moments and encouraging the barkeep to continue, in order to lead the barkeep to believe that the player is not a threat.

In the first situation, a group of strangers barge in looking to enforce justice in a way they see fit. In the second, a single instigator persuades an insider to trust them. Both situations are based on a fundamental exchange of information: in the first, the players want to know what happened to William the Wanderer. In the second, the player wants to the barkeep to know I am your friend. The first situation is an interrogation; the second, a manipulation. These are both tactics used to draw information out of the barkeep, but they work in very different ways and their effects are very different depending on the receiver. If, rather than the village barkeep, the players tried to interrogate a defenseless craven, they would presumably have more success.

Thus, the fundamental goal of a social interaction mechanic must be the exchange of information or meaning. Since conversations are almost always for the purpose of exchanging information (knowing how someone is doing, what the weather is like, how to reach a destination...) we can devise a D&D model based on a system where one party tries to encourage another to give information in exchange for other information, essentially bartering what they know - or claim to know - with each other.

For the next few posts, I am going to try to develop this topic with what I call EMs, short for Exchanges of Meaning. Admittedly, there is a whole bunch of research in the topic of human communication which I have yet to embark fully upon, but I intend to move through it as I go and develop the mechanic with it.

Tuesday, September 22, 2015

VBA for D&D

First post since June: I haven't been playing or working on D&D much recently. So it goes.

Today I'll dive into some of the work I have been doing on D&D: working on some VBA functions for Excel. These functions are designed with the goal of simplifying my Excel files which track combatants. Over time, they've gradually gotten more complicated. The last iteration looked something like this:
Rows are combatants; columns are information (including damage taken)
The new version looks more like this:
Columns are combatants; rows are information
Aside from a colour change and flipping the table's axes, I've also added a fair bit of VBA code. Right now, I have code for checking whether a character's class is valid based on their ability scores, code for reducing a character's ability scores based on how far below 0 health they are and code for calculating a character's experience earned. I also have a long VBA-free function for calculating a character's THAC0 against a given combatant.

I'll be posting the code up in my section of the Tao of D&D Wiki, where I am now a moderator. Enjoy!

Tuesday, June 9, 2015

Five Points & Sacrifices

Alexis at the Tao of D&D has recently given DMs some homework:


1.  Name five skills you wish you possessed that would make you a better DM.2.  Name five sacrifices you'd be willing to make to gain any of those skills. 

Few have accepted the challenge it seems: I myself have waited a week since the original post (yay work). Now that I have some free time, I thought it would be a good exercise.

Skill 1:
Provide better exposition & storytelling to my players. I struggle to be clear and concise with my players and make firm choices as to how the story shall progress. When describing a scene, I am erratic: sometimes I remember to add details, other times I lose focus trying to remember what details there should be. When I'm stressed, I tend to miss adding details altogether. Ideally, I'd give the players an appropriate amount of exposition and colour whenever necessary (something I'd need to determine). I would avoid cluttering my exposition with trivialities or giving them information that could distract or confuse them.
Sacrifice 1:
Practice storytelling. I am a terrible storyteller and I often forget details and tell stories non-chronologically. I need to practice for maybe an hour a week, or try the technique Alexis suggests in his comments to Connor Mckay's five points. I also need to commit to my choices. I've done several years of improvisational theatre, and under those circumstances I am very comfortable inventing and creating imaginative stories. As a DM, I tend to clamp up. I want to work on telling stories alone and remind myself to simply be firm on my decisions, even if they play tropes straight or sound unoriginal.

Skill 2:
Keep players more engaged during play. In particular, I'd like to hold my players' attention even when it's not their turn in combat or I'm talking to another player (often, my players tend to splinter off into individual goals and then reconvene session-by-session). I'd like to be able to keep my head above the action and let players know when I will be talking to them and who should prepare their actions.
Sacrifice 2:
I am willing to sacrifice some more time trying an activity which will require me to pay attention to multiple things at once: be it a sport or a job or something else. By spending more time practicing multitasking, I think I can get a better handle on doing so and develop this skill.

Skill 3:
Declutter my organization for the game. Right now I've been moving things over to my computer, and it is very messy. I have PDF copies of books open, browser pages to the Tao of D&D Wikispaces, all my Excel files to run the session, plus OneNote notebooks for recording session details and the campaign journal. Whenever I need to refer to something a little more substantial, like a spell description, the whole game slows right down. I've been trying to push some of the weight of doing so onto the players, but that ends up making me need to ask the players what their spells do which doesn't speed things up nor get me all the correct information.
Sacrifice 3:
Spend some time memorizing and learning more of the rules so I need to keep less open. That would mean giving up time I could spend reading more interesting books to push this stuff into my brain. It might even take some time for me to fix rules that bother me so that I can remember them more clearly (I would remember dedicating the time to change them). I already know that I remember my house rules reasonably well: this would simply be an exercise in learning the rest.

Skill 4:
Be less intense about D&D. My players tend to be new to the game and have school and work to worry about between sessions: they can't commit to strict schedules and D&D just frankly isn't their focus in life. It's a healthy choice that they've made, although one I'm less inclined to make as D&D is my biggest creative outlet when I'm not struggling to practice writing. If the group is less intense, I should cater to their needs and desires as players, so as to avoid pressuring them or intimidating them.
Sacrifice 4:
Let D&D be less important to myself, and give up some of the excitement I get to play. It could make the game feel less special and less meaningful if I let myself be less attached to it, and it would also leave me with time I may struggle at first to fill. But that would give me some time to commit to my other sacrifices.

Skill 5:
Get a chance to be a player and learn from that perspective. Honestly, I've never been a player in an actual game of D&D: I've been a player in a few games of Fate, but that's the extent of it. While I know what I enjoy in other media, I'm not sure what I would enjoy as a D&D player, and that restricts my ability to empathize with my campaign's players. I need to find an opportunity to be a player.
Sacrifice 5:
Quit being a control freak and let someone else take charge. Teach a friend how to DM or go to an event in my area. Accept the possibility of being DMed by someone who may frustrate or bother me, just as much as I may be DMed by someone who inspires me or helps me develop my thinking. Even a bad experience can still teach me about what I want as a player and what to avoid as a DM.

So there are my five. Now to see whether I will actually commit to them.

Thursday, April 30, 2015

Musings on the Weight of a Gelatinous Cube

If a gelatinous cube is 10 cubic feet in volume, then it's 283,168 cubic centimetres in volume.

Assuming a density of 1.3g/cm^3 (density of scientific gelatin), that's 368,118 grams, which is 811 pounds.

For a gelatinous cube to weigh more than 15,000 pounds as Paizo and Forgotten Realms seem to suggest, it would be 6,810,000 grams in weight, which, given the 283,168 cubic centimetres of the cube, would make it have a density of 240g/cm^3 or 240,000kg/m^3.

For reference, that's about thrice as dense as bronze, twice as dense as silver and a good 5000 more kilograms per cubic metre on gold. Tell me, did your silverware ever slip out of your hand like jello?

I mean, I suppose it works if your world has a nice low gravity (that would explain all the giant bugs not being crushed by their own weight)... but seriously, why the hell do you need a 15,000 pound cube? That might as well just be a rock. 811 pounds and density that can actually allow solids to pass is good enough for me.

HUMBLING MATHEMATICAL UPDATE: Maximillian remarked in the comments that the typically understood volume of a gelatinous cube is 1000 cubic feet, given that the cube is 10 feet by 10 feet by 10 feet (you'll notice that the cube root of 10 - the length, width and depth of a 10 cubic foot cube - makes for a somewhat difficult to measure cube). I agree with the logic of his comment (although I'll need more help to see how he got 7,774 lbs). Hence, some adjustments should be made:

The cube is 28,316,847 cubic centimetres in volume (converting 1000 cubic feet to cubic centimetres). With the same density as before, that's 36,811,901 grams or 81,156 pounds. Talk about a big change.

With a volume that large, the 15,000-pound cube also ends up having a density of 0.240g/cm^3 or 240kg/m^3. That's actually a quarter as dense as water. Seems a bit weird still, but a lot less weird than before.

Humorously, if you use Alexis' hit points per die mass system like me, your cube just went from having up to 40 hit points to having up to 120. Scary!

Friday, April 24, 2015

Programming Power Brainstorming

Some good discussion over at Tao of D&D about the use of computers and technology in D&D, especially in our post-videogame era. It's gotten me thinking some more about my own attempts to use my computer to speed up play and make things simpler. This post won't actually put anything concrete forward, just some ideas.

So far, I've mostly kept to using Excel. With the Item Durability app, I have begun my first official foray into Android development, with the intention of eventually having a series of inventory sheets for groups of characters which players can adjust and modify at their leisure. Of course, because it's an Android app it's not as available as Excel, which leads me to start considering my other programming options more seriously.

Right now, I am starting a summer job where I will be using XML and Python for some scripting on the web. It's mostly basic backend stuff but it makes me realize the value of these tools as they are fairly universal and beautifully simple to use (Python is so magical straightforward compared to, say, C - albeit because it hides a lot of C's ugliness).

Some ideas:

Movement
Get a GUI of hexes going, create a bunch of labels to represent characters and then move people around on a hex-map. Can be done over the internet to allow real-time updating by players.
- would require some more investigation of GUIs
- I can already make a hex map background (it's really just a fancy 2D array)
- Internet stuff I'd have to just steal what I know from C (which at this point restricts me to console I/O, but hopefully I could snag a domain for this at some point)

Climate
Obviously a major point for any "realistic" adventure in the outdoors. It would be great to have something I can just print the current climate from with a quick shell command, specifying the location and the date.
- seems doable, although I'd either need a big database or a kickass way to download stuff from the web
- if I follow the second option, I can "mask" locations by assigning real-life locations to fantasy ones (what I already do for my world's weather)
- alternatively, I could try to set up a full-on system (dun dun DUN)

Economy
Definitely another big project involving getting access to items controlled by trade routes and such. Would probably pillage the basic concept from my old economic system (itself pillaged from Tao of D&D) and essentially just do all the math for me (yay automating repetitive tasks!)
- would definitely require some databasing, which I kinda suck at (better learn SQL)

Crawler
It would be lovely to have a way to just gather information for my game off the internet for analysis later. I spend so much damn time opening up Wikipedia articles and scanning through less-than-scholarly articles to get a good sense of what I can use for developing my world. This would be a project to speed that up in a simplistic way. I could probably throw together a BATCH file to do it, honestly. All the same, not much of a priority.

Right now, I am hoping to get durability off the ground, but I think I may start on everything else in various stages. Part of what pisses me off with premade stuff is, with all the licensing that goes on, it's only ever made for one or two particular products, when virtually every single DM is going to use slightly different rules. Anything I end up putting online will definitely need to respect the variety of styles and techniques out there, which is why I would want a comprehensive list of settings that can be turned on or off.

Away we go!

Sunday, April 19, 2015

Back to Durability!

So I have a new and promising durability solution, and of course it was an age-old solution.

The fumble.

As I said in the last post, part of the problem with the system as it stood was that it needed to happen every day and that equipment was breaking as soon as the 1% showed up (in cases where the equipment actually lasted longer than a week).

Though I had remarked on potentially using successive rolls before, I didn't really give it much thought until I was looking over the Tao of D&D's use of break rolls on equipment: on a 1 on your d20 attack roll, the weapon has a chance to break based on its quality: 1d4 for crappy weapons versus 1d20 for "mastercrafted" weapons.

I had been using it for a while, but forgot about it during all the time I hadn't actually sat down and played D&D. My DM brain was getting rusty.

So I decided to incorporate the fumble into some simulations - on a 1 in 20, roll a d100 and compare to the break chance - and boy-howdy did it work. I added one special caveat: if you don't break your weapon when you roll a d100, add the d100 roll to your total stress. I suppose this should maybe be changed logically, as you would expect to want the biggest roll possible, so maybe I'll change it to be add 100 minus the roll if the players can manage it (although I might be able to digitize it out of their way).

The results were very positive: I tested 1000 total resistance, 10000 total resistance, and 20000 total resistance.

Resistance: 1,000
Average # of Days Lasted: 76.76
Standard Deviation # of Days Lasted: 44.66 (min was 2, max was 285!)
Average Break Chance when Item Broke: 37%
Standard Deviation of Break Chance when Item Broke: 0.16%

Resistance: 10,000
Average # of Days Lasted: 240.73
Standard Deviation # of Days Lasted: 121.79 (min was 8, max was 782)
Average Break Chance when Item Broke: 14%
Standard Deviation of Break Chance when Item Broke: 0.07%

Resistance: 20,000
Average # of Days Lasted: 336.57
Standard Deviation # of Days Lasted: 170.57 (min was 30, max was 1123)
Average Break Chance when Item Broke: 10%
Standard Deviation of Break Chance when Item Broke: 0.05%

The standard deviations of days are admittedly a little insane: the data seems really spread out. On the other hand, of the items in the 20,000 bracket, over 60% were within one standard deviation of the average (i.e. between 166 and 507). I can live with that, RNG gods.

The one extra caveat I'll need to add is that 1 on a d20 would work plenty well for weapons, but what about other things, like armour, backpacks, books or bananas?

At this stage, I am considering using a 20 on an ability score roll with an associated item as incurring a break roll (e.g. swinging from a rope), but there's no ability score to eat a banana or wear armour. What does one do?

Well considering what causes wear and tear on equipment - stress from fighting, falling or stretching too far - I could call for a d20 roll in those situations, but that starts feeling like DM fiat when I need to personally adjudicate every kind of scenario, and DM fiat leaves a bad taste in my mouth.

I could have players roll for whatever's on their bodies when they fall below 0 HP, but again circumstances should dictate whether or not a roll is necessary.

I could make each attack hit a semi-randomly determined part of the body and have that item roll its resistance to the blow (1d20, then the 1d100 on a 1). But then there are way too many rolls going on for each attack.

At this point, I am going to implement the complex rule for weapons and keep the break roll limited to situations that call for it. Items will naturally still take daily stress while out in the wilderness, so they'll still break if they ever hit their total resistance.

Now time to implement!

Tuesday, March 31, 2015

Item Durability - Discoveries

So back to item durability...

I simulated some more results, trying solutions 1. (increase the total resistance drastically) and 2. (set a breakpoint after which rolls can start).

Fun times!

Solution 1.

So solution 1 essentially just elongates an item's lasting time. This meant attempting to graph how the average lasting time in days changed as the total resistance grew. Here's a graph of those results with some best-fit functions.




I found that the purple line (that's the actual data points - orange is resistance/days) was most closely represented as an exponential of the form y = m x^k. Desmos calculated m and k to both be fairly small: m = 0.024115 and k = 0.8247.

Armed with this knowledge, I can estimate how long items will last with a given total resistance. Some resistances which were too big to calculate should be about:

1,000,000 total resistance: 2,145 days (5.86 years)
2,000,000 total resistance: 3,790 days (10.39 years)
5,000,000 total resistance: 8,071 days (22.11 years)

The kind of equipment with such enormous total resistance would need to be very well-crafted, but consider how long some of our medieval discoveries have lasted; many still sit in museums today, centuries later. which would need an enormous total resistance (over 20,000,000 if 5,000,000 gives us 22 years). Of course, what percent of the whole are they? A very small well-protected group?

Unfortunately, my best-fit function is only a best-fit function. Were I to add more data points it would presumably get a bit closer to the actual values, but again my actual values are based on 2,000 random number generations so who knows how accurate they actually are.

Solution 2.

For the breakpoint in solution 2, I was running out of processing power so I ran two tests on 10,000 resistance: one with 2,000 items, a breakpoint of 300 and a roll of 1d8, another on 500 items, a breakpoint of 2,000 and a roll of 1d20. So that was a bad move because I wasn't controlling my variables properly. Anyway...

The results were very close to the breakpoint divided by the average die roll, which made sense to me. The first test had an average number of days of 93.94, an extra three weeks or so over the 10,000 resistance test with no breakpoint. The second test had an average number of days of 194.41, so six months more or so. Note that 300/4.5 = 66.6 (first test) and 2000/10.5 = 190.48 (second test). These numbers estimate the approximate point in days at which the breakpoint is reached based on the average die roll, and the larger that number the closer it ends up being to the average (as the item breaks sooner when the breakpoint corresponds to a higher percentage).

Based on this information, we can estimate the lasting time of items with other breakpoints:
1,000 breakpoint, 1d8 roll: 222.22 days.
2,000 breakpoint, 1d8 roll: 444.44 days.
5,000 breakpoint, 1d4 roll: 2,000 days.

As we can see, adding breakpoints essentially gives us a linear progression, which was what I was trying to avoid by using an exponential distribution. So let's can the breakpoint idea.

Back to Solution 1.

While running these tests, I considered some more information. For many of these simulations, the average break chance tended to be quite low when the item broke, and was becoming smaller and smaller. However, once the break chance becomes less than 1%, the roll will never be small enough to break the item (can't roll 0 unless we change our d100 rules, which would probably enrage my players). Let's calculate the stress level needed to reach 1% for a few large resistance values.

This is in fact also a linear progression:

F(x) = 1 - exp(-x/k) (k is the total resistance, x is the number of days passed)
0.01 = 1 - exp(-x/k)
exp(-x/k) = 0.99
-x/k = ln(0.99)
x = -ln(0.99)*k
(-ln(0.99) ~= 0.01)

As we modify k, x becomes larger (it appears linear but is actually a negative natural logarithmic progression as the function suggests).

500,000 total resistance: 5,000 days
1,000,000 total resistance: 10,000 days
etc. (1% is reached at 1% of the total resistance)

Well that wasn't very exciting. This pattern continues along the trend of ln(z) for larger minimum break chance values z, but gradually differs along the negative natural logarithm:

F(x) = 0.06 --> x = -ln(0.94)*k ~= 0.062*k
F(x) = 0.1 --> x = -ln(0.9)*k ~= 0.105*k
F(x) = 0.25 --> x = -ln(0.75)*k ~= 0.288*k

If we graph THIS part...



This data essentially replicates our old cumulative distribution but it's inverted, emphasizing that a smaller break chance also corresponds to the stress taken being farther from the mean.

Well duh.

So no matter what method I use, since at very large numbers the item tends to break around 1%, I can simply increase the number by some linear amount (multiple all the total resistances up) to get my desired rates.

But something about that still bugs me. It doesn't seem like it would be very fun for the player: you track the number of days for years and years of play, never having to roll until finally the odds are 1% and you need to start rolling. Then you play for a long time longer until your d100 comes up 1 and your item breaks. Essentially there's still a break point being forced by the fact that the d100 can only represent up to 2 decimal places of the percent chance.

This is bothersome, but also tells me something about how die-rolling works, I suppose. If I were to use smaller dice (like a d20), the players would simply lose their items later (once the chance reaches 5%). Using a system to obtain larger numbers than 100, like a d1000, seems too annoying to make the players do and would of course make their items disappear sooner, which would then require larger total resistances.

Musings.

When I had set out to accomplish an effective item durability generator, I wanted to make equipment an important weight on the minds of the players, by adding the tension of "Will my gear survive this adventure?" While it can be very frustrating to have no usable weapons, the advantage of D&D's freeform design is that players can make weapons out of anything and find weapons anywhere, as long as they have the necessary tools. They don't need to be stuck weaponless for ages as some kind of purgatory punishment for not packing well, and they'll remember for next time. I don't want to condemn them to endless suffering.

So I imagined my players having to examine their equipment before going out. If they were going off into the wilderness, they would need to pack some tools to repair and care for their gear, or extra parts to replace what did break. There's always the risk in a fight that your weapon breaks, or you slip on the trail and the bottom of your pack gets torn open, or the clumsy cleric shatters the statuette when he pulls it off the pedestal and the floor quakes. These are all circumstances where equipment durability can matter.

A satisfying solution should have a small chance of breakage which gradually grows, starting at a small enough chance that the player would never expect the equipment to break, and gradually increasing as the equipment is worn and used. If a player doesn't make an effort to take care of the item, it risks falling apart.

There is another way to represent numbers smaller than 0.01 without using enormous dice, of course. Use multiple successive rolls. If the first d20 turns up as a 1, roll again to see if you get closer to breaking your equipment. Two successive 1s is already 0.0025: a quarter of the frequency of a 1 on a d100.

Realistically, if you have a 5% chance of breaking something every day you heft it around, it should break pretty soon. So to keep things exciting I'd probably want the break chance to stay below 10%. That way, if the item was simply left alone after that, it should survive nicely (if the stress increases by 1 every turn, an item with total resistance 10,000 lasts 181.38 days on average; around 2.6 times as long as when it increases by 1d8 every turn).

Extraordinary circumstances should certainly risk destroying items, but fundamentally I want players to have items that have survived everything which the players can cherish: the magical bow that has lasted through a dragon's breath or the hammer that fell 300 feet and was still usable.

Equipment certainly needs a counter which controls how close it is to breaking: falls and spells and all those goodies will drive that number up, but otherwise the equipment should make it through the day safely.

Given these requirements, I'm thinking the best way to fix up the generator is to add more conditionals: certain situations apply stress and others don't. What counts for more? There's already a total amount of stress an item can take, so there's no need to have all these different rolls based on material (unless I made all the totals the same and just modified the tolerance). The different rolls can instead correspond to stress type.

Then an item's survival becomes less certain: your gear should make it through the mountains, but what if something goes wrong?

Furthermore, there should be a way to repair and improve the durability of gear. I'm going to look over the mending spell and consider some options in that respect.

Lastly, the system shouldn't be too obtrusive: I don't want the players having to roll the survival of every piece at the end of every day themselves. That's simply too annoying. So whatever solution I settle on should be implementable as an app or Excel table.

Well, we aren't out yet!

Monday, March 23, 2015

The Dungeon's Front Door Review

Recently, Alexis Smolensk over at the Tao of D&D published his second collection of essays, The Dungeon's Front Door & Other Things in the Deep Dark. Much like the first collection, How to Play a Character, DFD is a small but dense volume of essays that investigate a wide variety of topics. While How to Play was a compilation of various excellent posts from Alexis' blog, however, DFD takes the theme of dungeons and injects it throughout.

The result is a cheerful romp through the notion of dungeons in D&D. Alexis has changed his format slightly for this collection. Interspersed among the thirteen essays in the book are two short stories and one series of examples. I was pleasantly surprised to discover these: on his blog, Alexis tends to offer a lot of critical analysis but does not necessarily delve into the specifics of his method, a mystery which encourages the reader to devise their own solution and then toy with the implementations.

There are a few central tenets which are put forward. One is the importance of dungeons themselves. Alexis totes the dungeon as a world within a world, a place where the players can retreat from the chaos of the enormous outdoors into a confined, orderly box. To do so effectively, Alexis emphasizes the value of making the dungeon a world. What is possibly the best essay in the book (it's certainly my favourite), "Wyrd," chronicles the history for a mountain cave that is home to both a goblin community and some hungry jellies. "Wyrd" emphasizes the importance of having a closed system to your dungeons: where does food come from? where do tools come from? what are the defenses of the dungeons' inhabitants? Certain oddities, like untouched doors or piles of treasure, may seemingly defy the sense of the outside world, but Alexis reminds the reader that the dungeon is not like the outside world. It's alien and strange, and so are its people many a time. Maybe they revere doors? Maybe there's an old fountain deep down below which spits out coins? Who knows?

The DM might have some ideas. But the players may never know. Alexis again highlights the value of keeping one's hand close to one's chest while DMing. In "Wyrd," the players may arrive at any point during the history of the dungeon, and find something entirely different waiting for them. They may never know what happened. But a DM with such knowledge can cultivate a little mystery and a little strangeness to keep the players' emotions running high. Alexis recommends a little toying with the players' emotions to do so: his essay "Breaking the Fourth Wall" is all about playing with the players' fears. Little pranks when done right can provide a lot of extra fuel for keeping the players amped and excited, much like a rollercoaster ride.

And there should be lots of strangeness and mystery! DFD rightfully points out that real estate is expensive when you're carving through stone. This is an excellent point: though the dungeon is its own world, it's a small world. One door may be all that stands between the orcs and the gnolls. A pit may service both a hungry otyugh and goblins with garbage. Making your dungeons small, DFD explains, allows for every room to have a purpose (which the players may not understand). And often that purpose is fear. The dungeon is not something to be made gentle or welcoming, but a struggle to victory. This is one of the most important points of the essay, and in my opinion one of the best: the more the players fight, the sweeter victory is. The DM is on the players' side to help them accomplish this high, and DFD explains that by using busy dungeons and a gentle dose of evil, players can be given quite the incredible ride.

This is the majority of DFD, but the short "story" essays "Rest" and "Dungeon Extractions, Inc." are not merely diversions from Alexis' critical analyses. "Rest" features an account of a party trapped in a massive dungeon -- some of its references (the dwarf is the first to become upset by the fact that the party has been in the dungeon for "six hundred and twenty-two" days) are later explored in Alexis' essay on megadungeons "A Door Too Far." The story is humorous and showcases some of the absurdities of the dungeon, especially its attractive power. Even after such an enormous amount of time, by which point decisions like which fork to take become tedious, or after treasure, left behind (cannot be carried), has lost all real value, the party slogs forward.

"Dungeon Extractions, Inc." presents the success of a man who has essentially "industrialized" the dungeon crawl. A billionaire entrepreneur, Sir Phelonious (sounds like felonious, no?) the Elf has min-maxed a massive extraction team to capitalize on dungeons across the world, raking in billions in profits. Of course, Phil is aware that his business will soon cause economic collapse and the whole industry will fall apart: Alexis' characters are charmingly genre-savvy (as many D&D players are).

"Flora in the Recesses" is another fun diversion in the book, relatively sparse on Alexis' usual argumentation. Instead, Alexis puts his methods into action to display how the dungeon is justified, inventing plants to inhabit dungeons and to feed their residents. The plants integrate smoothly with the design of dungeon monsters: intensely peculiar but detailed enough to seem natural. It's a wonderful example of dungeon-world design.

All in all, The Dungeon's Front Door is a great read for DMs in need of a kickstart to reinvigorating their dungeons. It's unfortunately a short read, but nonetheless a valuable one on the philosophy of the dungeon. I am excited to experiment with its suggestions for my players.

The book is currently 20% off on Amazon, and you can also purchase it on Lulu.


Saturday, March 21, 2015

Thoughts on the Item Durability Generator

I've been working on the item durability generator for a while now, mainly to get a working Android version up. I've gotten the preliminaries done and had some time to analyze how the generator is working.

One main problem has crept up once I started using the generator, however: items are breaking too soon.

When I developed the idea, the total resistance of an item was supposed to be its average durability in days: how long it should last on average before breaking. I was finding that items with a durability of 500 days were lasting for 6; items with a durability of 200,000 days were lasting for 500. So I investigated the cause.

What I found was that random variables were, as they often are, the cause. Each time the stress is added, there is also a d100 roll to see if the item breaks. Obviously, given the uniform distribution of die rolls, after about 100 of them (and much before too) I had a good chance of getting below the break chance.

I tested this on a bunch of different simulations: 2000 items of various total resistances. My findings were as follows:

Resistance: 500
Average # of Days Lasted: 13.06
Standard Deviation # of Days Lasted: 6.87
Average Break Chance when Item Broke: 12%
Standard Deviation of Break Chance when Item Broke: 5.33%

Resistance: 2,000
Average # of Days Lasted: 27.84
Standard Deviation # of Days Lasted: 14.03
Average Break Chance when Item Broke: 6%
Standard Deviation of Break Chance when Item Broke: 2.91%

Resistance: 5,000
Average # of Days Lasted: 46.22
Standard Deviation # of Days Lasted: 21.84
Average Break Chance when Item Broke: 4%
Standard Deviation of Break Chance when Item Broke: 1.87%

Resistance: 10,000
Average # of Days Lasted: 70.58
Standard Deviation # of Days Lasted: 31.11
Average Break Chance when Item Broke: 3%
Standard Deviation of Break Chance when Item Broke: 1.34%

Resistance: 50,000
Average # of Days Lasted: 192.79
Standard Deviation # of Days Lasted: 62.91
Average Break Chance when Item Broke: 2%
Standard Deviation of Break Chance when Item Broke: 0.55%

Resistance: 200,000
Average # of Days Lasted: 547.05
Standard Deviation # of Days Lasted: 99.83
Average Break Chance when Item Broke: 1%
Standard Deviation of Break Chance when Item Broke: 0.21%

As you can see, the number of days increases while the break chance decreases. I've been contemplating a few solutions to this problem which I will outline in a future post, but they are as follows:

1. Increase all items' resistance to very large values in order to get an average closer to what I expected.
2. Only begin rolling break chance after a certain point.
3. Reconfigure the system.

Time to weigh options!

Thursday, March 5, 2015

Item Durability

So back in November I read about a fun idea on the Tao of D&D, discussing item breakage. In my mind, D&D could certainly use a little more caution and preparation, as if the players put in lots of time and effort to be equipped to achieve their goals, their goals will feel sweeter once they are achieved. So to insert a bit of tension and fun/stress (a little stress is exciting after all), I developed a program as Alexis suggests in the linked post.

It's an Excel file which requires macros and VBA and such, along with iterative manual calculations. Also, it's generally very ill-advised to download Excel files off the Internet which have built-in macros as there are a whole host of security issues you risk exposing yourself to. So if you don't feel comfortable then don't download it.

Here's the basic appearance of the generator:

It works very simply. You first tell it whether you want to generate a new item or not. The generator then, using the specified material and quality of the item, along with whether or not the item is magical, generates a number which corresponds to the total "resistance" in days of that item, along with helpfully informing you of the item's stress tolerance.

Once the total resistance has been generated, you tell the sheet not to generate a new item any more and recalculate.


As you can see, the generator has produced a number of "Stress Taken," again in terms of days. This represents how, over the course of one day of use, the item has fared. It is understood that, were the item to be placed in a vault constantly and regularly cleaned and maintained, the stress taken would be 1. The number instead generated represents the stress of regular use on the item, which is hence larger.

The "Break Chance" beside "Stress Taken" shows the chance the item will now break on a d100. It is calculated using a cumulative exponential distribution function where x is the stress taken and lambda is the inverse total resistance. This function means that the item's break chance should be around 66% once it reaches its total resistance, so the item can actually survive past the total resistance date. The reason "Break Chance" exists is that sometimes, though the item shouldn't break for a long time, it does anyway, perhaps due to a fracture in the material or a freak accident. Maybe the character is just really clumsy.

Right now, that chance is 0%, so there's no need to roll. But let's say that the next day comes around, and the character carrying this poor iron item - say an old dagger - also falls off a parapet forty feet above the ground. Now the character takes fall damage, and so does the item.


The character took 15 damage from the fall, which was also added to the item (the item also took another 5 stress damage during the day, bringing us up to 23). As the total resistance is quite high, there still is no chance of breaking.

Let's say the character then enters a dungeon, falls into a 20-foot pit and spends 3 days fighting troglodytes to get back to the entrance. Here's how the dagger has held up:


It has now taken 47 stress and has a break chance of 2%, so at the end of the day, the character will also need to roll a d100 to see if the item breaks. 

100 days pass and the item takes a bit more of a beating:


Now it has a 22% chance to break! Yikes! It's only made it 105 days from when the character first received it.

Anyways, that concludes a brief intro of the generator. Here is a link for those interested in using it. I will try posting a more detailed version of it later, which also includes a basic character sheet.


I may make a few edits to the file as time goes on.


Wednesday, March 4, 2015

Reinventing the Wheel

Well I quickly lost my steam on that last topic. My world tends to be in a pretty regular flux, and my players don't play often enough for me to get comfy sitting still on it.

Instead, I decided to reinvent the Wheel. The shape bugged me and it did not feel medieval enough, so for the next little while I will be working on adding all that content back onto this:


I think that looks a lot more like a wheel, no? (I did put an overlay on top to keep that part clear!)

I worry of course that I will change it again. Given the length of time between games, I may end up putting off a world map for a while and focussing on creating small, modular areas which could be later incorporated into an entire world.

Wednesday, February 18, 2015

Wheel - Part I

Currently, I am running a game in a world I've called Wheel. Here are some images from the most recent update:

Independent states of Wheel.
Climates of Wheel (Koppen classifications).
Cultures of Wheel.

I'll discuss these images and the research involved in following posts. For now, a brief explanation of the scale:
One hex is 36 miles across (1122.37 square miles).
The first line shows 100 miles.
The second shows 500 miles.
The third shows 1000 miles.
In total, from one end of the image to the other is around 3200 miles.

Introduction

Hello, world!

That makes two references now: one to my programming background and another to one of the most interesting books I have read.

This is my D&D blog specifically for my work relating to D&D, whether it be my work on my world, discussions of experiences playing, long-winded responses to other blogs, comments on D&D in general or attempts to develop some time-saving apps and programs for my D&D work (whether on Excel or Android).

The decision to name the blog after Northrop Frye's book on literary criticism of the Bible stems from a few factors, including the months that I have spent reading another very important blog -- now, in fact, the only blog I regularly read -- run by the talented and eloquent Alexis Smolensk, The Tao of D&D. The blog has been around for many years now, and just reached (two weeks before this post) a million all-time pageviews. It is this blog which inspired me to put my D&D online, where I can examine it, show it to my players and discuss it with the Internet. (That being said, I will moderate the discussions in the interest of keeping things from getting too libertarian.)

Frye's book examines the role of the Bible on Western literature, looking at language, myth, metaphor and typology. It's a dense read, but there are many critical gems which I ruminated on after a summer's day reading and thinking about the book.
The Tao was, in some form, The Great Code of AD&D for me. I still have yet to read the complete Bible, though I know Genesis reasonably well and little bits here and there. The Great Code, however, guided me through the fascinating influence of the Bible on literature with which I am familiar and enlightened me on its continued power. The most powerful point I took away from the book was the absurdity of literality when interpreting such a metaphorical text as the Bible, where literary style has led to clear and defined use of metaphor, types and language to suggest deeper meanings.
The Tao of D&D takes first edition AD&D and deconstructs it. Alexis rewrites vague rules and discusses weaknesses of the original system -- perhaps, being temporally closer to the original AD&D rules than Frye was to the Bible, he has a greater opportunity to edit -- along with examining the logic behind running good D&D games. What did the book try to suggest, but was incapable of expressing?

Obviously, the DM's Guide to AD&D cannot ever stand up as a literary construct compared to the Bible. The analogy fails me there. The Tao of D&D more often trashes the original rules when The Great Code would have drawn out an intriguing metaphor for the soul or pastoral life. But both are concerned with taking their influence and analyzing it. Criticism is central to both. The use of historical, literary and psychological examples is found in both. And both will open up the reader's mind to consider the deeper implications of everything they read, watch, listen to or experience. That's high praise but it's well deserved. Welcome to The Great Code of D&D.