aliens

Author Topic: Visualize Research Tree  (Read 17996 times)

Offline hellrazor

  • Commander
  • *****
  • Posts: 2027
  • Deep Ruleset Digger & Bughunter
    • View Profile
    • Github Account
Visualize Research Tree
« on: February 17, 2015, 11:41:03 pm »
Any way to do this automatically?
Feed it a Ruleset file it creates a graphic file out of it or so?

Offline Arthanor

  • Commander
  • *****
  • Posts: 2488
  • XCom Armoury Quartermaster
    • View Profile
Re: Visualize Research Tree
« Reply #1 on: February 17, 2015, 11:44:33 pm »
Ha! That would be great. But thinking of certain mods here made me hungry for spaghetti..

Offline TheBigSot

  • Sergeant
  • **
  • Posts: 44
  • Fight, Die, Repeat.
    • View Profile
Re: Visualize Research Tree
« Reply #2 on: February 18, 2015, 04:35:08 am »
Sounds interesting make a mock up (or acknowledge the idea), and put a small some samples file, for easy programming :)

like this (but not this :P)

A- Dafa
B- Kalo
C- Coco
  * Requires Dafa


Generates:
Dafa
  \--> Coco
Kalo

Offline Brian

  • Sergeant
  • **
  • Posts: 18
    • View Profile
Re: Visualize Research Tree
« Reply #3 on: February 18, 2015, 04:27:03 pm »
I wrote programs a while back to create research trees and calculate manufacturing profitability.

The research trees were very big and convoluted, and I ended up manually pruning them a bit to eliminate irrelevant details and simplify things like "any live alien".  I think the manufacturing profitability one still has some ugly special cases in it, as I first wrote this for Piratez, and Piratez' assembly/disassembly system can lead to infinite loops.  That said, I'll post more after work (in about 8 hours).

The most profitable projects in vanilla:
Name   Profit per engineer-hr   Profit per engineer-month
Laser Cannon   $61.94   $44600.00
Fusion Ball Launcher   $46.53   $33500.00
Tank/Laser Cannon   $43.61   $31400.00
Psi-Amp   $24.68   $17768.00
Motion Scanner   $18.01   $12963.64
Medi-Kit   $9.33   $ 6714.29

In Equal Terms 1.998:
Name   Profit per engineer-hr   Profit per engineer-month
Convert Alien Heavy Plasma   $70.33   $50636.36
Pulse Laser   $55.28   $39800.00
Laser Sniper Rifle   $52.78   $38000.00
Enhanced Light Rocket   $48.61   $35000.00
Fusion Ball Launcher   $46.53   $33500.00
Enhanced APFSDS Rocket   $45.28   $32600.00
Tank/Laser Cannon   $43.61   $31400.00
Laser Marksmans Rifle   $40.28   $29000.00
Laser Assault Rifle   $38.01   $27363.64
Grenade ^   $31.94   $23000.00
Sniper Plasma   $28.61   $20600.00
Laser LMG   $26.39   $19000.00
Magnum Laser   $25.28   $18200.00
Laser Pistol   $25.28   $18200.00

For Piratez, my output looks silly right now (going to have to look at it after work), but all of these are much more profitable than Finely Distilled Rum:
Drakkar
Crab
Hunter-Killer
(Likely most tanks)
Ripper Cannon
ARG Clip (24x10)
Royal Boomersaurus Steak x5
Heavy Flamer Clip (5x5)
Fried Reaper Innards x5
« Last Edit: February 18, 2015, 04:32:52 pm by Brian »

Offline kikimoristan

  • Commander
  • *****
  • Posts: 647
    • View Profile
Re: Visualize Research Tree
« Reply #4 on: February 18, 2015, 05:30:24 pm »

Offline kikimoristan

  • Commander
  • *****
  • Posts: 647
    • View Profile
Re: Visualize Research Tree
« Reply #5 on: February 18, 2015, 05:33:09 pm »
I wrote programs a while back to create research trees and calculate manufacturing profitability.

May I use that program? Or is it online? I wanna visualize my mod's new tech see if it looks good. : -)

Offline Brian

  • Sergeant
  • **
  • Posts: 18
    • View Profile
Re: Visualize Research Tree
« Reply #6 on: February 19, 2015, 02:58:47 am »
Send me your ruleset and I'll make a diagram for you.

It was throwaway code... I'll release it once I've cleaned it up a bit. ;)

Offline TheBigSot

  • Sergeant
  • **
  • Posts: 44
  • Fight, Die, Repeat.
    • View Profile
Re: Visualize Research Tree
« Reply #7 on: February 20, 2015, 05:47:19 am »
Hope this helps. It runs on framework 3.5

Offline ivandogovich

  • Commander
  • *****
  • Posts: 2381
  • X-Com Afficionado
    • View Profile
    • Ivan Dogovich Youtube
Re: Visualize Research Tree
« Reply #8 on: February 20, 2015, 06:39:06 am »
Sweet work, TheBigSot!  Works great! :D

Offline hellrazor

  • Commander
  • *****
  • Posts: 2027
  • Deep Ruleset Digger & Bughunter
    • View Profile
    • Github Account
Re: Visualize Research Tree
« Reply #9 on: February 20, 2015, 12:53:56 pm »
Sweet work, TheBigSot!  Works great! :D

I will prefer vim anyway over this (at least for editing)
I know there are ways to create graphical files from a specific input but how ...
So i guess i am stuck with manually doing diagrams with dia. (which works wonderful)

Offline TheBigSot

  • Sergeant
  • **
  • Posts: 44
  • Fight, Die, Repeat.
    • View Profile
Re: Visualize Research Tree
« Reply #10 on: February 23, 2015, 01:51:22 pm »
Yea the Diagram looks nice.

I added costs to the Ruleset View, I may add some other changes later.

The average cost per hour for an engineer is set to '34.72'

GL HF

Offline kikimoristan

  • Commander
  • *****
  • Posts: 647
    • View Profile
Re: Visualize Research Tree
« Reply #11 on: March 02, 2015, 09:23:09 am »
i'm having issues with this last version the other one worked on my rulset but this one doesn't gives me something bad has happened error. :D

Offline myk002

  • Colonel
  • ****
  • Posts: 227
    • View Profile
Re: Visualize Research Tree
« Reply #12 on: March 21, 2015, 01:13:13 am »
same for me -- parsing the final mod pack works on the first (61K) version, but fails on the more recent (387K) version.  Now I'm seeing:
Code: [Select]
Unhandled Exception:
YamlDotNet.Core.YamlException: (Line: 26839, Col: 7, Idx: 631768) - (Line: 26839, Col: 7, Idx: 631768): Expected 'MappingStart', got 'SequenceStart' (at Line: 26839, Col: 7, Idx: 631768).  at YamlDotNet.Core.EventReader.Expect[MappingStart] () [0x00000] in <filename unknown>:0
  at YamlDotNet.Serialization.NodeDeserializers.GenericDictionaryNodeDeserializer.YamlDotNet.Serialization.INodeDeserializer.Deserialize (YamlDotNet.Core.EventReader reader, System.Type expectedType, System.Func`3 nestedObjectDeserializer, System.Object& value) [0x00000] in <filename unknown>:0
  at YamlDotNet.Serialization.ValueDeserializers.NodeValueDeserializer.DeserializeValue (YamlDotNet.Core.EventReader reader, System.Type expectedType, YamlDotNet.Serialization.Utilities.SerializerState state, IValueDeserializer nestedObjectDeserializer) [0x00000] in <filename unknown>:0

  at YamlDotNet.Core.EventReader.Expect[MappingStart] () [0x00000] in <filename unknown>:0
  at YamlDotNet.Serialization.NodeDeserializers.GenericDictionaryNodeDeserializer.YamlDotNet.Serialization.INodeDeserializer.Deserialize (YamlDotNet.Core.EventReader reader, System.Type expectedType, System.Func`3 nestedObjectDeserializer, System.Object& value) [0x00000] in <filename unknown>:0
  at YamlDotNet.Serialization.ValueDeserializers.NodeValueDeserializer.DeserializeValue (YamlDotNet.Core.EventReader reader, System.Type expectedType, YamlDotNet.Serialization.Utilities.SerializerState state, IValueDeserializer nestedObjectDeserializer) [0x00000] in <filename unknown>:0
[ERROR] FATAL UNHANDLED EXCEPTION: YamlDotNet.Core.YamlException: (Line: 26839, Col: 7, Idx: 631768) - (Line: 26839, Col: 7, Idx: 631768): Expected 'MappingStart', got 'SequenceStart' (at Line: 26839, Col: 7, Idx: 631768).  at YamlDotNet.Core.EventReader.Expect[MappingStart] () [0x00000] in <filename unknown>:0
  at YamlDotNet.Serialization.NodeDeserializers.GenericDictionaryNodeDeserializer.YamlDotNet.Serialization.INodeDeserializer.Deserialize (YamlDotNet.Core.EventReader reader, System.Type expectedType, System.Func`3 nestedObjectDeserializer, System.Object& value) [0x00000] in <filename unknown>:0
  at YamlDotNet.Serialization.ValueDeserializers.NodeValueDeserializer.DeserializeValue (YamlDotNet.Core.EventReader reader, System.Type expectedType, YamlDotNet.Serialization.Utilities.SerializerState state, IValueDeserializer nestedObjectDeserializer) [0x00000] in <filename unknown>:0

  at YamlDotNet.Core.EventReader.Expect[MappingStart] () [0x00000] in <filename unknown>:0
  at YamlDotNet.Serialization.NodeDeserializers.GenericDictionaryNodeDeserializer.YamlDotNet.Serialization.INodeDeserializer.Deserialize (YamlDotNet.Core.EventReader reader, System.Type expectedType, System.Func`3 nestedObjectDeserializer, System.Object& value) [0x00000] in <filename unknown>:0
  at YamlDotNet.Serialization.ValueDeserializers.NodeValueDeserializer.DeserializeValue (YamlDotNet.Core.EventReader reader, System.Type expectedType, YamlDotNet.Serialization.Utilities.SerializerState state, IValueDeserializer nestedObjectDeserializer) [0x00000] in <filename unknown>:0

The line is in the manufacture tree at the following item:
Code: [Select]
  - name: STR_SENTINEL
    category: STR_CRAFT
    requires:
      - STR_SENTINEL_INTERCEPTOR
    space: 26
    time: 8000
    cost: 425000
    requiredItems:
      - STR_ALIEN_ALLOYS: 35
      - STR_UFO_NAVIGATION: 1
    listOrder: 3230
line 26839 is: STR_ALIEN_ALLOYS: 35

Offline TheBigSot

  • Sergeant
  • **
  • Posts: 44
  • Fight, Die, Repeat.
    • View Profile
Re: Visualize Research Tree
« Reply #13 on: March 22, 2015, 08:51:31 am »
Hi there.

try using

Code: [Select]
  - name: STR_SENTINEL
    category: STR_CRAFT
    requires:
      - STR_SENTINEL_INTERCEPTOR
    space: 26
    time: 8000
    cost: 425000
    requiredItems:
      STR_ALIEN_ALLOYS: 35
      STR_UFO_NAVIGATION: 1
    listOrder: 3230

It appears that " - " doesnt go with value list Item, anyways I'll add a warning

Offline TheBigSot

  • Sergeant
  • **
  • Posts: 44
  • Fight, Die, Repeat.
    • View Profile
Re: Visualize Research Tree
« Reply #14 on: March 22, 2015, 09:05:34 am »
Hi, here is a new version with a better error message. I hope you guys find this useful, and if you guys got any other problem let me know and also I would recommend to compare what you made with the original files.