[Tool] Tech Tree Graph Generator

Started by shala, November 08, 2014, 05:56:14 AM

Previous topic - Next topic

shala

I wrote this tool for the TechTreeMinami mod version 3.2 for Rimworld version 7, but it should also work for other mods, or mod packs.

It consists of a python script, that parses through the files in ResearchProjectDefs, ThingDefs, and TerrainDefs directories, and generates output in the *.dot format.

Instructions
1. Download the script form the attachment. Modify the MOD variable to contain all of the folder names of the mods you want included, in their correct load order. The script expects to be run inside the Rimworld<version> folder, but you can change that by modifying MODS_PATH.
2. Make sure you have something to render the *.dot file, under Linux/Ubuntu the functionality comes with the package graphviz.
3. Under Linux, you generate the graph like this:

$ python tech_tree.py > tech_tree.dot
$ dot -Tpng tech_tree.dot > tech_tree.png


Notes
1. I only tested this under Linux, modifications might be needed for other OSes.
2. If there are errors while parsing, those can be found in the *.dot file (they are commented out, to not affect the rendering).

I hope some of you will find this useful :D
Cheers
Shala

[attachment deleted by admin: too old]