Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: Flow Chart  (Read 2448 times)

Guy

  • Bay Watcher
    • View Profile
Flow Chart
« on: November 25, 2007, 10:42:00 pm »

I decided to make a flow-chart of the dwarven industries to help me figure out where I should put workshops and stockpiles.

Flow Chart

Basically, I've connected the workshops together based on their inputs and outputs.  I've threw in a few primary industries (green) as well as a few consumers (blue).

So, what do you think?  Also, am I missing anything?

Logged

ParrotPatrol

  • Bay Watcher
    • View Profile
Re: Flow Chart
« Reply #1 on: November 25, 2007, 10:57:00 pm »

quote:
Originally posted by Guy:
<STRONG>
So, what do you think?  Also, am I missing anything?</STRONG>

A life.
Just kidding. Good work.
You could stand to make the lines different colors, or make it a vertical chart however. As is, its kind of hard to read, like one of those "follow the line puzzles".

[ November 25, 2007: Message edited by: ParrotPatrol ]

Logged

sphr

  • Bay Watcher
    • View Profile
Re: Flow Chart
« Reply #2 on: November 25, 2007, 11:08:00 pm »

another suggestion, label the edges to indicate the inputs->outputs.  you may need multiedge to represent certain things better.

also, how to represent substitutes?

lol.... demanding eh...

Guy

  • Bay Watcher
    • View Profile
Re: Flow Chart
« Reply #3 on: November 26, 2007, 12:00:00 am »

Just so people know, I generated that flow chart with Graphviz, as there's no way I'm going to figure out where to put all those bubbles.  Here's the script if you want to take a look at it.
code:
digraph G {
   size="10,10";

   wood [label="Wood", color=green];
   farms [label="Farms", color=green];
   ore [label="Ore", color=green];
   stone [label="Stone", color=green];
   livestock [label="Livestock", color=green];

   alchemist [label="Alchemist"];
   ashery [label="Ashery"];
   bowyer [label="Bowyer"];
   butcher [label="Butcher"];
   carpenter [label="Carpenter"];
   clothier [label="Clothier"];
   crafts [label="Craftsdwarf"];
   dyer [label="Dyer"];
   farmer_workshop [label="Farmer's\nWorkshop"];
   fishery [label="Fishery"];
   glass [label="Glass\nFurnace"];
   jeweler [label="Jeweler"];
   kiln [label="Kiln"];
   kitchen [label="Kitchen"];
   leather [label="Leather\nWorks"];
   loom [label="Loom"];
   magma_forge [label="Magma\nForge",color=red];
   magma_glass [label="Magma\nGlass\nFurnace",color=red];
   magma_kiln [label="Magma\nKiln",color=red];
   magma_smelter [label="Magma\nSmelter",color=red];
   mason [label="Mason"];
   mechanic [label="Mechanic"];
   metalsmith [label="Metalsmith"];
   millstone [label="Millstone"];
   quern [label="Quern"];
   siege [label="Siege\nWorkshop"];
   still [label="Still"];
   tanner [label="Tanner"];
   wood_furnace [label="Wood\nFurnace"];

   trade [label="Trade", color="blue"];
   military [label="Military", color="blue"];
   dwarves [label="Dwarves", color="blue"];

   alchemist -> trade;

   ashery -> alchemist;
   ashery -> farms;
   ashery -> kiln;
   ashery -> magma_kiln;

   butcher -> bowyer;
   wood -> bowyer;
   bowyer -> military;

   livestock -> butcher;
   butcher -> kitchen;
   butcher -> tanner;
   butcher -> crafts;

   wood -> carpenter;
   carpenter -> military;
   carpenter -> livestock;

   clothier -> military;
   loom -> clothier;
   clothier -> crafts;

   wood -> crafts;
   stone -> crafts;
   tanner -> crafts;
   crafts -> trade;
   crafts -> military;

   loom -> dyer;
   farmer_workshop -> dyer;
   millstone -> dyer;
   quern -> dyer;
   dyer -> loom;
   dyer -> clothier;

   farmer_workshop -> loom;
   farms -> farmer_workshop;
   farmer_workshop -> kitchen;
   livestock -> farmer_workshop;

   fishery -> kitchen;

   jeweler -> trade;
   glass -> jeweler;
   magma_glass -> jeweler;

   farms -> kitchen;
   still -> kitchen;
   kitchen -> alchemist;

   tanner -> leather;
   leather -> military;

   farms -> loom;

   smelter -> magma_forge;
   magma_smelter -> magma_forge;
   magma_forge -> military;
   magma_forge -> trade;

   stone -> mason;
   stone -> mechanic;

   smelter -> metalsmith;
   metalsmith -> military;
   metalsmith -> trade;

   farms -> millstone
   farms -> quern
   millstone -> kitchen
   quern -> kitchen

   wood -> siege;
   smelter -> siege;
   magma_smelter -> siege;
   siege -> military;

   farms -> still;

   wood_furnace -> ashery;
   wood -> wood_furnace;
   wood_furnace -> metalsmith;
   wood_furnace -> smelter;
   wood_furnace -> glass;
   wood_furnace -> kiln;

   ore -> smelter;
   ore -> magma_smelter;

   smelter -> smelter;
   smelter -> glass;
   smelter -> kiln;

   glass -> trade;
   magma_glass -> trade;

   kiln -> glass;
   kiln -> magma_glass;
   magma_kiln -> glass;
   magma_kiln -> magma_glass;

   farms -> dwarves;
   kitchen -> dwarves;
   still -> dwarves;
   carpenter -> dwarves;
   mason -> dwarves;
   clothier -> dwarves;
   metalsmith -> dwarves;
   magma_forge -> dwarves;
}


Logged

sphr

  • Bay Watcher
    • View Profile
Re: Flow Chart
« Reply #4 on: November 26, 2007, 04:51:00 am »

try this partial one for messiness but more complete info...
code:

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


[ November 26, 2007: Message edited by: sphr ]

taleril

  • Escaped Lunatic
    • View Profile
Re: Flow Chart
« Reply #5 on: November 26, 2007, 04:19:00 pm »

This is great.  I'd like to tinker with it a bit.  I downloaded GraphViz and tried pasting both of the above scripts(not at the same time) into a new window.  I can't seem to get an output.  What else should I do besides pasting a script in and hitting "Run"?

Thanks,
taleril

Logged

Guy

  • Bay Watcher
    • View Profile
Re: Flow Chart
« Reply #6 on: November 26, 2007, 07:36:00 pm »

Basically, you save your scripts in a text file.  When you start the Graphviz application (I use "dot") there are fields for input and output files for where you want to read from and save to.  Then you click "Do layout" and check the output window for whether any errors popped up.  If you don't want to navigate to where your output file is you can click on "View layout."
Logged

sphr

  • Bay Watcher
    • View Profile
Re: Flow Chart
« Reply #7 on: November 26, 2007, 09:13:00 pm »

quote:
Originally posted by taleril:
<STRONG>This is great.  I'd like to tinker with it a bit.  I downloaded GraphViz and tried pasting both of the above scripts(not at the same time) into a new window.  I can't seem to get an output.  What else should I do besides pasting a script in and hitting "Run"?

Thanks,
taleril</STRONG>


If you are using GVEdit...  you may solve it by using the absolute path for the graphviz bin directory in the settings dialog
for "GraphViz Bin Folder" field.

Javis

  • Bay Watcher
    • View Profile
Re: Flow Chart
« Reply #8 on: November 27, 2007, 01:35:00 am »

How about Hunting -> (corpse) -> Butcher -> (bones) -> Craftsdwarf Shop -> (bone bolts) -> Hunting

Also, I usually specialize my Craftsdwarf shops into atleast Stonecraft, Bonecrafting and Woodcrafting.

Logged

schm0

  • Bay Watcher
    • View Profile
Re: Flow Chart
« Reply #9 on: November 27, 2007, 12:58:00 pm »

Now put something equivalent (and correct, there are tons of errors and omissions in that to go into detail) on the wiki.
Logged
schm0
-------------
Nuk: lol schm0, u r da funnay
Nuk: i lik u

Merlon

  • Bay Watcher
    • View Profile
Re: Flow Chart
« Reply #10 on: November 27, 2007, 02:24:00 pm »

I seem to remember someone posting something similar some time back, allthough I think it was also incomplete. It had workshops inputs and outputs in groups and was clean and easy to read. I can't seem to find it though. Sorry for the vagueness, but does anyone still have it?
Logged