Dungeons, Dragons and Functions
summary
Encodes Dungeons & Dragons rules into F# using algebraic data types to model abilities, attacks and reach, builds a DSL for dice (roll expressions, operators and a recursive evaluator), and implements a combat simulator compiled to JavaScript with Fable + Elmish. Uses mailbox processors to automate creature decisions, runs many simulated combats to estimate win probabilities (example: three wolves vs three goblins), confronts 300+ page PHB complexity, and plans reinforcement learning to improve AI after ~18 months of work.
AI-written summary · about
chapters (17)
- 0:00Intro
- 1:44Origin Story
- 8:12Ogres, Goblins, & Company
- 9:35Discriminated Union
- 9:54Abilities
- 10:30Pattern Matching
- 11:12Modifiers
- 16:58Pattern Match to extract data
- 20:53Wyvern attacks
- 23:44Light, Heavy Weapons
- 28:55Tomas Petricek
- 41:32What is a fair fight?
- 43:30Modeling (4)
- 51:52Scott Wlaschin
- 52:22Alternatives
- 53:28What's missing?
- 54:51Thank You! (Cast Bless)
related talks
25mPure Functions & Paladins Building TTRPGS with F# and MVU (v1)
28mPure Functions & Paladins Building TTRPGS with F# and MVU
55mF# and Fable: re-think web development
31mThe Tricks of Game Programming in a Pure Functional Language
54mWriting a MMORPG game in Elm on both client and server
01h 05mDDD, event sourcing and CQRS – theory and practice
23m"Game Development in Elm: Build Your Own Tooling"
50mFrontend in F#? Hold my beer!
