digraph dwarffortress{layers="item:workshop";
node[style=filled, fillcolor=transparent, arrowhead=normal, arrowtail=empty];
edge[];
// **** Dwarves ****
subgraph dwarves{
node [shape=ellipse, layer=dwarf];
edge[arrowhead=empty, layer=dwarf_rel, style=dashed, label="is"];
// (dwarf:A)->(dwarf:B) means A is in the group of B
all_dwarves [label="All Dwarves", color=grey];
civilian [label=Civilian, color=grey];
civilian->all_dwarves;
military [label=Military, color=grey];
military->all_dwarves;
woodcutter[label=Woodcutter, fillcolor=yellow]; woodcutter->civilian;
carpenter[label=Carpenter, fillcolor=yellow]; carpenter->civilian;
bowyer[label=Bowyer, fillcolor=yellow]; bowyer->civilian;
miner[label=Miner, fillcolor=grey]; miner->civilian;
recruit [label=Recruit, fillcolor=grey]; recruit->military;
wrestler[label=Wrestler, fillcolor=lightgrey]; wrestler->military;
marksdwarf[label=Marksdwarf, fillcolor=green]; marksdwarf->military;
axedwarf[label=Axedwarf, fillcolor=blue]; axedwarf->military;
} //dwarves
subgraph items
{
// **** raw materials ****
node [shape=trapezium, layer="item,resource", style="filled,bold" ];
wood [label=Wood];
ore [label=Ore];
stone [label=Stone];
metal [label=Metal];
gem [label="Rough Gem"];
// **** items ****
node [shape=box, layer=item, style="filled,bold"];
edge[layer=item, label="makes", arrowhead=normal, arrowtail=diamond, style=bold];
// (item:A)->(item:B) means A makes B
furniture[label=Furniture];
crossbow[label=CrossBow];
battleaxe[label="Battle Axe"];
pick[label=Pick];
// **** what makes what ****
wood->furniture;
wood->crossbow;
stone->furniture;
ore->metal;
metal->furniture;
metal->crossbow;
metal->battleaxe;
metal->pick;
} // items
// **** Item consumption *** (Who uses what)
subgraph
{
edge[arrowhead=olnormal, layer=item_usage, style=dashed, label="used by"];
// (item:A)->(dwarf:B) means item A is used by dwarf B
crossbow->marksdwarf;
battleaxe->axedwarf;
battleaxe->woodcutter;
pick->miner;
furniture->all_dwarves;
}
// **** Workshop ****
subgraph
{
node [shape=house, layer=workshop, style="filled"];
carpenter_workshop[label="Carpenter's Workshop", fillcolor=yellow];
bowyer_workshop[label="Bowyer's Workshop", fillcolor=yellow];
}
// **** Workshop<->Item relation
subgraph
{
// Workshop input
subgraph{
edge[arrowhead=normal, layer="workshop_item", label="is input to"];
// (item:A)->(workshop:B) means that item A is input to workshop B
wood->carpenter_workshop;
wood->bowyer_workshop;
}
// Workshop output
subgraph{
edge[arrowhead=normal, layer="workshop_item", label="outputs"];
// (workshop:A)->(item:B) means that workshop A outputs item B (via some process)
carpenter_workshop->furniture;
bowyer_workshop->crossbow;
}
}
// **** Process ****
subgraph processes{
node[shape=parallelogram, layer=process, style="filled,dashed"]
// mining processes
subgraph {
node[fillcolor=grey];
dig[label="Dig"];
}
// wood processing
subgraph {
node[fillcolor=yellow];
cut_wood[label="Cut Wood"];
make_wooden_crossbow[label="Make Wooden crossbow"];
make_wooden_furniture[label="Make Wooden Furniture"];
wooden_construction[label="Wooden Construction"];
}
} // processes
// Process Worker
subgraph {
edge[arrowhead=vee, layer=proc_worker, style=dotted, label="do"];
// (dwarf:A)->(process:B) means A does B
woodcutter->cut_wood;
carpenter->make_wooden_furniture;
carpenter->wooden_construction;
bowyer->make_wooden_crossbow;
miner->dig;
}
// Process Workshop
subgraph
{
edge[arrowhead=crow, layer=proc_workshop, style=dotted, label="at"];
// (workshop:A)->(process:B) means process B is carried out at workshop A
carpenter_workshop->make_wooden_furniture;
bowyer_workshop->make_wooden_crossbow;
}
// Process Item requirement (not consumed)
subgraph
{
edge[arrowhead=normal, style=dashed, layer=proc_require, label="is required to"];
// (item:A)->(process:B) means item A is required in process B (but not consumed)
battleaxe->cut_wood;
pick->dig;
}
// Process Consumption
subgraph
{
edge[arrowhead=normal, layer=proc_consume, label="is used to"];
// (item:A)->(process:B) means item A is consumed in process B
wood->wooden_construction;
wood->make_wooden_furniture;
wood->make_wooden_crossbow;
}
// Process Production
subgraph
{
edge[arrowhead=vee, layer=proc_produce, label="produces"];
// (process:A)->(item:B) means process A produces item B
cut_wood->wood;
make_wooden_furniture->furniture;
make_wooden_crossbow->crossbow;
dig->stone;
dig->ore;
dig->gem;
}
} // dwarffortress