Graphs are very cool
Mar. 25th, 2008 13:22![[personal profile]](https://www.dreamwidth.org/img/silk/identity/user.png)
For the past few days, I've been monkeying around with graphviz, a suite of graph modelling tools. I stumbled across them (again) when I was installing a graphviz plug-in for the wiki I'm building, and I thought it would be good at this point to get a better handle on how the modelling tools actually work. The answer is that they work quite nicely, thank-you very much.
Soon, I'm going to be starting to play through Paizo's Pathfinder adventure path series, and since the first arc starts out in a town that's supposed to act as a home-base for the players for some time, I thought it would be useful to have a sort of relationship map (not purist) to help myself through the first half of the series. I figured that the graphviz tools could help me build this map without much hassle. Learning the DOT description language understood by the tools was not difficult at all, and after a day or two, I have a complete catalogue of the town inhabitants described in the first instalment of the series.
The relationships are sufficiently complex to cause one of graphviz's layout algorithms to throw up all over itself, but I was able to get useful diagrams from two others (neato and twopi).
Energy minimized graph (includes overlapping subgraph clusters which are not really optimal, but has minimal edge or cluster overlap, which is nice):

Radial graph (notice that the subgraph clusters are not rendered):

Here's a scrap (not the whole file) of the source for these graphs so you can see how relatively simple the DOT language is:
I recommend anyone wanting to build relationship maps for games use these tools, especially if you want to maintain your maps over a stretch of playing time to document the changing structure play (since the source language is just a text file, you can use a simple version control utility to catalog all the changes to the maps over time).
Soon, I'm going to be starting to play through Paizo's Pathfinder adventure path series, and since the first arc starts out in a town that's supposed to act as a home-base for the players for some time, I thought it would be useful to have a sort of relationship map (not purist) to help myself through the first half of the series. I figured that the graphviz tools could help me build this map without much hassle. Learning the DOT description language understood by the tools was not difficult at all, and after a day or two, I have a complete catalogue of the town inhabitants described in the first instalment of the series.
The relationships are sufficiently complex to cause one of graphviz's layout algorithms to throw up all over itself, but I was able to get useful diagrams from two others (neato and twopi).
Energy minimized graph (includes overlapping subgraph clusters which are not really optimal, but has minimal edge or cluster overlap, which is nice):

Radial graph (notice that the subgraph clusters are not rendered):

Here's a scrap (not the whole file) of the source for these graphs so you can see how relatively simple the DOT language is:
graph sandpointRelMap { // /* Major families */ // subgraph clusterKaijutsu { label="Kaijutsu family\n(glass and jewels - a49)"; fontcolor=blue; Lonjiku [label="Lonjiku\n(noble father)",fillcolor=lightblue,style=filled]; Tsuto [label="Tsuto Kaijutsu\n(maniac rogue son - a20)",shape=box,style=filled,color=red,fontcolor=yellow]; Lonjiku -- Tsuto [label="blackmail",color="red"]; Lonjiku -- Ameiko [label="estranged",color="red"]; // see a37 { rank=same; Tsuto -- Ameiko [label="kidnap",color="red"];} } subgraph clusterScarnetti { label="Scarnetti family\n(lumber - a48)"; fontcolor=blue; Alamon [label="Alamon Scarnetti\n(deceased noble)",style=dotted]; Titus [label="Titus Scarnetti\n(noble)",fillcolor=lightblue,style=filled]; Alamon -- Titus; } subgraph clusterDeverin { label="Deverin family\n(brewing - a50)"; fontcolor=blue; Amos [label="Amos Deverin\n(deceased noble)",style=dotted]; Fenchus [label="Fenchus Deverin\n(deceased noble)",style=dotted]; Kendra [label="Kendra Deverin\n(mayor - a11)",fillcolor=lightblue,style=filled,pos="0,0"]; Vana [label="Vana Deverin\n(widow)"]; Amos -- Kendra; Amos -- Fenchus; {rank=same; Fenchus -- Vana;} Kendra -- Vana [label="tense"]; Gaven [label="Gaven Deverin\n(brewer - a39)"]; Wade [label="Wade Deverin\n(brewer)",style=dotted]; {rank=same; Kendra; Gaven; Wade;} Gaven -- Wade [label="brother"]; Kendra -- Gaven [label="cousin"]; } subgraph clusterValdemar { label="Valdemar family\n(shipbuilding) - a47"; fontcolor=blue; Ethraim [label="Ethraim Valdemar\n(noble)",fillcolor=lightblue,style=filled]; Ethraim -- Belvin; // see a46 } subgraph clusterTobyn { label="Tobyn family"; fontcolor=blue; Ezakien [label="Exakien Tobyn\n(priest)",style=dotted]; Nualia [label="Nualia\n(foundling aasimar\ndevotee of Lamashtu)",shape=box,style=filled,color=red,fontcolor=yellow]; Nualia -- Ezakien [label="loathes",color="red",style=dotted]; } subgraph clusterSczarni { label="Sczarni gang"; fontcolor=blue; Jubrayl [label="Jubrayl Vhiski\n(crime boss)",fillcolor=grey,style=filled]; Jubrayl -- Gressel [label="controls"]; } // /* Important plot relationships independent of location*/ // Nualia -- Tsuto [label="controls"]; Jasper -- Cyrdak [label=lovers,color=pink]; Belor -- Kaye [label=lovers,color=pink]; Kendra -- Titus [label="rivals",color=red]; Kendra -- Casp [label="lovers",color=pink]; . . .
I recommend anyone wanting to build relationship maps for games use these tools, especially if you want to maintain your maps over a stretch of playing time to document the changing structure play (since the source language is just a text file, you can use a simple version control utility to catalog all the changes to the maps over time).
no subject
Date: 2008-03-26 02:13 (UTC)Flickr says the pictures are private.
no subject
Date: 2008-03-26 12:45 (UTC)no subject
Date: 2008-03-26 03:57 (UTC)::B::
no subject
Date: 2008-03-26 12:48 (UTC)All that worry about "how to best fit it on the page" can be placed at the proper time -- at the end. For really fine and flexible layout control, I can just import the source into OmniGraffle and then twiddle as much as I'd like.
no subject
Date: 2008-03-27 00:11 (UTC)::B::
no subject
Date: 2008-03-27 02:54 (UTC)