Hi,

It is theoretically possible to calculate the mathematical solution to a gamebook or a serie of gamebooks if:

1) the mathematical problem is well defined (no paradoxal situation, nothing left to interpretation),

2) enough computational space and time are available.

1) There are some paradoxal situations and things left to interpretation in Lone Wolf gamebooks:

Before attempting to do a walkthrough, you'll have to precisely define which actions you can undertake in each situation and the consequences of each action.

2) The main problem is the size of the system:

You can reduce it by manually analyzing the gamebook and discarding all actions having a zero probability of having any beneficial effect.

Then you can theoretically solve the system as a Markov decision process (MDP).

States, actions, and transitions can quite easily be defined by analyzing the gamebook and having a few notions of maths.

You'll then have to use one of the "value iteration" or "policy iteration" algorithms with:

- a discount of 1,

- a reward of 1 for any transition leading to the target section (20-350 here) from another section (20-52 or 20-108 here),

- a reward of 0 for any other transition.

I tried this method for the FF "House of Hell" gamebook because it contains many paths you can manually discard.

As an example, I provide the flowchart I obtained after having discarded all actions having a zero probability of having any beneficial effect:

FF10.pdf (74.4 KB).

However, even that small reduced gamebook is represented by a 2.5 GB database containing a table of 10,854,611 states and a table of 22,650,453 transitions.

It took several hours for my computer to generate the database.

Then it took several weeks (24/7) for the computer to solve the system.

I don't know how much space and time it would take for the first 20 Lone Wolf books (might require a supercomputer).