OpenXcom Forum

Modding => Tools => Topic started by: hellrazor on February 17, 2015, 11:41:03 pm

Title: Visualize Research Tree
Post by: hellrazor 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?
Title: Re: Visualize Research Tree
Post by: Arthanor on February 17, 2015, 11:44:33 pm
Ha! That would be great. But thinking of certain mods here made me hungry for spaghetti..
Title: Re: Visualize Research Tree
Post by: TheBigSot 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
Title: Re: Visualize Research Tree
Post by: Brian 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
Title: Re: Visualize Research Tree
Post by: kikimoristan on February 18, 2015, 05:30:24 pm
https://www.ufopaedia.org/images/7/7e/Tree1.png
(https://www.ufopaedia.org/images/7/7e/Tree1.png)
Title: Re: Visualize Research Tree
Post by: kikimoristan 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. : -)
Title: Re: Visualize Research Tree
Post by: Brian 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. ;)
Title: Re: Visualize Research Tree
Post by: TheBigSot on February 20, 2015, 05:47:19 am
Hope this helps. It runs on framework 3.5
Title: Re: Visualize Research Tree
Post by: ivandogovich on February 20, 2015, 06:39:06 am
Sweet work, TheBigSot!  Works great! :D
Title: Re: Visualize Research Tree
Post by: hellrazor 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)
Title: Re: Visualize Research Tree
Post by: TheBigSot 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
Title: Re: Visualize Research Tree
Post by: kikimoristan 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
Title: Re: Visualize Research Tree
Post by: myk002 on March 21, 2015, 01:13:13 am
same for me -- parsing the final mod pack (https://www.openxcom.com/mod/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
Title: Re: Visualize Research Tree
Post by: TheBigSot 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
Title: Re: Visualize Research Tree
Post by: TheBigSot 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.
Title: Re: Visualize Research Tree
Post by: Solarius Scorch on March 22, 2015, 10:40:30 am
Thanks for this, it helped track down some minor errors.
Title: Re: Visualize Research Tree
Post by: pilot00 on April 01, 2015, 01:56:54 pm
So as I make a compilation to lead into a huge post of my opinions on things that you want to tweek (maybe) I found an interesting bug with the Skymarshall.

Apparently there is openning/window its left side allowing the aliens vision inside and subsequently allows them to fire inside the craft at your troops. This happened me twice, you might want to check this :)
Title: Re: Visualize Research Tree
Post by: Solarius Scorch on April 01, 2015, 02:30:41 pm
So as I make a compilation to lead into a huge post of my opinions on things that you want to tweek (maybe) I found an interesting bug with the Skymarshall.

Apparently there is openning/window its left side allowing the aliens vision inside and subsequently allows them to fire inside the craft at your troops. This happened me twice, you might want to check this :)

Yes indeed, I've fixed it already. Will be in 1.1.
Title: Re: Visualize Research Tree
Post by: pilot00 on April 01, 2015, 02:42:52 pm
And I posted this on the wrong thread......Editing and moving.