Do AIs notice changes in local default folder?

Problems and solutions for installing or running FreeOrion, including discussion of bugs if needed before posting a bug report. For problems building from source, post in Compile.
Post Reply
Message
Author
User avatar
Oberlus
Small Juggernaut
Posts: 706
Joined: Mon Apr 10, 2017 4:25 pm

Do AIs notice changes in local default folder?

#1 Post by Oberlus » Thu Apr 27, 2017 7:36 pm

If I change values of the gains from industry/research techs and buildings in my default/... folders, will AI take that into account or will it play considering the standard values?

I noticed that the descriptions won't change. For example, if I change Quantum Networking to give +0.2 per pop instead of +0.5, the Pedia will still tell me that it gives +0.5 (I haven't tried, I just saw that the value is literal in the stringtables instead of a variable). May I assume that AI uses values that are hardcoded in its C++ and python files and that it won't consult the focs files?

User avatar
Dilvish
AI Lead, Programmer
Posts: 4719
Joined: Sat Sep 22, 2012 6:25 pm

Re: Do AIs notice changes in local default folder?

#2 Post by Dilvish » Thu Apr 27, 2017 9:23 pm

Oberlus wrote:If I change values of the gains from industry/research techs and buildings in my default/... folders, will AI take that into account or will it play considering the standard values...and that it won't consult the focs files?
For the most part, right. For some things, like ship hull stats and ship part stats, the AI can do in-game queries for their values, but for the most part it works with hard-coded values.

To make things a bit easier on folks making customizations, we try to group all the various hardcoded stats that the AI relies on into one location -- AIDependencies.py. But that doesn't really cover everything, at least not yet.

Regarding your example, although the tech name "LRN_QUANT_NET" is specified in that file, there is no research bonus value specified for it there, because there is no place that the AI makes a calculation/decision explicitly dependent on that bonus value. There is at least one place where it makes a decision that is at least somewhat implicitly dependent on that value, which you can find by searching for that tech name. If you did make the tech a lot less valuable like in your example, without making it also a lot cheaper, then an appropriate AI adjustment would be to move the tech farther down in the AI research lists in TechListsAI.py.
If I provided any code, scripts or other content here, it's released under GPL 2.0 and CC-BY-SA 3.0

User avatar
Oberlus
Small Juggernaut
Posts: 706
Joined: Mon Apr 10, 2017 4:25 pm

Re: Do AIs notice changes in local default folder?

#3 Post by Oberlus » Thu Apr 27, 2017 10:01 pm

Thank you very much, Dilvish. I'll find time to mess with those files and try to make things harder for/against my gameplay style.

User avatar
MatGB
Creative Contributor
Posts: 3310
Joined: Fri Jun 28, 2013 11:45 pm

Re: Do AIs notice changes in local default folder?

#4 Post by MatGB » Fri Apr 28, 2017 2:51 am

Oberlus wrote: I noticed that the descriptions won't change. For example, if I change Quantum Networking to give +0.2 per pop instead of +0.5, the Pedia will still tell me that it gives +0.5 (I haven't tried, I just saw that the value is literal in the stringtables instead of a variable). May I assume that AI uses values that are hardcoded in its C++ and python files and that it won't consult the focs files?
Yeah, we want/need to have the Pedia take more actual data from the FOCS files and/or have the specific numbers done as macros and have them linked from both, but it's an ongoing project and tends to happen when one of us is adjusting things anyway (or Ouaz gets a good idea on how to do it while updating a translation).

In the meantime stringtable updates are a pain and most of us forget bits of them fairly regularly.
Mat Bowles

Any code or patches in anything posted here is released under the CC and GPL licences in use for the FO project.

Post Reply