Beispiel #1
0
        private void FillColumns(Node endNode)
        {
            //var outputPos = new Vector2L(1200, 300);
            //var output = new OutputNode();// { Pos = outputPos };
            //output.PreviousNode = endNode;
            tree.AddNode(endNode);
            int startHeight = (int)outputPos.y;

            AddToColumn(endNode, startHeight, 0);
            AddNodeChildren(endNode, startHeight, 1);
        }
Beispiel #2
0
        public static async Task Run(string[] args, string gameDataPath, string planetName, Dictionary <string, string> settings, Dictionary <string, Dictionary <string, string> > pqsMods)
        {
            NodeTree config = new NodeTree();

            foreach (KeyValuePair <string, string> setting in settings)
            {
                config.SetValue(setting.Key, setting.Value);
            }

            NodeTree mods = config.AddNode("Mods");

            foreach (KeyValuePair <string, Dictionary <string, string> > mod in pqsMods)
            {
                NodeTree modNode = mods.AddNode(mod.Key);

                foreach (KeyValuePair <string, string> parameter in mod.Value)
                {
                    modNode.SetValue(parameter.Key, parameter.Value);
                }
            }

            Console.WriteLine("\nGenerating maps.. This action can take a while, especially with high resolution\n");

            using (Processor processor = await Processor.Create(gameDataPath))
            {
                Console.WriteLine("\nExporting maps..");

                Processor.EncodedTextureData data = await processor.GenerateMapsEncoded(config);

                await SaveStream(gameDataPath + @"GameData\Infinity\StarSystems\Planets\" + planetName + "_Color.png", data.Color);
                await SaveStream(gameDataPath + @"GameData\Infinity\StarSystems\Planets\" + planetName + "_Height.png", data.Height);
                await SaveStream(gameDataPath + @"GameData\Infinity\StarSystems\Planets\" + planetName + "_Normal.png", data.Normal);

                Console.Clear();
            }
        }
Beispiel #3
0
        public Rmh_Nodes()
        {
            var x = new NodeTree {
                ID = DamageTakenTreeName, Name = DamageTakenTreeName, Required = true, Type = NodeTreeType.Combat
            };
            var n = new NodeTree {
                ID = DamageDealtTreeName, Name = DamageDealtTreeName, Required = true, Type = NodeTreeType.Combat
            };
            var y = new NodeTree {
                ID = StatScalingTreeName, Name = StatScalingTreeName, Required = true, Type = NodeTreeType.Combat
            };
            var p = new NodeTree {
                ID = VitalScalingTreeName, Name = VitalScalingTreeName, Required = true, Type = NodeTreeType.Combat
            };


            var node = new CombatStartNode("Min Physical Damage", "Start node for dealt physical",
                                           "Physical Damage represents weapon damage, or base combatant damage. You can then add additional nodes to add onto this value. Example: Add 10x Strength")
            {
                Identifier = "MIN_Physical"
            };

            node.OnCreate();
            n.AddNode(node, new Vector2(25, 87.5f), 0);
            var nodeMax = new CombatStartNode("Max Physical Damage", "Start node for dealt physical",
                                              "Physical Damage represents weapon damage, or base combatant damage. You can then add additional nodes to add onto this value. Example: Add 10x Strength")
            {
                Identifier = "MAX_Physical"
            };

            nodeMax.OnCreate();
            n.AddNode(nodeMax, new Vector2(25, 287.5f), 1);

            var damageTakenNode = new CombatStartNode("Damage To Be Dealt", "Represents damage about to be taken",
                                                      "This is the incoming damage. It can be modified to take into account other stats. E.g. Damage - Defender's Armor value.")
            {
                Identifier = "DamageTaken"
            };
            var missedNode     = new MissedHitNode();
            var evadedNode     = new EvadedHitNode();
            var successHitNode = new SuccessHitEndNode();

            damageTakenNode.OnCreate();
            missedNode.OnCreate();
            successHitNode.OnCreate();
            evadedNode.OnCreate();
            x.AddNode(damageTakenNode, new Vector2(25, 87.5f), 0);
            x.AddNode(successHitNode, new Vector2(700, 87.5f), 1);
            x.AddNode(missedNode, new Vector2(700, 237.5f), 2);
            x.AddNode(evadedNode, new Vector2(700, 387.5f), 3);

            n.Variables.Add(new NodeTreeVar("Attacker", PropertyType.CombatCharacter));

            y.Variables.Add(new NodeTreeVar("Attacker", PropertyType.CombatCharacter));
            p.Variables.Add(new NodeTreeVar("Attacker", PropertyType.CombatCharacter));

            x.Variables.Add(new NodeTreeVar("Attacker", PropertyType.CombatCharacter));
            x.Variables.Add(new NodeTreeVar("Defender", PropertyType.CombatCharacter));
            x.Variables.Add(new NodeTreeVar("Physical Damage", PropertyType.Int)
            {
                ID = "DamageDealtVar_Physical"
            });

            AchievementsNodeBank = new NodeBank()
            {
                Type      = NodeTreeType.Achievements,
                NodeTrees = new List <NodeTree>()
            };

            CombatNodeBank = new NodeBank
            {
                Type      = NodeTreeType.Combat,
                NodeTrees = new List <NodeTree>()
                {
                    x, n, y, p
                }
            };

            EventNodeBank = new NodeBank
            {
                Type      = NodeTreeType.Event,
                NodeTrees = new List <NodeTree>()
            };

            DialogNodeBank = new NodeBank
            {
                Type      = NodeTreeType.Dialog,
                NodeTrees = new List <NodeTree>()
            };

            WorldMapNodeBank = new NodeBank
            {
                Type      = NodeTreeType.WorldMap,
                NodeTrees = new List <NodeTree>()
                {
                    new NodeTree()
                    {
                        ID = CoreInitialMap, Name = CoreInitialMap, Required = true, Type = NodeTreeType.Combat
                    }
                }
            };
        }
Beispiel #4
0
        public static async Task Run(string[] args)
        {
            DateTime t      = DateTime.Now;
            NodeTree config = new NodeTree();

            config.SetValue("__resolution", "2048");
            config.SetValue("__radius", "25000");
            config.SetValue("__hasOcean", "false");
            config.SetValue("__oceanHeight", "0");
            config.SetValue("__oceanColor", "0,0,0,0");
            config.SetValue("__normalStrength", "7");
            config.SetValue("mapMaxHeight", "19000");
            NodeTree mods = config.AddNode("Mods");
            NodeTree vertexSimplexHeightAbsolute = mods.AddNode("VertexSimplexHeightAbsolute");

            vertexSimplexHeightAbsolute.SetValue("deformity", "8000");
            vertexSimplexHeightAbsolute.SetValue("frequency", "0.5");
            vertexSimplexHeightAbsolute.SetValue("octaves", "3");
            vertexSimplexHeightAbsolute.SetValue("persistence", "0.5");
            vertexSimplexHeightAbsolute.SetValue("seed", "12");
            vertexSimplexHeightAbsolute.SetValue("order", "10");
            vertexSimplexHeightAbsolute.SetValue("enabled", "True");
            NodeTree vertexSimplexNoiseColor = mods.AddNode("VertexSimplexNoiseColor");

            vertexSimplexNoiseColor.SetValue("blend", "1");
            vertexSimplexNoiseColor.SetValue("colorStart", "0.641791046,0.51597774,0.488527536,1");
            vertexSimplexNoiseColor.SetValue("colorEnd", "0.291044772,0.273304433,0.216757119,1");
            vertexSimplexNoiseColor.SetValue("frequency", "1");
            vertexSimplexNoiseColor.SetValue("octaves", "8");
            vertexSimplexNoiseColor.SetValue("persistence", "0.5");
            vertexSimplexNoiseColor.SetValue("seed", "111453");
            vertexSimplexNoiseColor.SetValue("order", "100");
            vertexSimplexNoiseColor.SetValue("enabled", "True");
            NodeTree vertexHeightNoise = mods.AddNode("VertexHeightNoise");

            vertexHeightNoise.SetValue("deformity", "150");
            vertexHeightNoise.SetValue("frequency", "4");
            vertexHeightNoise.SetValue("octaves", "6");
            vertexHeightNoise.SetValue("persistence", "0.5");
            vertexHeightNoise.SetValue("seed", "111111112");
            vertexHeightNoise.SetValue("noiseType", "RidgedMultifractal");
            vertexHeightNoise.SetValue("mode", "Low");
            vertexHeightNoise.SetValue("lacunarity", "2.5");
            vertexHeightNoise.SetValue("order", "19");
            vertexHeightNoise.SetValue("enabled", "True");
            NodeTree vertexHeightOblate = mods.AddNode("VertexHeightOblate");

            vertexHeightOblate.SetValue("height", "6000");
            vertexHeightOblate.SetValue("pow", "1");
            vertexHeightOblate.SetValue("enabled", "True");
            vertexHeightOblate.SetValue("order", "1");

            using (Processor processor = await Processor.Create("/home/dorian/Dokumente/KSP/1.4.3/Kerbal Space Program/"))
            {
                Processor.EncodedTextureData data = await processor.GenerateMapsEncoded(config);

                await SaveStream("color.png", data.Color);
                await SaveStream("height.png", data.Height);
                await SaveStream("normal.png", data.Normal);
            }
            Console.WriteLine(DateTime.Now - t);
        }