Saturday, November 23, 2019

Ninja

Today I scared a missionary so badly she actually fell over. I was at the church and everybody from Messiah practice had pretty much left, and Sister Baxter and Sister Peng walked out of the chapel and I looked up from my phone and said, "Hey there", and Sister Baxter fell over backwards.

I'm kind of proud of myself--I've never done that before. It made me feel like a ninja even though I'm sure I don't deserve it. :-)

-Max

 --

I could not love thee dear, so much,
Loved I not honor more.

Friday, November 8, 2019

Type classes in F#!

[Excitement]
Not only do I now know what a functor is (from a category theory standpoint) and roughly how they relate to Haskell type classes, but I ALSO know how to emulate a functor in F# with SRTPs!!!! What does this mean in practice? It means that I can implement a new data structure with different performance characteristics, like a FastList<T> as well as a RegularList<T>, and yet I can just use one map function for both kinds of lists as well as any other list-like data structures I implement.

What this means in effect: I can now do overloading in F#!

My code is about to shrink significantly! And I will be able to add new data structures fairly freely. My code no longer grows in complexity if I add more data structures. (!!!!!!)

Here's the relevant commit: https://github.com/MaxWilson/ShiningSword/commit/1d4cdbac77983ed808f96489083ccc9ecae0377a

Notice how FastList is now a type, not a module, so I just declare FastList<T> instead of FastList.Data<T>, and instead of having to call FastList.Transform I can just call transform.

Limitations: you need to have enough control over the source code to add the appropriate static members for SRTP to operate against, which in some cases for e.g. built-in lists might require wrapping native types in my own types. And all the types involved need to have roughly the same type signature, so you have to follow certain design patters when adding your new types. But as long as you do that, everything just works.

Thanks to Bartosz Milewski and his book (Category Theory For Programmers) and also to Don Syme and his paper on the history of F#, or I would never have thought to attempt this or understood the results even if I succeeded.

-Max
 --

I could not love thee dear, so much,
Loved I not honor more.

Sunday, November 3, 2019

How to make 5E more challenging

[Written as a response to a post asking for ways to keep the challenge level high in a D&D 5E game. -M.]

Aside from the obvious things like beefing up encounter difficulty (more monsters, higher CR) and adding more complex battlefields (more vertical movement like platforms, cliffs, pits, dangling ropes, and vertical tunnels), try adding more uncertainty to the game.

Risk = don't know the outcome but do know the approximate odds
Uncertainty = hidden information, don't even know how much risk there is

It's the difference between opening a door and seeing a Death Knight and three Wraiths, and not knowing if you'll win initiative as you Rage and charge into combat, vs. opening the door and seeing three Githyanki and not being completely sure whether, if you charge into combat, it might actually turn out to be three Wraiths who've been disguised under a Seeming spell by the lich who runs this section of the dungeon, or whether that lich or a Death Knight might be somewhere within earshot waiting to hit the party squishies from behind as soon as the party tanks have charged the wraiths and the party has committed their concentration to other spells.

Even if 60-80% of the time things turn out to be exactly what they look like (yup, they're Githyanki! and there's only three of them), the knowledge that it's possible that things are not as they seem can add fun dramatic tension, especially if there are clues that can let you correctly guess what is real and what isn't.

Also, make good use of secret doors, maps, riddles, magic items, and other affordances that can let players make things easier on themselves if they take advantage of them.

You may set up a dungeon level with a Star Spawn Larval Mage, a Star Spawn Seer, three Star Spawn Hulks, five Star Spawn Manglers, and a whole ton of gibbering Star Spawn Grues (60 or so)... tough fight for an 11th level party if they tackle it head-on, right? But then you scatter the Star Spawns around (weird cultic rituals for the Seer in the main hall, Manglers on patrol looking for intruders, Mage torturing prisoners, Hulks bodyguarding the Mage and Seer, and Grues everywhere, everywhere!) so that it takes at least a couple rounds for reinforcements to arrive once they see the PCs, and you make everyone but the Grues patient and smart enough to break contact and wait for reinforcements (especially Manglers, who are good at hiding) and/or to try to surround PCs, and all those extra restrictions on the Star Spawn make surviving a fight with them tough but maybe doable, like the space Marines in Aliens attacking the Alien hive and barely surviving thanks to Ripley and the APC.

Then you also add six or eight 4'-wide (Small-sized) tunnel shafts connecting this dungeon level to the Duergar dungeon level above and the aquatic shark- and Black Pudding-infested waters below, add a Clay Golem or Shield Guardian trapped in stone in a cavern reachable through one of those tunnels, place a riddle containing a command word for the Clay Golem/Shield Guardian somewhere nearby, and put a map for the tunnels in the Duergar's treasure vault where the PCs can purchase it from the Duergar or loot it after killing all the Duergar, and suddenly it starts looking not only doable but gameable and fun.

 --

I could not love thee dear, so much,
Loved I not honor more.

Saturday, November 2, 2019

I finally understand Beetlejuice!

I have always enjoyed Beetlejuice but there's a lot of things about the movie that I never got, things which seemed random, including for example the ending, which always seemed kind of abrupt and random to me (why the big deal about the song?). Until...

...until I watched The Exorcist. Well, okay, until I bought The Exorcist and skimmed through it looking for interesting or scary parts, mostly the very beginning and stuff towards the end. (I was testing a mental technique to use against fear, long story.) I feel like I at least got the sense of the show, and I think Beetlejuice can best be viewed as an answer to The Exorcist and its whole genre.

For example, "Beetlejuice" is kind of a weird title for a movie that isn't really about Beetlejuice, right? It's mostly about Adam and Barbara Maitland and their afterlife, including their interactions with the living family the Deetzes. Beetlejuice himself isn't even really in much of the movie, he's onscreen maybe 15% of the time. I think "Beetlejuice" is a linguistic stand-in which is supposed to remind us of "Beelzebub," a name for evil/the devil, and the theme of the movie is basically:

"What if the supernatural isn't inherently scary after all? What if evil spirits are definitely evil, but in a pervy, used-car salesman kind of way? What if possession isn't scary per se? Being made to dance a musical number might be kind of fun, especially if you can't normally sing or dance! What if there's nothing magic or scary about death and what lies beyond it?"

The character arc of the movie is for the characters (especially Adam, Barbara, and Lydia) to realize this, accept it, and resume living their lives without worrying too much about death.

I think there are other tie-ins to Exorcist-like themes as well, such as the random wedding-proposal from Beetlejuice to Lydia, which in a movie like the Exorcist would be painted as a horrifying act by Beelzebub which co-opts an innocent girl as the Devil's Bride forever, and mortals are helpless to resist, mwahahaha, but in Beetlejuice it's a clownish affair which the characters successfully fight off by playing by the rules and eventually by ramming Beetlejuice with a toy car and then a sand worm. Beetlejuice/the Devil has more powers than the Maitlands have, but ultimately he's just one pervy creep and he can be vanquished.

Also, Juno's line about Beetlejuice being her ex-assistant who's now been fired makes more sense in this context: Juno is a thematic stand-in for God, and Beetlejuice getting fired = Lucifer's fall from heaven.

Anyway, no wonder the ending always seemed abrupt and random to me, and no wonder I always enjoyed the movie anyway! I already bought into that premise from the very beginning. It was preaching to the choir all along, in my case. But now I understand the Exorcist-like viewpoint it was trying to disprove.

-Max

 --

I could not love thee dear, so much,
Loved I not honor more.