Lone Wolf story graph

Update 2018/06: added GEXF export for exploring the graph with other tools, added Side-by-Side reading of the text and graph

Few days ago Joe Daver of the Lone Wolf fame passed away, what a pity, it was an enjoyable type of book when I was a child. Since several years Project Aon is freely publishing his works in a browsable way.

Project Aon provides a graph representation of the books (e.g. here) but I wanted to have my twist as remembrance.

I have prepared a browsable story graph of the first 7 books, highlighting deaths, combats, quiz nodes, looping edges and death probability. In particular I have create also one single view with all these 7 books that gives an impression of the flow at glance.

Legenda

Click on the nodes to get to the page.
Nodes:
  • Orange octagons are fighting situations. 
  • Red cut circles are deadly situations.
  • Sommerswerd mention is in magenta
  • Start and End are in green
Edges:
  • Looping edges have special arrow
  • Edges are colored by death probability (only DAG graphs)
  • Edge label is the death probability (only DAG graphs)
  • Bold edge means shortest path
  • Dashed edges means subject to random pick

Graphs

All books 1-7: PDFSVG . Title is on top of each columns.



Reading Side-by-Side

In side-by-side it is possible to sync the book view with the graph and vice-versa. It works only on Chrome.


Separate books

  1. Flight from the Dark (side-by-sidePDF, SVG, book, GEXF)
  2. Fire on the Water (side-by-sidePDF, SVG, book, GEXF) - initial part structured
  3. The Caverns of Kalte (side-by-sidePDF, SVG, book, GEXF) - loopy, two ending branches
  4. The Chasm of Doom (side-by-sidePDF, SVG, book, GEXF) - long simple structure
  5. Shadow on the Sand (side-by-sidePDF, SVG, book, GEXF) - two large shortcuts
  6. The Kingdoms of Terror (side-by-sidePDF, SVG, book, GEXF) - simple structure
  7. Castle Death (side-by-sidePDF, SVG, book, GEXF) - branches, articulated structure

Graph Processing

Graph computing can be used for some statistics:
  • Loopy edges
  • Shortest path - Dijkstra
  • Total number of paths, only if the are able to remove all loops. There are issues with books 2 and 6 for which they have been fixed manually. The algorithms requires topological sort
Note that the shortest is path is purely topological and there is no verification that is had conflicting dependencies (e.g. disciplines) or it has major side effects (e.g. loss and not recovery of the inventory).

Random based edges have been excluded from shortest path computation. If there is no possibility of shortest path we have highlighted with a negative sign.



BookShortest PathTotal Paths
1307023366699464
271 (R)384775507967329330790400
336 (R)8821161258410880000
455 (R)95368579164278784000
566 (R)542718250726171907017716793344000
675380805460076762077593600000
7415960660788645334323200

Given the DAG version of the story it is possible to compute the death probability of a path by starting from the tails (0 for winning, 1 for death). We propagate the death probability up based on the possibility of taking a path: we consider uniform possibility for regular path, and instead interval probability for the random paths. In addition if we pass by a node we make sure that probability is at least 50%. Finally the probability is colored with a colormap "cool".

We can combine shortest path and death probability to understand how death probabilities goes in the shortest path. The asterisk is a combat situation.




Some notes about structure as it emerges from graph and from memories of reading:
  1. In book 1 there is a path without fight nor random
  2. Book 3 is the only one with a failing end without death. There is a full branch of many nodes that gives this outcome. 
  3. Book 5 has a quiz, needed to add a custom connection between sections

Code

The code for extraction and generation is on github. It's based on Python with graphviz and networkx. You are welcome to reuse it.

The concept is that we first extract graph structure and semantics from the HTML files, then apply graph processing techniques and then generate the visualizations.

Ideas

Ideas for improvement on visualization:
  • associate event to nodes with icons
  • track magic items acquisition and use
  • use lightbox with page content instead of new page
Ideas for graph theory analysis:
  • weight nodes by fight relevance / other events and perform other path search
  • if the resolution always has a random path, then compute multiple shortest path by split the graph in parts and look from start to random page and then to end
  • highlight VIP nodes
  • prune edges based on conditions (e.g. disciplines, or objects)
  • identify connected components (sub-stories)
  • solve the removal of cycle problem that prevents the computation of total paths

Graphs and Research

While this is just for fun, I worked on graph analysis applied to Technology Trajectories based on citations among patents.




Comments

Popular Posts