Page 6 of 17

Re: AI Ladder, v0.1

Posted: 26 Sep 2009, 19:38
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)

Re: AI Ladder, v0.1

Posted: 26 Sep 2009, 20:01
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)

Re: AI Ladder, v0.1

Posted: 26 Sep 2009, 20:04
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.

Re: AI Ladder, v0.1

Posted: 26 Sep 2009, 20:07
by aegis
my github username is lunixbochs, feel free to add me.

Re: AI Ladder, v0.1

Posted: 27 Sep 2009, 02:16
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

Re: AI Ladder, v0.1

Posted: 27 Sep 2009, 03:02
by hughperkins
hoijui wrote:btw.. calcengine is not a good name :D
Yeah, feel free to change that!

Re: AI Ladder, v0.1

Posted: 27 Sep 2009, 05:10
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>

Re: AI Ladder, v0.1

Posted: 27 Sep 2009, 08:07
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).

Re: AI Ladder, v0.1

Posted: 27 Sep 2009, 09:36
by hughperkins
except in SCons build system
Haha! That's enough to put anyone off python for life!

Re: AI Ladder, v0.1

Posted: 27 Sep 2009, 09:43
by Error323
LOL true, that. While python is actually one of the best languages ever made! </offtopic>

Re: AI Ladder, v0.1

Posted: 27 Sep 2009, 09:44
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.

Re: AI Ladder, v0.1

Posted: 27 Sep 2009, 09:59
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:

Re: AI Ladder, v0.1

Posted: 27 Sep 2009, 10:34
by hoijui
i feel with you! poor boy!

the only machine i have that could be doing this, has no graphic card -> no spring :/

Re: AI Ladder, v0.1

Posted: 27 Sep 2009, 11:10
by hughperkins

Re: AI Ladder, v0.1

Posted: 27 Sep 2009, 11:14
by hoijui
.. i neither run an X session.

Re: AI Ladder, v0.1

Posted: 27 Sep 2009, 11:20
by hughperkins

Re: AI Ladder, v0.1

Posted: 27 Sep 2009, 18:42
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...

Re: AI Ladder, v0.1

Posted: 02 Oct 2009, 17:08
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

Re: AI Ladder, v0.1

Posted: 02 Oct 2009, 21:15
by KaiserJ
offtopic, just a statement.

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

that been said, continue! lol

Re: AI Ladder, v0.1

Posted: 08 Oct 2009, 13:48
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.