Modeling gameplay in Celf, Part 3
(This is another iteration of the example I developed in Part 1 and Part 2 , but barring incrementally understanding the code, I think this post is relatively self-contained. Celf-contained, if you will.) When I took a simple choice-based ("CYOA") game with a few bits of inventorial state and tried to add handles onto the rules so as to specify a specific sequence of player choices, something interesting happened: I had to make new decisions about which parts of the game the player could control, and how. For instance, whether they win or get eaten by a grue depends on a prior choice to take the lamp from the den or not; they cannot control their fate after that point. This makes clear that "getting the lamp" and "opening the door" are player-facing game controls, whereas "getting eaten by a grue" is a choice made by the game. We wound up enumerating those actions as follows. 'start : action. 'opendoor : action. 'getlamp : a