FreeOrion

Forums for the FreeOrion project
It is currently Wed May 22, 2013 11:55 am

All times are UTC




Post new topic Reply to topic  [ 54 posts ]  Go to page Previous  1, 2, 3, 4  Next
Author Message
 Post subject: Re: AI empires don't do nothing
PostPosted: Fri Jan 27, 2012 4:41 pm 
Offline
Design & Graphics Lead
User avatar

Joined: Sat Sep 23, 2006 7:09 pm
Posts: 3693
Location: USA — midwest
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.


Attachments:
logs-n-save.zip [211.64 KiB]
Downloaded 7 times

_________________
—• Read this First before posting Game Design Ideas!
—• Design Philosophy

—•— My Ideas, Organized —•— Get an Avatar —•— Acronyms —•—
Top
 Profile  
 
 Post subject: Re: AI empires don't do nothing
PostPosted: Fri Jan 27, 2012 10:39 pm 
Offline
Programming, Design, and De Facto Lead
User avatar

Joined: Wed Oct 08, 2003 1:33 am
Posts: 7891
Location: Vancouver, BC
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
Code:
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

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:
Code:
                /*
                GenerateSitRepMessage
                    message = "EFFECT_MONSTER_SPAWNING"
                    parameters = [
                        tag = "predefinedshipdesign" data = "SM_KRILL_3"
                        tag = "system" data = Source.SystemID
                        */    <----- here
                    ]

In the logs, this is causing errors such as
Code:
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 [
              ^


Top
 Profile  
 
 Post subject: Re: AI empires don't do nothing
PostPosted: Sat Jan 28, 2012 1:31 am 
Offline
Design & Graphics Lead
User avatar

Joined: Sat Sep 23, 2006 7:09 pm
Posts: 3693
Location: USA — midwest
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 downloaded Vezzra's r4615 build and RC2. Played for about ten turns and none of the AI fleets moved, in either.
I don't want to try all the builds blindly. Is there somewhere i should start?


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.

Looks like i got them all wrong. :oops: Should be fixed in revision 4625.

_________________
—• Read this First before posting Game Design Ideas!
—• Design Philosophy

—•— My Ideas, Organized —•— Get an Avatar —•— Acronyms —•—


Top
 Profile  
 
 Post subject: Re: AI empires don't do nothing
PostPosted: Sat Jan 28, 2012 2:18 am 
Offline
Programming, Design, and De Facto Lead
User avatar

Joined: Wed Oct 08, 2003 1:33 am
Posts: 7891
Location: Vancouver, BC
eleazar wrote:
I don't want to try all the builds blindly. Is there somewhere i should start?
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...?

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...


Top
 Profile  
 
 Post subject: Re: AI empires don't do nothing
PostPosted: Sat Jan 28, 2012 9:10 pm 
Offline
Programmer and Packager
User avatar

Joined: Wed Nov 16, 2011 12:56 pm
Posts: 766
Location: Sol III
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?


Attachments:
File comment: AI log files
AI_logs.zip [55.61 KiB]
Downloaded 2 times
Top
 Profile  
 
 Post subject: Re: AI empires don't do nothing
PostPosted: Sat Jan 28, 2012 9:18 pm 
Offline
Design & Graphics Lead
User avatar

Joined: Sat Sep 23, 2006 7:09 pm
Posts: 3693
Location: USA — midwest
Geoff 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.

--downloading

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.

_________________
—• Read this First before posting Game Design Ideas!
—• Design Philosophy

—•— My Ideas, Organized —•— Get an Avatar —•— Acronyms —•—


Top
 Profile  
 
 Post subject: Re: AI empires don't do nothing
PostPosted: Sat Jan 28, 2012 9:41 pm 
Offline
Programmer and Packager
User avatar

Joined: Wed Nov 16, 2011 12:56 pm
Posts: 766
Location: Sol III
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.

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).


Top
 Profile  
 
 Post subject: Re: AI empires don't do nothing
PostPosted: Sat Jan 28, 2012 9:47 pm 
Offline
Design & Graphics Lead
User avatar

Joined: Sat Sep 23, 2006 7:09 pm
Posts: 3693
Location: USA — midwest
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

_________________
—• Read this First before posting Game Design Ideas!
—• Design Philosophy

—•— My Ideas, Organized —•— Get an Avatar —•— Acronyms —•—


Top
 Profile  
 
 Post subject: Re: AI empires don't do nothing
PostPosted: Sat Jan 28, 2012 10:32 pm 
Offline
Programmer and Packager
User avatar

Joined: Wed Nov 16, 2011 12:56 pm
Posts: 766
Location: Sol III
eleazar wrote:
...Vezza:
I'll try it when it's ready...

Upload finished. Posted link here.


Top
 Profile  
 
 Post subject: Re: AI empires don't do nothing
PostPosted: Sun Jan 29, 2012 7:03 pm 
Offline
Design & Graphics Lead
User avatar

Joined: Sat Sep 23, 2006 7:09 pm
Posts: 3693
Location: USA — midwest
Vezzra wrote:
Upload finished. Posted link here.

Same thing. No AI ship movement.


Attachments:
4625.zip [59.24 KiB]
Downloaded 7 times

_________________
—• Read this First before posting Game Design Ideas!
—• Design Philosophy

—•— My Ideas, Organized —•— Get an Avatar —•— Acronyms —•—
Top
 Profile  
 
 Post subject: Re: AI empires don't do nothing
PostPosted: Sun Jan 29, 2012 7:10 pm 
Offline
Programming, Design, and De Facto Lead
User avatar

Joined: Wed Oct 08, 2003 1:33 am
Posts: 7891
Location: Vancouver, BC
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?


Top
 Profile  
 
 Post subject: Re: AI empires don't do nothing
PostPosted: Sun Jan 29, 2012 7:24 pm 
Offline
Programmer and Packager
User avatar

Joined: Wed Nov 16, 2011 12:56 pm
Posts: 766
Location: Sol III
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?

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.

This build is still available and can be downloaded.


Top
 Profile  
 
 Post subject: Re: AI empires don't do nothing
PostPosted: Sun Jan 29, 2012 9:10 pm 
Offline
Programmer and Packager
User avatar

Joined: Wed Nov 16, 2011 12:56 pm
Posts: 766
Location: Sol III
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:

  • 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

Another thing you can check:

  • 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

Once I have these infos I'll try to work from there... but I have to admit, I'm really scratching my head atm... :?


Top
 Profile  
 
 Post subject: Re: AI empires don't do nothing
PostPosted: Sun Jan 29, 2012 9:57 pm 
Offline
Design & Graphics Lead
User avatar

Joined: Sat Sep 23, 2006 7:09 pm
Posts: 3693
Location: USA — midwest
Vezzra wrote:
[*]Invoke the python interpreter

How do i do that?

Vezzra wrote:
Look for the file "_struct.so" and tell me if it's there or if it's missing

The closest file is named: "_struct.so000755 " Does that count?

_________________
—• Read this First before posting Game Design Ideas!
—• Design Philosophy

—•— My Ideas, Organized —•— Get an Avatar —•— Acronyms —•—


Top
 Profile  
 
 Post subject: Re: AI empires don't do nothing
PostPosted: Sun Jan 29, 2012 10:07 pm 
Offline
Design & Graphics Lead
User avatar

Joined: Sat Sep 23, 2006 7:09 pm
Posts: 3693
Location: USA — midwest
Vezzra wrote:
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?

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.

I'm downloading that, and will try it next...

I appreciate the effort in trying to solve this.

_________________
—• Read this First before posting Game Design Ideas!
—• Design Philosophy

—•— My Ideas, Organized —•— Get an Avatar —•— Acronyms —•—


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 54 posts ]  Go to page Previous  1, 2, 3, 4  Next

All times are UTC


Who is online

Users browsing this forum: Google [Bot] and 0 guests


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 © 2000, 2002, 2005, 2007 phpBB Group