Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - shala

#1
Tools / [Tool] Tech Tree Graph Generator
November 08, 2014, 05:56:14 AM
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]
#2
Hi
I tried this mod out last night, and was somewhat overwhelmed by the size and complexity of tech tree...
I saw that the tech tree image is not up to date (this one http://i.imgur.com/6oR8D9I.jpg is from version 2.8, and the current version is 3.2.5). So I wanted to make a sketch of the current tech tree, but that's not really doable by hand. What I ended up doing is writing a python script, that parses ResearchProjectDefs, ThingDefs and TerrainDefs, and in the end generates a graph from that information. The parsing might not be perfect, some things might be wrong or missing, but I hope it helps some people understand it a bit better. ;D



The name of the research project is the first line in the box, in parentheses is the cost, and the next lines are "Things" or "Terrains" that require this research project to be finished before they can be built.