Triangle wave on AI's Production/Research output

Describe your experience with the latest version of FreeOrion to help us improve it.

Moderator: Oberlus

Forum rules
Always mention the exact version of FreeOrion you are testing.

When reporting an issue regarding the AI, if possible provide the relevant AI log file and a save game file that demonstrates the issue.
Post Reply
Message
Author
User avatar
Oberlus
Cosmic Dragon
Posts: 5713
Joined: Mon Apr 10, 2017 4:25 pm

Triangle wave on AI's Production/Research output

#1 Post by Oberlus »

Playing 2017-06-06.4833950_Test_Win32 (however I have noticed in previous versions what I'm telling in this post).

In many of my games I've noticed that some of the AIs (seldom most of them, never all of them) get a triangle wave on their production and/or research output graph. That is, their output is going up and down at a regular pace. It may be growing up on average, but definitively slower than me or the successful AIs.
My assumption is that they are constantly swapping between research and production focus on some of their colonies. If this is the case, it would cripple their performance (no need to explain why, right?). That assumption is consistent with the fact that the AIs that show this triangle wave output have poor performance compared to the others.
Note that this is only seen in mid/late game. Although it doesn't seem to be caused by fleets moving nearby a Collective Thought Network (because I believe to have seen this happening on already losing AIs when I was winning and still far from getting that tech and building), I don't discard it being the reason.

Is the AI team aware of this?

If the answer is no, I will save and upload some logs for complete games (though this will take me some time, I'm having little time to play).

Morlic
AI Contributor
Posts: 296
Joined: Tue Feb 17, 2015 11:54 am

Re: Triangle wave on AI's Production/Research output

#2 Post by Morlic »

Oberlus wrote:
If the answer is no, I will save and upload some logs for complete games (though this will take me some time, I'm having little time to play).
Logs and savegames would be helpful.

A complete log seems not necessary (but wouldn't hurt of course). All it needs to cover is multiple periods of the focus switches.

Assuming that the behaviour is persistent, it would also be enough to have a savegame that is either during the behaviour or shortly before. I can then produce the relevant logs myself.
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
Dilvish
AI Lead and Programmer Emeritus
Posts: 4768
Joined: Sat Sep 22, 2012 6:25 pm

Re: Triangle wave on AI's Production/Research output

#3 Post by Dilvish »

There are two intended behaviors by the AI that will generally result in some kind wave pattern to their PP and RP output. The most pronounced one is from the use of Concentration Camps; the less pronounced one is from intentional dithering between Industry and Research. Both of these behaviors are not just done willy-nilly, but are done after analysis of where they could be profitably applied.

If you believe you observe either of these things being done poorly, then as Morlic notes, yes indeed please submit a savegame and log file(s). Keep in mind that the concentration camp has some stochastic behavior, and so for them you really need to be assessing the AI's decision on the turn it builds the CC and on the turn that it destroys the CC. The fact that sometimes the CC negative effects might linger extra-long is to be expected and does not by itself *necessarily* mean that the AI waited too long to destroy the CC. It is of course possible that those construction/destruction decision points could be honed better, so cases where it worked out poorly can be helpful references (so long as we have the savegame and/or logfile that lets us assess the situation at which the AI actually made its decisions).

On the Industry/Research dithering issue, keep in mind that the AI generally values an RP roughly twice as much as a PP (the exact valuation changes with circumstances, but that's the rough starting ballpark). Even with the extra point of penalty for changing Focus, there are situations where a small bit of net reward (at least based on those valuations) can be eked out from dithering the Focus some.

I often see extremely successful AI's applying both these behaviors; perhaps you simply ran into a string of situations where it happened to be the less successful ones that showed the behavior most strongly. But, of course, perhaps you really are on to something, so relevant data is welcome.
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
Cosmic Dragon
Posts: 5713
Joined: Mon Apr 10, 2017 4:25 pm

Re: Triangle wave on AI's Production/Research output

#4 Post by Oberlus »

Attached save and logs of my current game that happend to show this behaviour on many of the AIs (there are 19 AIs). However, I think the logs in the compressed file are useless, just initialisation from the loading.

I tried to check if it is due to intermitent use of concentration camps, but I don't know if AIs are building them or not (I searched for "camp" in the logs).
Anyways, several of the AIs are showing the triangle wave consistently for most of the game and I assume after passing a few turns useful logs should be generated. I would do it myself but I can't play tonight.
So maybe you can have a look at them.

Note: remove the last ".zip" from the attached files to get the three files that my compresor produced (forum complains about unknown extensions like ".001").
Attachments
triangle_AI_output_save_n_logs.zip.003.zip
(1.46 MiB) Downloaded 72 times
triangle_AI_output_save_n_logs.zip.002.zip
(1.56 MiB) Downloaded 68 times
triangle_AI_output_save_n_logs.zip.001.zip
(1.56 MiB) Downloaded 79 times

Post Reply