“Theory of Fun for Game Design” by Ralph Koster is a nonfiction textbook published by O’Reilly Media in 2004. Focusing on the subject of games and puzzles, this trade paperback book delves into the design principles behind engaging and successful gameplay.