AI Ladder, 0.5 - Page 6

AI Ladder, 0.5

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

Moderators: hoijui, Moderators

Post Reply
User avatar
hoijui
Former Engine Dev
Posts: 4344
Joined: 22 Sep 2007, 09:51

Re: AI Ladder, v0.1

Post by hoijui »

after adding my calcengine on the website as well, it works now.
though.. pls add some more map names, latest BA 7.01, and KAIK, RAI and AAI.
most ppl dont have HughAI or E323AI installed. i neither have on my main install under linux (eg, the one whichs spring executable is in PATH, which is hte current release version, installed from the package repository through synaptic)
User avatar
hoijui
Former Engine Dev
Posts: 4344
Joined: 22 Sep 2007, 09:51

Re: AI Ladder, v0.1

Post by hoijui »

umm.. ok i foudn out that i can add all this stuff myself :D doh!
added it (including some some stuff that can be removed..
and after a few tries, i got a game running sucessfully, as you can see on the page :-)
http://manageddreams.com/ailadderstagin ... results.py
it was not all that straight forward, but all possible.. nice work!
(of course one can not await it to be perfect with the speed you did it :D)
User avatar
hoijui
Former Engine Dev
Posts: 4344
Joined: 22 Sep 2007, 09:51

Re: AI Ladder, v0.1

Post by hoijui »

maybe add some contributors to the project, or make it possible for everyone to commit? :D
i woudl like to see that for once.. i somehow believe it would not even cause much trouble.
sorry for today, i was not.. fit/concentrated at all.
User avatar
aegis
Posts: 2456
Joined: 11 Jul 2007, 17:47

Re: AI Ladder, v0.1

Post by aegis »

my github username is lunixbochs, feel free to add me.
User avatar
hughperkins
AI Developer
Posts: 836
Joined: 17 Oct 2006, 04:14

Re: AI Ladder, v0.1

Post by hughperkins »

Super! Thanks guys. You're both added to the repository now by the way.

As far as staging vs non-staging by the way:
- staging is almost always the latest version, but gets database wiped regularly ;-)
- the prod version (http://manageddreams.com/ailadder) doesn't get database wiped often, if at all, ie I would try to preserve data during an upgrade, at least accounts and matchrequest/results, but on the other hand, upgrades are few and far between ;-)

You can upgrade staging to the latest version at any time by just doing:

http://manageddreams.com/ailadderstaging/reloaddb.cgi -> does a git pull on git repository, and reloads database schema from this
http://manageddreams.com/ailadderstaging/updatesite.cgi -> does a git pull on git repository, and copies the changed files to the website

reloaddb.cgi and updatesite.cgi are not in git, because then they would end up in the main prod site ;-) which probalby wouldn't be a good thing. reloaddb.cgi essentially does:

- git pull
- cd webserver/db
- ./dropall.sh
- ./addall.sh

updatesite.cgi essentially does:

- git pull
- rsync -av webserver/website $ailadderstagingdir
User avatar
hughperkins
AI Developer
Posts: 836
Joined: 17 Oct 2006, 04:14

Re: AI Ladder, v0.1

Post by hughperkins »

hoijui wrote:btw.. calcengine is not a good name :D
Yeah, feel free to change that!
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Re: AI Ladder, v0.1

Post by AF »

Use <ul><li> structures to store your menu. Use classes inserted on current pages and css to control what is currently visible.

Either way the following would have sufficed:

Code: Select all

<div style="float:left; wdth:200px;">put menu in here</div>
<div style="float:right; margin-left:220px;">page content here</div>
User avatar
hoijui
Former Engine Dev
Posts: 4344
Joined: 22 Sep 2007, 09:51

Re: AI Ladder, v0.1

Post by hoijui »

thanks hughperkins :-)
i do not plan to really work on it though.. maybe fix typos or try to enhance minor stuff... i never used phyton (except in SCons build system).
User avatar
hughperkins
AI Developer
Posts: 836
Joined: 17 Oct 2006, 04:14

Re: AI Ladder, v0.1

Post by hughperkins »

except in SCons build system
Haha! That's enough to put anyone off python for life!
User avatar
Error323
AI Developer
Posts: 237
Joined: 28 Nov 2006, 16:46

Re: AI Ladder, v0.1

Post by Error323 »

LOL true, that. While python is actually one of the best languages ever made! </offtopic>
User avatar
hughperkins
AI Developer
Posts: 836
Joined: 17 Oct 2006, 04:14

Re: AI Ladder, v0.1

Post by hughperkins »

AF wrote:Either way the following would have sufficed:
Well, bear in mind that prior to the change, the menu was static .html, and the things in the right-hand side were python pages that were totally independent of the menu.

To remove the frames, each page now has to somehow display the menu itself, which meant modifying every page to add in a couple of method calls before and after the code, and also removing any extraneous "<html>" tags and stuff. Not insurmountable, but rather more work than you are implying ;-)

Does look a lot nicer now though.
User avatar
hughperkins
AI Developer
Posts: 836
Joined: 17 Oct 2006, 04:14

Re: AI Ladder, v0.1

Post by hughperkins »

hoijui wrote:i do not plan to really work on it though..
Sure. You do have rather a lot of projects going on all at the same time :-DDDDD

Anyway, now you see the other side of, when I'm asking for loads of things in the Java Interface and so on, and you're thinking 'but it's easy to make that change! It'd only take 5 minutes!', and you're suggesting I just submit a patch for it, but you're forgetting, really it's 'it's easy for you to make that change, since you already know the Java Interface inside-out, back-to-front!

I have to say I'm very impressed by quite how much you manage to get done on Spring. Your name is all over the place!

As far as the AILadder... if you happen to have a machine bumping around somewhere that could be used as a calcengine/AI battle executor, that would be incredibly useful. It's kind of hard to run Spring, Eclipse, gedit, firefox, apache2, and mysql all at the same time on one poor Eeepc :shock:
User avatar
hoijui
Former Engine Dev
Posts: 4344
Joined: 22 Sep 2007, 09:51

Re: AI Ladder, v0.1

Post by hoijui »

i feel with you! poor boy!

the only machine i have that could be doing this, has no graphic card -> no spring :/
User avatar
hughperkins
AI Developer
Posts: 836
Joined: 17 Oct 2006, 04:14

Re: AI Ladder, v0.1

Post by hughperkins »

User avatar
hoijui
Former Engine Dev
Posts: 4344
Joined: 22 Sep 2007, 09:51

Re: AI Ladder, v0.1

Post by hoijui »

.. i neither run an X session.
User avatar
hughperkins
AI Developer
Posts: 836
Joined: 17 Oct 2006, 04:14

Re: AI Ladder, v0.1

Post by hughperkins »

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

Re: AI Ladder, v0.1

Post by hughperkins »

Looks like there is an example here:

http://www.nabble.com/osmesa-offline-re ... 88881.html

I think their example doesn't actually render, because they didn't call resize(), but we don't care whether it renders or not in fact!

Basically, it looks like we simply make two calls prior to calling InitGL:

Code: Select all

  ctx = OSMesaCreateContextExt( OSMESA_RGBA, 16, 0, 0, NULL );
 
   /* Allocate the image buffer */
   buffer = malloc( WIDTH * HEIGHT * 4 * sizeof(GLubyte) );
 
   /* Bind the buffer to the context and make it current */
   OSMesaMakeCurrent( ctx, buffer, GL_UNSIGNED_BYTE, WIDTH, HEIGHT );

   InitGL();

   // Draw stuff...
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Re: AI Ladder, v0.1

Post by AF »

How would I set this up right now? I'm not too bothered about headless sprign as I cna run it minimized and go to lectures and look when I get home
User avatar
KaiserJ
Community Representative
Posts: 3113
Joined: 08 Sep 2008, 22:59

Re: AI Ladder, v0.1

Post by KaiserJ »

offtopic, just a statement.

hughperkins GETS STUFF DONE. he's a facilitator. bow before him.

that been said, continue! lol
User avatar
hughperkins
AI Developer
Posts: 836
Joined: 17 Oct 2006, 04:14

Re: AI Ladder, v0.1

Post by hughperkins »

Thanks!

Btw, my gf is on holiday this week, hence the zero progress on Spring ;-) Bear with me...
How would I set this up right now? I'm not too bothered about headless sprign as I cna run it minimized and go to lectures and look when I get home
quick way (Edit: in retrospect, not that quick :P ):

Pre-requisites:
- python (tested with Python 2.6, but probably also kind of tested on 2.3)

Procedure:
- use the website at http://manageddreams.com/ailadderstaging
- reset the db to git by doing:
http://manageddreams.com/ailadderstaging/reloaddb.cgi (clears all data...)
- update the website from git by doing:
http://manageddreams.com/ailadderstaging/updatesite.cgi

Login as admin/admin, then you can register the map, mod and ai you want to use with your engine. You can register them under 'configuration' then 'view maps', 'view mods', and 'view ais'.

For now, the map, mod and admin should already be installed on your calcengine. (Note: calcengine means the machien that will actually run the AI battles.) In the future, maybe the calcengine will download them, but not in this version.

Having done the registration...

- get the latest git on your calcengine (AI battle machine). Go to:

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

.. click on 'download'

select 'tar' or 'zip'

- cd into the calcengine directory
- copy config.py.template to config.py
- customize config.py:
-- set websiteurl to 'http://manageddreams.com/ailadderstaging'
- run:

./calcengine.py

or:

python calcengine.py

... it should poll for matches to run, and say there are none.

... back to the website, under 'Runner' click on 'add request to queue'

... the calcengine should start runnign this match, on it's next poll, which by default is every minute, but you can change in the config.py.
Post Reply

Return to “AI”