FreeOrion

Forums for the FreeOrion project
It is currently Mon Nov 20, 2017 6:48 pm

All times are UTC




Post new topic Reply to topic  [ 4 posts ] 
Author Message
PostPosted: Thu Apr 27, 2017 7:36 pm 
Offline
Dyson Forest
User avatar

Joined: Mon Apr 10, 2017 4:25 pm
Posts: 214
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?


Top
 Profile  
 
PostPosted: Thu Apr 27, 2017 9:23 pm 
Offline
AI Lead, Programmer
User avatar

Joined: Sat Sep 22, 2012 6:25 pm
Posts: 4374
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


Top
 Profile  
 
PostPosted: Thu Apr 27, 2017 10:01 pm 
Offline
Dyson Forest
User avatar

Joined: Mon Apr 10, 2017 4:25 pm
Posts: 214
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.


Top
 Profile  
 
PostPosted: Fri Apr 28, 2017 2:51 am 
Offline
Creative Contributor
User avatar

Joined: Fri Jun 28, 2013 11:45 pm
Posts: 3261
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.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group