
Teeny Tiny Mansion: text adventure game formally proven to have no dead ends - JoshTriplett
http://svn.clifford.at/handicraft/2017/tttm/README
======
acomjean
Isn't avoiding dead ends one of the reasons you use a puzzle dependency chart?

[http://grumpygamer.com/puzzle_dependency_charts](http://grumpygamer.com/puzzle_dependency_charts)

I always think of finite state automata, but these adventure games with all
the different inventory and actions can be remarkably hard to model.

~~~
Jtsummers
That's related, but not the same. The dependency chart isn't showing the set
of all possible player actions (though it can grow to that). And then, unless
it's implemented formally, as described in the article it's a design tool, and
not a formal tool. So you could leave out things (unintentionally).

For instance, if you don't model that the player can drop an object after
finding it, you can't guarantee that they'll have it when they need it. So,
using the original post's game, Alice needs the red key to get to the red room
(final goal). Let's say it was in the west room, also with the green key,
where Alice begins the game. She grabs the green key, goes east, hands it to
Bob who heads west. Now Alice cannot move. This particular game is solvable
because Bob can grab the red key and take it to Alice, but not every game
permits this recovery action. Supposing it only had the one player character,
and the keys were consumable (as happens in some games). She has no way to
return.

The dependency chart only shows that she _can_ solve the puzzle, not that she
can _always_ solve the puzzle (that there exists a path, not for all paths),
until it gets a lot more detail than a hand-drawn graph is likely to get.

~~~
zeta0134
This is an excellent thing to think about when designing dungeons or
encounters in any game really. I feel the need to call out Mark Brown, who's
doing an excellent analysis series on the Legend of Zelda series, breaking
down the dependencies in the dungeons throughout that game and walking through
some of the issues present within.

One of the more notorious dungeons in the series is the Water Temple in
Ocarina of Time, which contained a sequence that would allow the player to use
a small key for an optional area that, critically, did not refund the small
key. This allowed the player to become permanently stuck, unable to advance
through the dungeon and complete the game.

[https://www.youtube.com/watch?v=6LO8Z1DkDqc&index=3&list=PLc...](https://www.youtube.com/watch?v=6LO8Z1DkDqc&index=3&list=PLc38fcMFcV_ul4D6OChdWhsNsYY3NA5B2)

~~~
writeslowly
I tried to find more information on this and the best thing I could find was
this blog post claiming that you can't get permanently stuck in the Water
Temple (at least, by using keys in the wrong order).

It looks like the dungeon is set up with a few carefully designed chokepoints
using the water level mechanics to stop players from going too far down the
wrong path:

[http://blog.breakingzelda.com/2013/03/the-water-temple-
myth-...](http://blog.breakingzelda.com/2013/03/the-water-temple-myth-
part-2.html)

Unfortunately, the author also claims there is an alternate way to ruin your
game in the water temple that they'll cover in a follow-up article, but that
article doesn't exist.

------
nathan_f77
I found this incredibly interesting. I need to play with CBMC [1] sometime.
I've always been fascinated by the idea of perfect programs, because so much
of my time is spent tracking down bugs. And because so much of my PII and
finances depend on software that is decidedly not perfect.

I would like to know more about how this works:

> The formal verification tool effectively runs this function with all
> possible seed values and checks if the assert() is violated in any of the
> cases. But it uses a more much efficient method to accomplish this than
> running the function 2^32 (approximately 4 billion) times.

Or are the "prove_" functions some sort of DSL that don't actually get
executed as ordinary C code?

[http://www.cprover.org/cbmc/](http://www.cprover.org/cbmc/)

~~~
jepler
cbmc doesn't execute C(++) programs, but rather it turns them into instances
of the SAT problem, which it then passes off to a SAT prover to (hopefully)
prove it. It's assert() (and assume() and nondet_xxx() which are not mentioned
in the article) that have special powers in cbmc, but functions name
prove_xxx() aren't special as far as I'm aware.

------
komali2
Not about the game:

What was the point of publishing this information in such a non-functional
format? Is this an example of minimalism taken too far (not even an anchor tag
for the twitter link) or is this some publishing standard I'm not aware of?

I feel like the document could have benefited a great deal from some simple
font color styling. I guess in its current format it can easily be copy-pasted
somewhere else and still look exactly as it does?

~~~
zellyn
It appears to be a direct link to a README in a subversion repository. Are you
arguing that all README files should be markdown or something?

[http://www.clifford.at/svninfo.html](http://www.clifford.at/svninfo.html)

~~~
sgustard
Here you go, a markdown-formatted version of the article.

[https://markdownshare.com/view/bc431de6-16e7-44db-
ad52-705a2...](https://markdownshare.com/view/bc431de6-16e7-44db-
ad52-705a2c0618c9)

~~~
lucio
seeing that, I still prefer the plain text, unprocessed MD

------
mrfusion
Not to be too off topic but are there any good text adventure games for
someone learning to read. 2nd grade level.

I'm thinking that would be a great way to naturally practice reading
comprehension since it forces you to think about what you read.

~~~
tsomctl
Dead tree version:
[https://www.amazon.com/R.-A.-Montgomery/e/B000APRDHS/ref=dp_...](https://www.amazon.com/R.-A.-Montgomery/e/B000APRDHS/ref=dp_byline_cont_book_1)

Edit: Looks like you're better off buying them used off eBay.

~~~
lsaferite
On an only mildly related note (as a lover of CYOA books):

[https://boardgamegeek.com/boardgame/169984/stowaway-52](https://boardgamegeek.com/boardgame/169984/stowaway-52)
[https://boardgamegeek.com/boardgame/192729/jump-
ship](https://boardgamegeek.com/boardgame/192729/jump-ship)

------
sblom
Andrew Plotkin (aka Zarf) wrote and published PlotEx[1] while working on
Hadean Lands.

[1] [http://eblong.com/zarf/plotex/](http://eblong.com/zarf/plotex/)

------
Retr0spectrum
Is this technique scalable to more complex games?

~~~
JoshTriplett
Depends on what you mean by "more complex". This uses cbmc, a formal model
checker that runs relatively fast, and that doesn't require writing
excessively complex formalisms to ask "is this state reachable". The README
mentions a variation on this approach that scales to larger games.

Now, if you built a game isomorphic to a traveling salesman problem, or other
exponential problem, then the model checker might have a problem with that.
But so would a human; such a game would get extremely tedious. So, I'd venture
as far as "this should scale to adventure games that humans enjoy playing".

~~~
mjn
Even embedded exponential problems can be fine, since existing solvers in the
SAT/SMT/ASP/etc. family working on finite domains like these can usually
heuristically solve them in reasonable time.

I did some work on formally modeling game mechanics in answer-set programming
[1] for a prototyping system a few years ago [2], and in my case model size
rather than complexity was almost always the bottleneck. And the biggest
model-size culprit was just numerical stuff. If you have a game with a lot of
numerical state variables (e.g. health of units), you get big explosions in
the size of the state space, which even when the queries are trivial, end up
taking the solver longer just to _construct_ the space than solving complex
problems in smaller state spaces does. By contrast very discrete-type games
(that don't involve a lot of numerical status meters) worked great, even if
they have a complex logical structure and you have complex questions to ask
about their possibility space. However if you do have a numerically heavy
game, SMT solvers can handle that too (the "modulo" part of satisfiability
modulo theories can factor out things like the "theory of integers"). In my
case I used ASP, specifically the Potassco suite [3], because imo the modeling
language is friendlier, especially for incremental modeling, and I was more
interested in investigating expressivity than scaling at the time.

[1]
[https://en.wikipedia.org/wiki/Answer_set_programming](https://en.wikipedia.org/wiki/Answer_set_programming)

[2] Some papers:
[http://www.kmjn.org/publications/Mechanics_AIIDE08-abstract....](http://www.kmjn.org/publications/Mechanics_AIIDE08-abstract.html),
[http://www.kmjn.org/publications/Playtesting_AIIDE09-abstrac...](http://www.kmjn.org/publications/Playtesting_AIIDE09-abstract.html),
[http://www.kmjn.org/publications/Ludocore_CIG10-abstract.htm...](http://www.kmjn.org/publications/Ludocore_CIG10-abstract.html)

[3] [https://potassco.org/](https://potassco.org/)

~~~
forgotpwtomain
It occurs to me that there should be some kind of strategy that allows for
simplified computation of numerical state variables though? Since in a lot of
cases the value being within a certain range is more important than it's exact
amount (e.g. HP > max damage of a single blow, or of MP is >= spell cost).
Intuitively I'd probably want to try some kind probability-density function to
represent numerical stats.

~~~
Sunset
You can even go with something like: Can the player cast >n spells. Or Is the
players Average DPS > Boss's HP regen per second. Without having to care about
the exact numbers.

------
a1studmuffin
Very novel approach! I can't see this scaling to the scope of most modern
games though. Eventually it always comes back to an army of QA testers.

------
bluetwo
Related question: Do you think an all text MOOC would find a following?

~~~
wodenokoto
isn't that what Codecademy is?

~~~
bluetwo
I actually meant to ask about MMOGs. Sorry.

~~~
CogDisco
You mean MUDs or MOOs?

~~~
bluetwo
I guess I do.

~~~
macintux
They were huge in the late 80s/early 90s (at least, huge relative to the
overall Internet population).

I imagine it's harder to find an active one now, but even a "dead" one that's
still online should be somewhat playable. Just harder to learn and advance
without other players.

------
sharpercoder
I remember trying so hard when I was a little kid to learn english and move on
in any textbased game. I always failed. So I guess it's still easy to have
dead ends in textbased games ;)

------
anodin3
I've never played any text adventure games, do they usually have dead ends?

~~~
throwaway7645
It depends. It's more likely in the older ~80's games done by poor game
writers. The great companies like Infocom and the modern games done by those
like Emily Short are excellent works of art.

~~~
LoSboccacc
You can drown in monkey island. Not exactly text only but close enough.
Wouldn't say it was poorly written

~~~
mst
I thought the rare occasions in monkey island games where you could 'die' it
basically rewound to an acceptable state before that? (IIRC the second one
even made a joke out of this with a falling off a cliff and bouncing back up
thing)

