Visualizing the tech tree
- SirDamnALot
- Posts: 228
- Joined: Thu Mar 10, 2016 5:10 pm
- Location: Germany
Visualizing the tech tree
I was playing around with the tech tree file and wrote a little knick knack to make an actual tree out of the lists.
Written in Delphi, because I don't know squat about Lua
7-Zip
http://www.fastshare.org/download/SiS_TechTree_Visu_01..7z
Alternate zip
http://www.fastshare.org/download/SiS_TechTree_Visu.zip
Unzip the file in your SiS directory (where sis.exe is) and run it. It should find the tech tree file from there on its own.
You can snoop around the techs and see their descendands and requirements, but that is not the actual purpose. The real work is the TechTree.png it should have written in your game directory:
(Zoomed out) It is not very easy to read (many cross dependencies between science fields) but I had fun writing the thing
Written in Delphi, because I don't know squat about Lua
7-Zip
http://www.fastshare.org/download/SiS_TechTree_Visu_01..7z
Alternate zip
http://www.fastshare.org/download/SiS_TechTree_Visu.zip
Unzip the file in your SiS directory (where sis.exe is) and run it. It should find the tech tree file from there on its own.
You can snoop around the techs and see their descendands and requirements, but that is not the actual purpose. The real work is the TechTree.png it should have written in your game directory:
(Zoomed out) It is not very easy to read (many cross dependencies between science fields) but I had fun writing the thing
- sven
- Site Admin
- Posts: 1621
- Joined: Sat Jan 31, 2015 10:24 pm
- Location: British Columbia, Canada
- Contact:
Re: Visualizing the tech tree
Very cool! My version of 7zip is having trouble with that archive, so I can't actually test out the program. But, as I developer, having players who are excited enough about the game to build these kinds of mods and addons suggests that we are indeed on the right trackSirDamnALot wrote:I was playing around with the tech tree file and wrote a little knick knack to make an actual tree out of the lists.
Written in Delphi, because I don't know squat about Lua
http://www.fastshare.org/download/SiS_TechTree_Visu_01..7z
edited by sven: Got it working! I think the problem may have actually had to do with an interaction between fastshare.org and chrome.
From the screenshot, it looks like your Delphi script may be having some trouble parsing the @TECHNOLOGY.lua file (there is no tech in the game called 'haduir' ). I could write a little hack to output the core tech tree directed acyclic graph (DAG) to some kind of easily digestible format. I actually already have one such hack written up -- as I was exporting to graphviz's DOT format for the alpha-version tech tree visualizations. We could use something other than DOT though. Is delphi happy parsing JSON?
- SirDamnALot
- Posts: 228
- Joined: Thu Mar 10, 2016 5:10 pm
- Location: Germany
Re: Visualizing the tech tree
Yeah, it stumbles a bit with the race specialities likesven wrote:Very cool! My version of 7zip is having trouble with that archive, so I can't actually test out the program. But, as I developer, having players who are excited enough about the game to build these kinds of mods and addons suggests that we are indeed on the right trackSirDamnALot wrote:I was playing around with the tech tree file and wrote a little knick knack to make an actual tree out of the lists.
Written in Delphi, because I don't know squat about Lua
http://www.fastshare.org/download/SiS_TechTree_Visu_01..7z
From the screenshot, it looks like your Delphi script may be having some trouble parsing the @TECHNOLOGY.lua file (there is no tech in the game called 'haduir' ). I could write a little hack to output the core tech tree directed acyclic graph (DAG) to some kind of easily digestible format. I actually already have one such hack written up -- as I was exporting to graphviz's DOT format of the core DAG for some of the easly alpha-version tech tree visualizations. We could use something other than DOT though. Is delphi happy parsing JSON?
Code: Select all
tech "Ancient Control Systems" | race_specific {'haduir'} {
So the haduir are a false positive.
There should be a JSON unit for Delphi, but I never used it so far.
- sven
- Site Admin
- Posts: 1621
- Joined: Sat Jan 31, 2015 10:24 pm
- Location: British Columbia, Canada
- Contact:
Re: Visualizing the tech tree
Ok, I'll think a little more about this. The fastest and easiest output format for me would probably be very simple pretty-printed Lua tables -- something where rolling a quick parser in whatever language would be easy. At a minimum, any export format would need arrays and associative tables though -- so maybe JSON is the most universally compatible option. I've written Lua\JSON table conversions before. That wouldn't be a big deal. Um, check back tomorrow. I may write up something quick before I go to bed, provided I can get all my more urgent TODOs dealt withSirDamnALot wrote:The parser is very very simple, I scan line-wise for key words like typelist or tech and go from there with the single quotes for the name.
So the haduir are a false positive.
There should be a JSON unit for Delphi, but I never used it so far.
- sven
- Site Admin
- Posts: 1621
- Joined: Sat Jan 31, 2015 10:24 pm
- Location: British Columbia, Canada
- Contact:
Re: Visualizing the tech tree
Oh, and also, just because I didn't say so loudly before -- very nice work with the graph formatting. Fully automated graph visualization is hard to do well, and the outputs you're getting look way nicer than the graph-viz images I was generating back in the day. So kudosSirDamnALot wrote:It is not very easy to read (many cross dependencies between science fields) but I had fun writing the thing
- SirDamnALot
- Posts: 228
- Joined: Thu Mar 10, 2016 5:10 pm
- Location: Germany
Re: Visualizing the tech tree
Oh thats cool I hope I am not distracting you too much, I can update the parsing part from my side too.sven wrote:Ok, I'll think a little more about this. The fastest and easiest output format for me would probably be very simple pretty-printed Lua tables -- something where rolling a quick parser in whatever language would be easy. At a minimum, any export format would need arrays and associative tables though -- so maybe JSON is the most universally compatible option. I've written Lua\JSON table conversions before. That wouldn't be a big deal. Um, check back tomorrow. I may write up something quick before I go to bed, provided I can get all my more urgent TODOs dealt withSirDamnALot wrote:The parser is very very simple, I scan line-wise for key words like typelist or tech and go from there with the single quotes for the name.
So the haduir are a false positive.
There should be a JSON unit for Delphi, but I never used it so far.
(e.g. reading parts & hulls and other tech upgrades from the tech tree file)
Thanks! As a "tool" guy, my visual stuff looks mostly terriblesven wrote:Oh, and also, just because I didn't say so loudly before -- very nice work with the graph formatting. Fully automated graph visualization is hard to do well, and the outputs you're getting look way nicer than the graph-viz images I was generating back in the day. So kudosSirDamnALot wrote:It is not very easy to read (many cross dependencies between science fields) but I had fun writing the thing
(I've written an unit editor for the game Naval Warfare: Arctic Circle and a combat helper tool for the pen & paper RPG shadowrun 5.
And they all look terrible )
- sven
- Site Admin
- Posts: 1621
- Joined: Sat Jan 31, 2015 10:24 pm
- Location: British Columbia, Canada
- Contact:
Re: Visualizing the tech tree
Ok, here's a super-simple pretty-printed version of the internal TECHNOLOGY table. It takes out all the shorthand and functional programming tricks in ~TECHNOLOGY.lua, and just gives you the raw data. (This takes about 10 seconds for me to export.)SirDamnALot wrote:Oh thats cool I hope I am not distracting you too much, I can update the parsing part from my side too.sven wrote: Ok, I'll think a little more about this. The fastest and easiest output format for me would probably be very simple pretty-printed Lua tables -- something where rolling a quick parser in whatever language would be easy. At a minimum, any export format would need arrays and associative tables though -- so maybe JSON is the most universally compatible option. I've written Lua\JSON table conversions before. That wouldn't be a big deal. Um, check back tomorrow. I may write up something quick before I go to bed, provided I can get all my more urgent TODOs dealt with
(e.g. reading parts & hulls and other tech upgrades from the tech tree file)
Let me know how Delphi feels about parsing that. If I can get 20 minutes to mess around, I can output a JSON version of the same table. Also, if there are other internal tables you'd like access to, I could write a little hack that would tell sis.exe to dump arbitrary internal data table to JSON/Lua, if given certain command line-options, potentially opening up a whole world of unix-style utility hacks, for those of you inclined to write such things
- sven
- Site Admin
- Posts: 1621
- Joined: Sat Jan 31, 2015 10:24 pm
- Location: British Columbia, Canada
- Contact:
Re: Visualizing the tech tree
And here's a JSON encoding. It's worth being aware that JSON only supports string keys in its assosiative arrays, while Lua allows you to mix integer keys with other key types, bluring the line between "arrays" and more general "tables". There are a few places where the TECHNOLOGY table includes mixed integer and string keys, specifically, the "prereq" tables, which may include a list of other tech prereqs, plus a "type" field that will be either "all_of" or "one_of", depending on the nature of the prereq.sven wrote: Ok, here's a super-simple pretty-printed version of the internal TECHNOLOGY table. It takes out all the shorthand and functional programming tricks in ~TECHNOLOGY.lua, and just gives you the raw data. (This takes about 10 seconds for me to export.)
In these cases, I've told my JSON exporter to convert the integer keys to strings, so the lua table:
Code: Select all
{
"Hadron Cohesion",
"Plasma Focusing",
"Zero-Point Energy",
type = "all_of"
}
Code: Select all
{
"1": "Hadron Cohesion",
"2": "Plasma Focusing",
"3": "Zero-Point Energy",
"type": "all_of"
}
- SirDamnALot
- Posts: 228
- Joined: Thu Mar 10, 2016 5:10 pm
- Location: Germany
Re: Visualizing the tech tree
Thanks! The TECHNOLOGY.table looks super easy to read for a line parsersven wrote: Ok, here's a super-simple pretty-printed version of the internal TECHNOLOGY table. It takes out all the shorthand and functional programming tricks in ~TECHNOLOGY.lua, and just gives you the raw data. (This takes about 10 seconds for me to export.)
Let me know how Delphi feels about parsing that. If I can get 20 minutes to mess around, I can output a JSON version of the same table. Also, if there are other internal tables you'd like access to, I could write a little hack that would tell sis.exe to dump arbitrary internal data table to JSON/Lua, if given certain command line-options, potentially opening up a whole world of unix-style utility hacks, for those of you inclined to write such things
Happy to hear that this can be an easy by-product for the engine =)
Maybe I can do an update to my tool this weekend.
- SirDamnALot
- Posts: 228
- Joined: Thu Mar 10, 2016 5:10 pm
- Location: Germany
Re: Visualizing the tech tree
Sorry for my late reply, I've been quite busy with work and stuff.
But at least I can give a little update:
http://www.fastshare.org/download/SiS_TechTree_Visu_02..7z
Unlocked Designs, Parts, etc are shown in the diagram.
But at least I can give a little update:
http://www.fastshare.org/download/SiS_TechTree_Visu_02..7z
Unlocked Designs, Parts, etc are shown in the diagram.
- Captainspire
- Posts: 153
- Joined: Mon Mar 30, 2015 8:30 pm
Re: Visualizing the tech tree
Would it be alright if I tried to make it all pretty and graphical?
- SirDamnALot
- Posts: 228
- Joined: Thu Mar 10, 2016 5:10 pm
- Location: Germany
Re: Visualizing the tech tree
By all means, go nuts =)Captainspire wrote:Would it be alright if I tried to make it all pretty and graphical?
Here is my project folder in case that helps:
http://www.fastshare.org/download/SiS.zip