v0.4.2 Release Candidate #3 Discussion

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.
Message
Author
User avatar
Dilvish
AI Lead and Programmer Emeritus
Posts: 4768
Joined: Sat Sep 22, 2012 6:25 pm

Re: v0.4.2 Release Candidate #3 Discussion

#16 Post by Dilvish »

Ok, it looks like I figured out the problem. I noticed that the ghost max shields were changing over time (see below, going from 40 to 100), and it made me think about the 'pretend ownership' feature used to get tech-adjusted meter readings for the Suitability report. Turns out, AIInterface.cpp::InitTurn() (called at the start of every AI turn), calls UpdateMeterEstimates(), which is declared as

Code: Select all

UpdateMeterEstimates(bool pretend_unowned_planets_owned_by_this_ai_empire = true)
The comment line notes that this default to true was to assist in colonization planning, but I think it is throwing off invasions of native planets after the AIs develop planetary shields. I hadn't even noticed this version of it before, I had generally been using a call through the universe object (which doesn't take this parameter), and just using it to assess planet focus changes. I just tested changing this default in AIInterface.h to be false, and that totally stopped the problem.

Fixing that, along with the above fix I mentioned, plus a handful of other changes I made to the AI invasions code while trying to sort this out, makes a pretty substantial difference in overall AI performance; I'd like to do an RC4 with these changes in....

logs showing the bug:

Code: Select all

AI_4.log:2013-02-19 11:33:45,430 DEBUG AI : Ordered troop ship ID 597 to invade Taygeta III, got result 0  -- planet has 0.0 stealth, shields 1.2,  24.0 population and is owned by empire -1
AI_4.log:Planet 234: Taygeta III  at: Taygeta owner: -1 created on turn: -32768 specials: (TUNNELS_SPECIAL, -32768)   Meters: Target Population: Cur: 28 Init: 24  Target Industry: Cur: 4.8 Init: 4.8  Target Research: Cur: 2 Init: 0  Target Trade: Cur: 0 Init: 0  Target Infrastructure: Cur: 30 Init: 30  Target Happiness: Cur: 0 Init: 0  Max Shield: Cur: 40 Init: 0  Max Defense: Cur: 20 Init: 0  Max Troops: Cur: 3.5 Init: 4  Population: Cur: 24 Init: 24  Industry: Cur: 4.8 Init: 4.8  Research: Cur: 0 Init: 0  Trade: Cur: 0 Init: 0  Infrastructure: Cur: 5 Init: 5  Happiness: Cur: 0 Init: 0  Shield: Cur: 1.25 Init: 0  Defense: Cur: 0 Init: 0  Troops: Cur: 3.5 Init: 4  Rebel Troops: Cur: 0 Init: 0  Supply: Cur: 1 Init: 1  Stealth: Cur: 0.01 Init: 0.01  Detection Range: Cur: 75 Init: 0   species: SP_ABADDONI  ResourceCenter focus:  type: inferno original type: inferno size: large rot period: 1.3287 axis tilt: 4.90503 buildings:  last attacked on turn: -1
later in the same game:

Code: Select all

AI_4.log:2013-02-19 11:34:58,978 DEBUG AI : Ordered troop ship ID 597 to invade Taygeta III, got result 0  -- planet has 0.0 stealth, shields 30.0,  24.0 population and is owned by empire -1
AI_4.log:Planet 234: Taygeta III  at: Taygeta owner: -1 created on turn: -32768 specials: (TUNNELS_SPECIAL, -32768)   Meters: Target Population: Cur: 28 Init: 24  Target Industry: Cur: 4.8 Init: 4.8  Target Research: Cur: 2 Init: 0  Target Trade: Cur: 0 Init: 0  Target Infrastructure: Cur: 30 Init: 30  Target Happiness: Cur: 0 Init: 0  Max Shield: Cur: 100 Init: 0  Max Defense: Cur: 20 Init: 0  Max Troops: Cur: 3.5 Init: 4  Population: Cur: 24 Init: 24  Industry: Cur: 4.8 Init: 4.8  Research: Cur: 0 Init: 0  Trade: Cur: 0 Init: 0  Infrastructure: Cur: 30 Init: 30  Happiness: Cur: 0 Init: 0  Shield: Cur: 30 Init: 0  Defense: Cur: 0 Init: 0  Troops: Cur: 3.5 Init: 4  Rebel Troops: Cur: 0 Init: 0  Supply: Cur: 2 Init: 1  Stealth: Cur: 0.01 Init: 0.01  Detection Range: Cur: 75 Init: 0   species: SP_ABADDONI  ResourceCenter focus:  type: inferno original type: inferno size: large rot period: 1.3287 axis tilt: 4.90503 buildings:  last attacked on turn: -1
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
Geoff the Medio
Programming, Design, Admin
Posts: 12859
Joined: Wed Oct 08, 2003 1:33 am
Location: Munich

Re: v0.4.2 Release Candidate #3 Discussion

#17 Post by Geoff the Medio »

Dilvish wrote:...totally stopped the problem.
The logs look right, or you have consistently observed AIs not having the invasion problem?
I'd like to do an RC4 with these changes in....
OK, I'll pm Vezzra.
Dilvish wrote:The comment line notes that this default to true was to assist in colonization planning...
That may have been added before natives were added, but not updated to account for them, since native planets are internally treated as unowned, but shouldn't be treated as owned by the player for purposes of colonization planning.

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

Re: v0.4.2 Release Candidate #3 Discussion

#18 Post by Dilvish »

Geoff the Medio wrote:
Dilvish wrote:...totally stopped the problem.
The logs look right, or you have consistently observed AIs not having the invasion problem?
After checking both visually and via logs for a couple smaller games, I checked with larger games -- visually observing a couple largish multiplayer games (200 systems, 12 AIs) up through turn 200 or so, I could see all the native planets getting colonized. Additionally, I searched the logs for the relevant error messages, and it came up dry (whereas before the fix there would be many instances of the bug appearing). I've repeated that for a total of 3 games of that size so far.
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
Geoff the Medio
Programming, Design, Admin
Posts: 12859
Joined: Wed Oct 08, 2003 1:33 am
Location: Munich

Re: v0.4.2 Release Candidate #3 Discussion

#19 Post by Geoff the Medio »

Dilvish wrote:I'd like to do an RC4 with these changes in....
Have you committed the changes yet?

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

Re: v0.4.2 Release Candidate #3 Discussion

#20 Post by Dilvish »

Geoff the Medio wrote:Have you committed the changes yet?
I hadn't yet, but I just put them in now.
If I provided any code, scripts or other content here, it's released under GPL 2.0 and CC-BY-SA 3.0

yandonman
Creative Contributor
Posts: 699
Joined: Thu Aug 30, 2012 12:32 am

Re: v0.4.2 Release Candidate #3 Discussion

#21 Post by yandonman »

... I'm already scared of RC4's AI :)
Code released under GPL 2.0. Content released under GPL 2.0 and Creative Commons Attribution-ShareAlike 3.0.

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

Re: v0.4.2 Release Candidate #3 Discussion

#22 Post by Dilvish »

yandonman wrote:... I'm already scared of RC4's AI :)
Ah, don't get your hopes up too much. These fixes do help it be better, but after several more trials its seeming not as significant a difference as it had at first.
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: v0.4.2 Release Candidate #3 Discussion

#23 Post by Dilvish »

Dilvish wrote:
yandonman wrote:... I'm already scared of RC4's AI :)
Ah, don't get your hopes up too much. These fixes do help it be better, but after several more trials its seeming not as significant a difference as it had at first.
On the other hand, in an actual test game today (as opposed to AI-only multiplayer games which I had to rely on yesterday due to time constraints), playing with 150 systems and 10 AIs, so far (up through turn 90) the AIs are certainly making enough trouble for it to be a fun game.
If I provided any code, scripts or other content here, it's released under GPL 2.0 and CC-BY-SA 3.0

Post Reply