Posted by: Mord
« on: May 29, 2018, 01:51:01 PM »Very short answer:
No, the top-level Goal tags are not hardcoded. The code inside the Goal tag matters a lot, both to the Goal itself and to other code that refers to the Goal.
Somewhat longer answer:
If you're interested in the AI, you should read this. You can create new goals with new top-level tags, but creating new goals by itself won't do anything for you. "Goals" are things the AI might like to do, but whether or not the AI will actually try to do them is governed by a "goalfunction" that links the goal to a perceptual equation. The perceptual equation is a way for the AI to evaluate the desirability of pursuing that specific goal at that specific moment. In your example, the goal "Corrupt_Planet" (AI_Goals_Underworld_Galactic.xml) is governed by the goalfunction also named "Corrupt_Planet" (AI_Goalset_Underworld_Galactic.xml) and the perceptual equation named "Should_Corrupt_Planet" (AI_Equations_Underworld_Galactic.xml). Once the AI has decided to pursue a Goal, it then uses a Plan to actually execute tasks in pursuit of that goal. The only Plan available to the AI in pursuit of the "Corrupt_Planet" goal is found in "AI_Plan_Underworld_DeploySaboteur.lua".
No, the top-level Goal tags are not hardcoded. The code inside the Goal tag matters a lot, both to the Goal itself and to other code that refers to the Goal.
Somewhat longer answer:
If you're interested in the AI, you should read this. You can create new goals with new top-level tags, but creating new goals by itself won't do anything for you. "Goals" are things the AI might like to do, but whether or not the AI will actually try to do them is governed by a "goalfunction" that links the goal to a perceptual equation. The perceptual equation is a way for the AI to evaluate the desirability of pursuing that specific goal at that specific moment. In your example, the goal "Corrupt_Planet" (AI_Goals_Underworld_Galactic.xml) is governed by the goalfunction also named "Corrupt_Planet" (AI_Goalset_Underworld_Galactic.xml) and the perceptual equation named "Should_Corrupt_Planet" (AI_Equations_Underworld_Galactic.xml). Once the AI has decided to pursue a Goal, it then uses a Plan to actually execute tasks in pursuit of that goal. The only Plan available to the AI in pursuit of the "Corrupt_Planet" goal is found in "AI_Plan_Underworld_DeploySaboteur.lua".