Modding AI in Imperator: Action Planning

  • We have updated our Community Code of Conduct. Please read through the new rules for the forum that are an integral part of Paradox Interactive’s User Agreement.
Hey, I don't know if Im late to the party but this is fascinating! I may buy Imperator for its modding capabilities alone.

That being said, I have some questions:

1) Let's say I want to train a learner to optimise ai_plan_goals values using some cost function during game time (meaning, checking every year or so if the score improved and changing the values accordingly along the gradient), would that be possible?
To clarify: The learner would sit outside the game and just optimise the script values based on the games parameters which update live.

2) Is there some sort of API to read game parameters (like score) live?

3) Are there actions not governed by the action planning system and will they be added later?

Thank you for the great work! :)
 
Hey, I don't know if Im late to the party but this is fascinating! I may buy Imperator for its modding capabilities alone.

That being said, I have some questions:

1) Let's say I want to train a learner to optimise ai_plan_goals values using some cost function during game time (meaning, checking every year or so if the score improved and changing the values accordingly along the gradient), would that be possible?
To clarify: The learner would sit outside the game and just optimise the script values based on the games parameters which update live.

2) Is there some sort of API to read game parameters (like score) live?

3) Are there actions not governed by the action planning system and will they be added later?

Thank you for the great work! :)

1 and 2) Hypothetically you could do this. There is a command line option to launch game in observer mode IIRC. Using the scripting triggers/effects you have very limited ways of causing some observable output in some files. However, you would need to do in-memory reading ("hacking") for full flexibility. We ship with a ReleaseD executable on Steam with debug symbols IIRC so not as hard as it sounds.

Defining the objective function would be rather hard though.

3) Yes. Adding the ones that it makes sense to add (as in, actually helping).
 
Last edited:
1 and 2) Hypothetically you could do this. There is a command line option to launch game in observer mode IIRC. Using the scripting triggers/effects you have very limited ways of causing some observable output in some files. However, you would need to do in-memory reading ("hacking") for full flexibility. We ship with a ReleaseD executable on Steam with debug symbols IIRC so not as hard as it sounds.

Defining the objective function would be rather hard though.

3) Yes. Adding the ones that it makes sense to add (as in, actually helping).

Interesting, thanks for the answers.

Is there an option to launch the observer mode without all the overhead (like gfx) to speed up the training/testing process? If everything works, the game client itself would probably be the greatest bottleneck..

EDIT: Also, not sure if I missed this but is there any other way to influence the AI besides tinkering with the ai_plan_goals file?
 
I will be making extensive changes to unit AI, the issue you describe is known and being worked on.

It should be possible to make such a siege only objective already today (set weight on cities with enemy armies to a large value such as 1 million), but I haven't tried doing it with the triggers available.
Is their a list of said triggers available somewhere?
 
@Chaingun

Is it possible to mod the AI to not take the low maintenance economic policy? It's becoming a major issue that's giving the perception that the AI is bad, even though you implemented this new advanced plans system. Because what generally happens is players fabricate a claim, declare and stackwipe AI low maintenance troops on the border day 1?
 
Last edited:
@Chaingun

Is it possible to mod the AI to not take the low maintenance economic policy? It's becoming a major issue that's giving the perception that the AI is bad, even though you implemented this new plans system. Because what generally happens is players fabricate a claim, declare and stackwipe AI low maintenance troops on the border day 1?

This is quite common. I recall other titles having the AI react to a border war by increasing their economic policy based upon the CB holder's own economic policy.
 
@Chaingun

If I create new buildings that don't add any modifiers (I intend for them to work with variables instead). Will the AI still build them? I'm hoping it won't unless I script it to do so using a pulse, because I intend to add requirements to the building using Scripted GUI.

So theoritically, if such building doesn't have any modifiers, the AI won't see any use in it and won't build it unless scripted to? Or that isn't the case?