AI Ladder, 0.5 - Page 11

AI Ladder, 0.5

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

Moderators: hoijui, Moderators

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

Re: AI Ladder, 0.3

Post by aegis »

sqlalchemy isn't guaranteed to be backwards-compatible.. the version uberserver is using is actually older.
iirc the newest version of sqlalchemy doesn't work with uberserver out of the box.

I just have a dependency fetching script which grabs things like the iptocountry database and sqlalchemy from my web host and extracts them to the current folder.

btw I can give you ssh to setup a botrunner on my netboot base virtual machine if you want... whatever it does needs to be able to run on four separate computers from the same location.
User avatar
hughperkins
AI Developer
Posts: 836
Joined: 17 Oct 2006, 04:14

Re: AI Ladder, 0.3

Post by hughperkins »

aegis wrote:I just have a dependency fetching script which grabs things like the iptocountry database and sqlalchemy from my web host and extracts them to the current folder.
ok, how do you handle sqlalchemy installation. For example, on dreamhost, sqlalchemy cannot be installed globally.

botrunners don't need sqlalchemy, just need a bog-standard python, and that is all.
btw I can give you ssh to setup a botrunner on my netboot base virtual machine if you want...
Yeah, that would be super! That's what I've been waiting for :-)
whatever it does needs to be able to run on four separate computers from the same location.
Yeah, that should be fine. Just call them aegis1, aegis2, aegis3, ... They can each have the same sharedsecret. They are identified by their botrunner name, we don't check ipaddress or anything like that.

Since all network connections are from the botrunner to the website, there should be no major issues with NAT, firewalls, etc.
User avatar
aegis
Posts: 2456
Joined: 11 Jul 2007, 17:47

Re: AI Ladder, 0.3

Post by aegis »

hughperkins wrote:Yeah, that should be fine. Just call them aegis1, aegis2, aegis3, ... They can each have the same sharedsecret. They are identified by their botrunner name, we don't check ipaddress or anything like that.
not quite what I meant.
my netboot system is currently setup to share a single root filesystem with all of the clients...
basically, make it so you can run it from the same computer multiple times without changing any configuration.
User avatar
hoijui
Former Engine Dev
Posts: 4344
Joined: 22 Sep 2007, 09:51

Re: AI Ladder, 0.3

Post by hoijui »

aegis, i guess it would be nice if you could somehow make a spring data directory available on your machines, with a lot of maps and mods already there. that would mean we could rely on this, and the actual installation of spring-headless plus ailadder should take very little space then (less then 100MB i guess), which would possibly make things easier.

about the running multiple times from one computer:
would specifying/overriding the botrunner name through a command line paramter already be enough? or maybe suply hte config file ot be used on the command line?
though, the botrunner is small, so having 4 installations would not be the worst either.
imbaczek
Posts: 3629
Joined: 22 Aug 2006, 16:19

Re: AI Ladder, 0.3

Post by imbaczek »

hint: use virtualenv with easy_install, you can request any version you want, as long as it exists on pypi. (e.g. easy_install sqlalchemy==0.5)
User avatar
aegis
Posts: 2456
Joined: 11 Jul 2007, 17:47

Re: AI Ladder, 0.3

Post by aegis »

hoijui wrote:aegis, i guess it would be nice if you could somehow make a spring data directory available on your machines, with a lot of maps and mods already there.
I'll have them mount my spring datadir from my main box, with 3gb of maps...
hoijui wrote: would specifying/overriding the botrunner name through a command line paramter already be enough? or maybe suply hte config file ot be used on the command line?
though, the botrunner is small, so having 4 installations would not be the worst either.
to clarify
I can use wake-on-lan to only boot the servers when they are needed... maybe write a lobby bot to provide basic control/stats... there's no reason botrunner can't support running multiple copies from the same spot with zero configuration.
User avatar
aegis
Posts: 2456
Joined: 11 Jul 2007, 17:47

Re: AI Ladder, 0.3

Post by aegis »

imbaczek wrote:hint: use virtualenv with easy_install, you can request any version you want, as long as it exists on pypi. (e.g. easy_install sqlalchemy==0.5)
there's no guarantee a web host will have setuptools.
User avatar
hughperkins
AI Developer
Posts: 836
Joined: 17 Oct 2006, 04:14

Re: AI Ladder, 0.3

Post by hughperkins »

imbaczek wrote:hint: use virtualenv with easy_install, you can request any version you want, as long as it exists on pypi. (e.g. easy_install sqlalchemy==0.5)
Ah sweet! Thanks!
User avatar
hughperkins
AI Developer
Posts: 836
Joined: 17 Oct 2006, 04:14

Re: AI Ladder, 0.3

Post by hughperkins »

aegis wrote:I can use wake-on-lan to only boot the servers when they are needed... maybe write a lobby bot to provide basic control/stats... there's no reason botrunner can't support running multiple copies from the same spot with zero configuration.
Hmmm.... to clarify, the only thing that makes it not possible to share the same name currently is that there is currently a purge heuristic to get rid of matchrequests that have been assigned to an engine but not completed.

Currently the algo works as follows:
- botrunner sends a request to website for a new match
- website purges any assigned requests that haven't finished after a certain amount of time (one hour say). This isn't quite implemented at the moment, though it would be quite simple to implement this.
- the bit that needs unique names at the moment: website purges all requests previously assigned to the requesting botrunner - based on the botrunner's name - that have not been completed yet
- website picks the first request from the request queue that matches the botrunner's maps and mods, and hasn't been assigned to a botrunner or completed
- passes that back to the botrunner

The motivation for adding in this heuristic - that forces the names to be unique for now - is that during testing, I found that I built up rapidly a large list of matchrequests allegedly all being processed by the same botrunner ...

With the advent of ping implementation, one could assume that the internet is always-up and entirely reliable, and purge any requests being processed by a botrunner that hasn't sent a ping recently.

One could make each botrunner generate a random identifier each time it is started, and record this identifier along with any matches in progress, and send it with the pings.

There's also ip addresses and mac addresses, but they have their own issues, even assuming a portable way to obtain them. For example, on my eeepc, turning off the wifi removes the nic entirely from the system...
User avatar
aegis
Posts: 2456
Joined: 11 Jul 2007, 17:47

Re: AI Ladder, 0.3

Post by aegis »

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...
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Re: AI Ladder, 0.3

Post by AF »

Allow specifying a configuration file at command line at start?
User avatar
aegis
Posts: 2456
Joined: 11 Jul 2007, 17:47

Re: AI Ladder, 0.3

Post by aegis »

aegis wrote:same command...no configuration changes...
ideally, I won't need to mess with these servers during normal operation, including power on/off.
for the sake of simplicity, they share a primary drive.

I can modify the botrunner to use account name locks and a list of accounts, but that's less clean than just supporting multiple connections from the same bot account.

if you support this, I might be able to add at least ten fast botrunners :P
User avatar
aegis
Posts: 2456
Joined: 11 Jul 2007, 17:47

Re: AI Ladder, 0.3

Post by aegis »

normal spring built fine, got this when building headless with "make spring-headless":
/home/aegis/springheadless/rts/Map/SM3/terrain/TerrainNode.h:99: error: âGLuintâ does not name a type
/home/aegis/springheadless/rts/Map/SM3/terrain/Terrain.cpp: In member function âint terrain::TQuad::GetVertexSize()â:
/home/aegis/springheadless/rts/Map/SM3/terrain/Terrain.cpp:186: error: invalid use of incomplete type âstruct terrain::RenderSetupCollectionâ
/home/aegis/springheadless/rts/Map/SM3/terrain/TerrainNode.h:51: error: forward declaration of âstruct terrain::RenderSetupCollectionâ
/home/aegis/springheadless/rts/Map/SM3/terrain/Terrain.cpp:187: error: âVRT_Normalâ was not declared in this scope
/home/aegis/springheadless/rts/Map/SM3/terrain/Terrain.cpp:189: error: âVRT_TangentSpaceMatrixâ was not declared in this scope
first error went away after adding '#include "Rendering/GL/myGL.h"' to rts/Map/SM3/terrain/TerrainNode.h, but the rest are still there
User avatar
hoijui
Former Engine Dev
Posts: 4344
Joined: 22 Sep 2007, 09:51

Re: AI Ladder, 0.3

Post by hoijui »

am not sure, but i think you are using the headless branch (which is my trial). you should get the master branch from hughs spring fork repo.
User avatar
aegis
Posts: 2456
Joined: 11 Jul 2007, 17:47

Re: AI Ladder, 0.3

Post by aegis »

I think I'm still getting the error on the master branch... cleaned and building one more time to be sure.

edit:
it builds spring-headlessstubs as part of the normal build process, and everything works fine now :)
User avatar
aegis
Posts: 2456
Joined: 11 Jul 2007, 17:47

Re: AI Ladder, 0.3

Post by aegis »

ran some preliminary tests to measure possible performance, and these numbers are AWESOME :D

six AAIs on smalldivide: game lasted 29 minutes, but the computer completed it in 47 seconds.
six KAIKs on smalldivide: game lasted 24 minutes, computer completed it in 42 seconds.
six RAIs on smalldivide: game lasted 11 minutes, computer completed it in 17 seconds.

edit: twelve RAIs on 40x40 epic map: game lasted 88 minutes, computer completed it in 37 minutes. memory usage at the end of the game was about 1.2gb.
User avatar
hughperkins
AI Developer
Posts: 836
Joined: 17 Oct 2006, 04:14

Re: AI Ladder, 0.3

Post by hughperkins »

aegis wrote:ran some preliminary tests to measure possible performance, and these numbers are AWESOME :D

six AAIs on smalldivide: game lasted 29 minutes, but the computer completed it in 47 seconds.
:shock: :lol:
User avatar
hughperkins
AI Developer
Posts: 836
Joined: 17 Oct 2006, 04:14

Re: AI Ladder, 0.3

Post by hughperkins »

AILadder update: finished migrating to sqlalchemy, and merged into master ailadder git branch.
User avatar
hughperkins
AI Developer
Posts: 836
Joined: 17 Oct 2006, 04:14

Re: AI Ladder, 0.3

Post by hughperkins »

AILadder update, in git master:

- added multicall for map registration, mod registration and ai registration
-- this means that all maps are registered in a single network call, ditto for ais, and again for mods
-- should be much faster for first run of botrunner on systems with hundreds of maps
User avatar
hughperkins
AI Developer
Posts: 836
Joined: 17 Oct 2006, 04:14

Re: AI Ladder, 0.3

Post by hughperkins »

New release, 0.5:
- multicall means map registration should be much faster now
- botrunner sessions mean that you can run multiple botrunners using the same name

Under the hood:
- migrated to sqlalchemy

both ailadder and ailadderstaging updated:
http://manageddreams.com/ailadder
http://manageddreams.com/ailadderstaging

http://manageddreams.com/ailadder/downl ... .0.tar.bz2
Post Reply

Return to “AI”