AI state errors

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
MatGB
Creative Contributor
Posts: 3310
Joined: Fri Jun 28, 2013 11:45 pm

AI state errors

#1 Post by MatGB » Sun Jun 18, 2017 2:50 am

Recompiled and started a new game earlier, got a weird crash that I think was caused by a different app so loaded the autosave

Code: Select all

AI_3: AI_Error: AI script error: "Fail to load aiState from saved game: 'set' object has no attribute 'keys'"
AI_10: AI_Error: AI script error in "generateOrders": "Unable to find key in unordered_map."
AI_7: AI_Error: AI script error: "Fail to load aiState from saved game: 'set' object has no attribute 'keys'"
Waiting for Other Players
Executing Orders
Colonization, Invasion, and Scrapping
Fleet Movement
Downloading and Unpacking New Game-state
Resolving Combat
Production and Growth
Downloading and Unpacking New Game-state
Begin Turn 161
Saving...
Saved 3687791 bytes to file: /home/matgb/.local/share/freeorion/save/auto/FreeOrion_Mat_Aardvark_0161_20170618_034154.sav
AI_10: AI_Error: AI script error in "generateOrders": "Unable to find key in unordered_map."
AI_10: AI_Error: AI script error: "foAIstate unable to pickle save-state string; the save file should be playable but the AI may have a different aggression."
All the AIs were giving the first/AI_3 error except AI 10, and then after I hit end turn AI 10 gives the same error unique to it followed by everyone getting the same.

I'm playing with Pull Request #1587 · freeorion/freeorion rebased onto Master with some minor script tweaks I'm testing, none of which should be making a difference to the AI but this might be unique to me in some way hence posting here not opening an issue. Anyone seen similar?
Mat Bowles

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

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

Re: AI state errors

#2 Post by MatGB » Sun Jun 18, 2017 3:41 am

OK, not a problem my end, game unplayable due to the error messages in the other thread, so I compiled master, started a game, saved it on turn 2, quit and loaded again. Same error messages

Code: Select all

AI_11: AI_Error: AI script error: "Fail to load aiState from saved game: 'set' object has no attribute 'keys'"
AI_3: AI_Error: AI script error: "Fail to load aiState from saved game: 'set' object has no attribute 'keys'"
AI_5: AI_Error: AI script error: "Fail to load aiState from saved game: 'set' object has no attribute 'keys'"
AI_7: AI_Error: AI script error: "Fail to load aiState from saved game: 'set' object has no attribute 'keys'"
AI_6: AI_Error: AI script error: "Fail to load aiState from saved game: 'set' object has no attribute 'keys'"
AI_10: AI_Error: AI script error: "Fail to load aiState from saved game: 'set' object has no attribute 'keys'"
AI_1: AI_Error: AI script error: "Fail to load aiState from saved game: 'set' object has no attribute 'keys'"
AI_2: AI_Error: AI script error: "Fail to load aiState from saved game: 'set' object has no attribute 'keys'"
AI_8: AI_Error: AI script error: "Fail to load aiState from saved game: 'set' object has no attribute 'keys'"
AI_9: AI_Error: AI script error: "Fail to load aiState from saved game: 'set' object has no attribute 'keys'"
AI_4: AI_Error: AI script error: "Fail to load aiState from saved game: 'set' object has no attribute 'keys'"
Mat Bowles

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

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

Re: AI state errors

#3 Post by Morlic » Sun Jun 18, 2017 10:01 am

Please post the full AI logs.
If I provided any code, scripts or other content here, it's released under GPL 2.0 and CC-BY-SA 3.0

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

Re: AI state errors

#4 Post by Morlic » Sun Jun 18, 2017 11:44 am

Can you try if https://github.com/freeorion/freeorion/pull/1609 fixes the problem?

It will only work for new games.
Please start a new game, save it, then try to load it and report back.
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
MatGB
Creative Contributor
Posts: 3310
Joined: Fri Jun 28, 2013 11:45 pm

Re: AI state errors

#5 Post by MatGB » Mon Jun 19, 2017 1:49 am

Working fine as far as I can see, have saved and reloaded twice now, rebooting entire game once to be sure. Hasn't fixed the other message though:

Code: Select all

 /home/matgb/.local/share/freeorion/save/auto/FreeOrion_Mat_Wotsits_0087_20170619_024423.sav
AI_11: AI_Error: AI script error in "calculate_priorities": "Unable to find key in unordered_map."
AI_11: AI_Error: AI script error in "assign_military_fleets_to_systems": "Unable to find key in unordered_map."
Probably unrelated, but it started appearing immediately I captured that AI homeworld. Almost certainly unrelated to save problem, log attached, can't see anything, LMK if a higher log level helps (still not sure how to use that new option)
Attachments
AI_11-lost-homeworld.log.zip
(997.93 KiB) Downloaded 20 times
Mat Bowles

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

dbenage-cx
Programmer
Posts: 389
Joined: Sun Feb 14, 2016 12:08 am

Re: AI state errors

#6 Post by dbenage-cx » Tue Jun 20, 2017 11:24 pm

For general use, the original command line option --log-level trace works much like original and will set all of the configured loggers to trace level.
Any content posted should be considered licensed GNU GPL 2.0 and/or CC-BY-SA 3.0 as appropriate.

xlightwavex
Space Kraken
Posts: 111
Joined: Mon Nov 16, 2015 5:57 am

Re: AI state errors

#7 Post by xlightwavex » Sun Jun 25, 2017 11:33 pm

Hi i got this error when there were only ships left from a conquered ai it's ships just hung around the ai was giving move orderkey errors.

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

Re: AI state errors

#8 Post by Dilvish » Thu Jul 13, 2017 1:42 am

I've been unable to replicate this ""Unable to find key in unordered_map."" error -- has anyone seen it appear lately? If so, by any chance might you still have a savegame with that error happening?
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