AI Ladder, 0.5 - Page 12

AI Ladder, 0.5

Here is where ideas can be collected for the skirmish AI in development

Moderators: hoijui, Moderators

User avatar
hughperkins
AI Developer
Posts: 836
Joined: 17 Oct 2006, 04:14

Re: AI Ladder, 0.3

Post by hughperkins »

aegis wrote:make it possible to run the calcengine with the same command from the same folder on the same computer multiple times with a single account and no configuration changes...
Should be possible using release 0.5. Note that each botrunner with the same name really should be identical, ie: same maps, mods and ais.
User avatar
aegis
Posts: 2456
Joined: 11 Jul 2007, 17:47

Re: AI Ladder, 0.5

Post by aegis »

hughperkins wrote:Note that each botrunner with the same name really should be identical, ie: same maps, mods and ais.
they're running from the exact same folder with the exact same operating system install.

also, the servers are ready except for installing the botrunner code. can your end push jobs to eight fast botrunners effectively?
User avatar
hoijui
Former Engine Dev
Posts: 4344
Joined: 22 Sep 2007, 09:51

Re: AI Ladder, 0.5

Post by hoijui »

as i understand it, each botrunner, even if it has the same name, would need a different writeable spring-data-dir, no?
mainly because of log and cache files (infolog and AI logs and so on).
is this a problem for your settup, aegis?
User avatar
hughperkins
AI Developer
Posts: 836
Joined: 17 Oct 2006, 04:14

Re: AI Ladder, 0.5

Post by hughperkins »

hoijui wrote:as i understand it, each botrunner, even if it has the same name, would need a different writeable spring-data-dir, no?
mainly because of log and cache files (infolog and AI logs and so on).
is this a problem for your settup, aegis?
Hmmm, hoijui is right. The writable spring data directories need to be unique, per botrunner-instance.
they're running from the exact same folder with the exact same operating system install.
Yeah, from the point of view of the botrunner and website that should be fine. Each botrunner instance generates its own sessionid, and stores it in memory: it is never written to disk.

The config is essentially read-only.
also, the servers are ready except for installing the botrunner code. can your end push jobs to eight fast botrunners effectively?
Should be fine. The botrunners do a pull on the website, so they pull whenever they're ready.

You said each game takes about 20 seconds? So 16 machines is one request every 1.2 seconds? Even dreamhost can handle that I suspect ;-)
User avatar
hughperkins
AI Developer
Posts: 836
Joined: 17 Oct 2006, 04:14

Re: AI Ladder, 0.5

Post by hughperkins »

For the writable spring-directory, perhaps you could use tmpfs, which just holds the files in memory? :

In /etc/fstab:

Code: Select all

tmpfs   /home/user/.spring        tmpfs   defaults        0       0
... then simply copy the persistent stuff from the writable spring-directory to some other directory, let's say, /home/user/persistent/.spring

... then when the computer boots, you can create a task in /etc/init.d, like for example /etc/init.d/setupspring, linked to by /etc/rc2.d/setupspring-S40 for example, which does:

Code: Select all

rsync -av /home/user/persistent/.spring/ /home/user/.spring
User avatar
hoijui
Former Engine Dev
Posts: 4344
Joined: 22 Sep 2007, 09:51

Re: AI Ladder, 0.5

Post by hoijui »

an alternative may be to use the env var 'SPRING_DATADIR' (colon separated list, like PATH). This has the highest priority, and should turn up as the writeable data dir when set.
User avatar
hughperkins
AI Developer
Posts: 836
Joined: 17 Oct 2006, 04:14

Re: AI Ladder, 0.5

Post by hughperkins »

hoijui wrote:an alternative may be to use the env var 'SPRING_DATADIR' (colon separated list, like PATH). This has the highest priority, and should turn up as the writeable data dir when set.
Ah, so could do something like, in pseudo-python:

Code: Select all

writabledatadir = '/tmp/' + sessionid
os.path.makedir(writabledatadir)
sys.env['SPRING_DATADIR'] = writabledatadir
process.Popen('spring', ... etc ...
Edit: maybe could have a commandline option like:

Code: Select all

./botrunner.py --per-session-data-dir-prefix=/tmp/
User avatar
hoijui
Former Engine Dev
Posts: 4344
Joined: 22 Sep 2007, 09:51

Re: AI Ladder, 0.5

Post by hoijui »

yeah, thta sounds good :-)
User avatar
hughperkins
AI Developer
Posts: 836
Joined: 17 Oct 2006, 04:14

Re: AI Ladder, 0.5

Post by hughperkins »

hoijui wrote:yeah, thta sounds good :-)
Well, it's a worst case.

The implication is that every time a botrunner is run, there will be a new directory....

If each machine can have it's own data directory, eg in tmpfs, that will probably be cleaner.
User avatar
aegis
Posts: 2456
Joined: 11 Jul 2007, 17:47

Re: AI Ladder, 0.5

Post by aegis »

already set up a local server for assigning unique names to each bot in case I couldn't use the same bot name on the website (also for proxying the bots to a single spring bot), so I can make this unique name only apply to the working spring directory. I'll set this up when I get home :)
User avatar
aegis
Posts: 2456
Joined: 11 Jul 2007, 17:47

Re: AI Ladder, 0.5

Post by aegis »

botrunner/utils/userinput.py uses sys and os but doesn't import them <_<

oh, and I get a segfault when botrunner runs, after configuring. awesome.

edit: unitsync.GetWritableDataDirectory() segfaults...
User avatar
hughperkins
AI Developer
Posts: 836
Joined: 17 Oct 2006, 04:14

Re: AI Ladder, 0.5

Post by hughperkins »

aegis wrote:botrunner/utils/userinput.py uses sys and os but doesn't import them <_<
Corrected:

http://manageddreams.com/ailadder/downl ... .7.tar.bz2

corresponding git branch is "0.5"
unitsync.GetWritableDataDirectory() segfaults...
Works on my machine. Jaunty, python 2.6.2. What is different between your machine and my machine that could explain this?

Oh... hmmm, maybe unitsync_api.h? Do you want to try re-running generate and see if that works better?
User avatar
aegis
Posts: 2456
Joined: 11 Jul 2007, 17:47

Re: AI Ladder, 0.5

Post by aegis »

det and I worked it out, seems to be a bug with 64-bit returning char* pointers... in other news, I'll have my botrunners up as soon as I patch generate.py :)
User avatar
hughperkins
AI Developer
Posts: 836
Joined: 17 Oct 2006, 04:14

Re: AI Ladder, 0.5

Post by hughperkins »

aegis wrote:det and I worked it out, seems to be a bug with 64-bit returning char* pointers... in other news, I'll have my botrunners up as soon as I patch generate.py :)
Great! Good work aegis. Can you send me the new generate.py once it's done, or patch the one in:

http://github.com/hughperkins/ailadder/tree/master

?
User avatar
aegis
Posts: 2456
Joined: 11 Jul 2007, 17:47

Re: AI Ladder, 0.5

Post by aegis »

I'll paste it here, since I haven't bothered getting pushing to git setup yet

edit: seems to be no more errors here, just errors in botrunner ;)
xmlrpclib.Fault: <Fault 1: "sqlalchemy.orm.exc.FlushError:New instance <BotRunnerSupportedMap at 0x-48816ed4> with identity key (<class 'core.tableclasses.BotRunnerSupportedMap'>, (3L, 7L)) conflicts with persistent instance <BotRunnerSupportedMap at 0x-48816e94>">
Attachments
unitsync.zip
(6.65 KiB) Downloaded 16 times
User avatar
hughperkins
AI Developer
Posts: 836
Joined: 17 Oct 2006, 04:14

Re: AI Ladder, 0.5

Post by hughperkins »

aegis wrote:I'll paste it here, since I haven't bothered getting pushing to git setup yet
Ok, cool!
User avatar
aegis
Posts: 2456
Joined: 11 Jul 2007, 17:47

Re: AI Ladder, 0.5

Post by aegis »

I'll check out your sqlalchemy implementation, maybe restructure or fix it a bit
User avatar
hughperkins
AI Developer
Posts: 836
Joined: 17 Oct 2006, 04:14

Re: AI Ladder, 0.5

Post by hughperkins »

aegis wrote:I'll check out your sqlalchemy implementation, maybe restructure or fix it a bit
Ok, that sounds good!
User avatar
aegis
Posts: 2456
Joined: 11 Jul 2007, 17:47

Re: AI Ladder, 0.5

Post by aegis »

that error I pasted might be due to you saving an instance of an object to the same session twice?

edit: another error
http://manageddreams.com/ailadder/viewbotrunners.py

the first error appears to be something to do with my moderately large collection of maps, and doesn't make me happy :(
User avatar
aegis
Posts: 2456
Joined: 11 Jul 2007, 17:47

Re: AI Ladder, 0.5

Post by aegis »

also reloading the staging website broke it hard, yay.

*sigh* might run it locally so I don't need to forward debug code through git
Post Reply

Return to “AI”