AI empires don't do nothing
Moderator: Oberlus
- eleazar
- Design & Graphics Lead Emeritus
- Posts: 3858
- Joined: Sat Sep 23, 2006 7:09 pm
- Location: USA — midwest
Re: AI empires don't do nothing
I saw AI activity sometime at the end of last year, but with recent playtesting, i didn't see much evidence of it, so today i used my cheat nearly-omniscient species to check things out, and, once again there is no AI ship movement.
The attached used night's binary from the 27th, though i suspect the issue existed in other binaries released in the past week or so. I haven't encountered an AI ship away from a capitol.
The attached used night's binary from the 27th, though i suspect the issue existed in other binaries released in the past week or so. I haven't encountered an AI ship away from a capitol.
- Attachments
-
- logs-n-save.zip
- (211.64 KiB) Downloaded 77 times
- Geoff the Medio
- Programming, Design, Admin
- Posts: 13603
- Joined: Wed Oct 08, 2003 1:33 am
- Location: Munich
Re: AI empires don't do nothing
From the logs, I see two problems. The main issue looks like the same Python library issue as before. Can you verify that this is occurring in Vezzra's builds as well? Edit: And could you determine if there's a specific build where this started happening? I don't think anything has changed in the relevant code, so hopefully it's just a matter of how night vs how Vezzra are making the builds... /Edit
Also, it looks like there were more broken effectsgroups from your recent commenting out of krill spawning messages. I fixed one, but apparently there were more that I missed since I was only looking for issues with the krill 1 which I observed in game. The closing comment is before the closing brace of the parameters list, but should be after to comment out the whole effect. For example:
In the logs, this is causing errors such as
Code: Select all
2012-01-27 10:29:00,999 DEBUG AI : Initializing C++ interfaces for Python
2012-01-27 10:29:01,157 DEBUG AI : Python stdout and stderr redirected
2012-01-27 10:29:01,160 ERROR AI : Traceback (most recent call last):
2012-01-27 10:29:01,160 ERROR AI : File "/Users/jbjerk/Desktop/FreeOrion.app/Contents/Resources/default/AI/FreeOrionAI.py", line 2, in <module>
2012-01-27 10:29:01,160 ERROR AI : import pickle # Python object serialization library
2012-01-27 10:29:01,160 ERROR AI : File "/Users/jbjerk/Desktop/FreeOrion.app/Contents/Frameworks/Python.framework/Versions/Current/lib/python2.7/pickle.py", line 34, in <module>
2012-01-27 10:29:01,160 ERROR AI : import struct
2012-01-27 10:29:01,160 ERROR AI : File "/Users/jbjerk/Desktop/FreeOrion.app/Contents/Frameworks/Python.framework/Versions/Current/lib/python2.7/struct.py", line 1, in <module>
2012-01-27 10:29:01,160 ERROR AI : from _struct import *
2012-01-27 10:29:01,160 ERROR AI : ImportError: No module named _struct
Code: Select all
/*
GenerateSitRepMessage
message = "EFFECT_MONSTER_SPAWNING"
parameters = [
tag = "predefinedshipdesign" data = "SM_KRILL_3"
tag = "system" data = Source.SystemID
*/ <----- here
]
Code: Select all
2012-01-27 10:29:08,495 ERROR AI : /Users/jbjerk/Desktop/FreeOrion.app/Contents/Resources/default/ship_hulls.txt:1931:12: Parse error. Expected string here:
scope = And [
^
- eleazar
- Design & Graphics Lead Emeritus
- Posts: 3858
- Joined: Sat Sep 23, 2006 7:09 pm
- Location: USA — midwest
Re: AI empires don't do nothing
I downloaded Vezzra's r4615 build and RC2. Played for about ten turns and none of the AI fleets moved, in either.Geoff the Medio wrote:From the logs, I see two problems. The main issue looks like the same Python library issue as before. Can you verify that this is occurring in Vezzra's builds as well? Edit: And could you determine if there's a specific build where this started happening? I don't think anything has changed in the relevant code, so hopefully it's just a matter of how night vs how Vezzra are making the builds... /Edit
I don't want to try all the builds blindly. Is there somewhere i should start?
Looks like i got them all wrong. Should be fixed in revision 4625.Geoff the Medio wrote:Also, it looks like there were more broken effectsgroups from your recent commenting out of krill spawning messages. I fixed one, but apparently there were more that I missed since I was only looking for issues with the krill 1 which I observed in game.
- Geoff the Medio
- Programming, Design, Admin
- Posts: 13603
- Joined: Wed Oct 08, 2003 1:33 am
- Location: Munich
Re: AI empires don't do nothing
I don't know what would have changed that would affect the AI scripts, so try a binary search? Try the latest working version to make sure it's still works, then try the release in the middle, and go forward or back by half way to locate the latest working build...?eleazar wrote:I don't want to try all the builds blindly. Is there somewhere i should start?
Edit: I looked at the commit logs for the XCode project file for a hint as to when things might have gotten messed up, and the most recent change was revision 4550, so if you could try FreeOrion-4541-Test-MacOSX-10.6.zip.tar.gz from the Test folder on sourceforge downloads to see if Python AI works in that version, it might be telling. Also, the revision in which the previously-working Python fix was applied was 4525, and I don't think anything relevant in that file has changed since, so unless it is related to the project files or how the app bundle is being set up, I don't know what could have changed to make it stop working...
Re: AI empires don't do nothing
Ok, I just started to look into the matter. First thing I tried was updating to latest SVN (r4625), making a build for that revision and run a test game. Interestingly, everything worked just fine - that is, like it has been working before. I just played 9 turns, but I encountered 2 scouts from an AI empire moving happily around. I also checked the AI logs for error messages - none found. I've attached the AI logs to this post.
I'm currently uploading this build (SVN 4625 for MacOSX) to my dropbox. When the upload is finished, I'll post the link to the "Up-to-date FreeOrion Mac-SDK and build - Test please!" thread in General Discussion. Eleazar, can you try this build and report the results?
I'm currently uploading this build (SVN 4625 for MacOSX) to my dropbox. When the upload is finished, I'll post the link to the "Up-to-date FreeOrion Mac-SDK and build - Test please!" thread in General Discussion. Eleazar, can you try this build and report the results?
- Attachments
-
- AI_logs.zip
- AI log files
- (55.61 KiB) Downloaded 59 times
- eleazar
- Design & Graphics Lead Emeritus
- Posts: 3858
- Joined: Sat Sep 23, 2006 7:09 pm
- Location: USA — midwest
Re: AI empires don't do nothing
--downloadingGeoff the Medio wrote:...so if you could try FreeOrion-4541-Test-MacOSX-10.6.zip.tar.gz from the Test folder on sourceforge downloads to see if Python AI works in that version, it might be telling.
Vezza:
I'll try it when it's ready.
HINT
For easier testing remove the "/*" and "*/" from species.txt.
This will enable the species "Super-Testers", which have a vision range that encompasses most galaxies.
Re: AI empires don't do nothing
Oh, thanks! I just tried that, works great. I now can report that all AI empires move their ships around, try to use their troop ships to capture enemy colonies, even colonize other planets (only one, because they have only the one starting colony ship and apparently don't produce new ones).eleazar wrote:...HINT
For easier testing remove the "/*" and "*/" from species.txt.
This will enable the species "Super-Testers", which have a vision range that encompasses most galaxies.
- eleazar
- Design & Graphics Lead Emeritus
- Posts: 3858
- Joined: Sat Sep 23, 2006 7:09 pm
- Location: USA — midwest
Re: AI empires don't do nothing
There's no ship movement for me with this one:
FreeOrion-4541-Test-MacOSX-10.6.zip.tar.gz from the Test folder on sourceforge
FreeOrion-4541-Test-MacOSX-10.6.zip.tar.gz from the Test folder on sourceforge
Re: AI empires don't do nothing
Upload finished. Posted link here.eleazar wrote:...Vezza:
I'll try it when it's ready...
- eleazar
- Design & Graphics Lead Emeritus
- Posts: 3858
- Joined: Sat Sep 23, 2006 7:09 pm
- Location: USA — midwest
Re: AI empires don't do nothing
Same thing. No AI ship movement.Vezzra wrote:Upload finished. Posted link here.
- Attachments
-
- 4625.zip
- (59.24 KiB) Downloaded 78 times
- Geoff the Medio
- Programming, Design, Admin
- Posts: 13603
- Joined: Wed Oct 08, 2003 1:33 am
- Location: Munich
Re: AI empires don't do nothing
Is there a version in which you know AI ships did move, and can you check if they still do move in that version on your system?
Re: AI empires don't do nothing
Hm, he did mention he saw AI ships moving in this post. I don't know exactly which build he used, but the post immediately before his was mine with the link to the SVN 4521 build with my python patch applied (wasn't in SVN at that time). So I assume it was this build he used.Geoff the Medio wrote:Is there a version in which you know AI ships did move, and can you check if they still do move in that version on your system?
This build is still available and can be downloaded.
Re: AI empires don't do nothing
Ok, I've looked into the matter a bit, this is what I discovered so far:
The problem is that the python interpreter on eleazer's system fails to locate the _struct module - but why, that's the big mystery here. The _struct module is included in the python framework that is bundled with the FO app, according to the logs eleazar provided the module search path is set correctly, the directory containing this module shows up in the list of python modules search paths.
When I load eleazar's savegame, I can play without problems, the AI fleets are moving, and no error messages show up in my AI logs.
Eleazar, could you try the following:
The problem is that the python interpreter on eleazer's system fails to locate the _struct module - but why, that's the big mystery here. The _struct module is included in the python framework that is bundled with the FO app, according to the logs eleazar provided the module search path is set correctly, the directory containing this module shows up in the list of python modules search paths.
When I load eleazar's savegame, I can play without problems, the AI fleets are moving, and no error messages show up in my AI logs.
Eleazar, could you try the following:
- Go into the terminal
- Invoke the python interpreter
- At the python prompt, type "import _struct"
- If that command throws an error, please report the error messages
- Otherwise, type "print _struct" and report the result
- Show the contents of the FO app package
- Go to Contents/Frameworks/Python.framework/Versions/Current/lib/python2.7/lib-dynload
- Look for the file "_struct.so" and tell me if it's there or if it's missing
- eleazar
- Design & Graphics Lead Emeritus
- Posts: 3858
- Joined: Sat Sep 23, 2006 7:09 pm
- Location: USA — midwest
Re: AI empires don't do nothing
How do i do that?Vezzra wrote:[*]Invoke the python interpreter
The closest file is named: "_struct.so000755 " Does that count?Vezzra wrote:Look for the file "_struct.so" and tell me if it's there or if it's missing
- eleazar
- Design & Graphics Lead Emeritus
- Posts: 3858
- Joined: Sat Sep 23, 2006 7:09 pm
- Location: USA — midwest
Re: AI empires don't do nothing
I'm downloading that, and will try it next...Vezzra wrote:Hm, he did mention he saw AI ships moving in this post. I don't know exactly which build he used, but the post immediately before his was mine with the link to the SVN 4521 build with my python patch applied (wasn't in SVN at that time). So I assume it was this build he used.Geoff the Medio wrote:Is there a version in which you know AI ships did move, and can you check if they still do move in that version on your system?
I appreciate the effort in trying to solve this.