AI Ladder, 0.5
Moderators: hoijui, Moderators
Re: AI Ladder, v0.1
you only need unitsync.py for it to work, generate.py is only for making a new unitsync.py from the unitsync headers if the unitsync api is updated.
- hughperkins
- AI Developer
- Posts: 836
- Joined: 17 Oct 2006, 04:14
Re: AI Ladder, v0.1
Ok. Cool.... Hmmm, does that mean that every time the unitsync api changes, then the unitsync.py will stop working?
License and copyright header?
License and copyright header?
Re: AI Ladder, v0.1
gpl-compatible is fine.
it won't necessarily stop working if the unitsync api changes... it just won't have an updated interface unless you generate a new one.
it won't necessarily stop working if the unitsync api changes... it just won't have an updated interface unless you generate a new one.
- hughperkins
- AI Developer
- Posts: 836
- Joined: 17 Oct 2006, 04:14
Re: AI Ladder, v0.1
Ok, sounds like just what I was hoping for!aegis wrote:it won't necessarily stop working if the unitsync api changes... it just won't have an updated interface unless you generate a new one.
Need a copyright notice. Name, just put 'aegis'?
Had a quick play, trying to get the modhash, tried:
Code: Select all
>>> unitsync.GetArchiveChecksum('BA696.sd7')
unitsync: archive checksum: BA696.sd7
1998817283L
>>> unitsync.GetPrimaryModChecksum(0)
4007474766L

Re: AI Ladder, v0.1
hmm strange!
this coudl be because of different base files... otherwise i dont know. also this should of corse not happen if you use only one version of spring (unitsync and spring beeing hte same version and using the same base files), are you calling the same spring that you use hte unitsync of?
about changes in unitsync:
These are relatively rare, as changes in unitsync require all Lobbies and dedicated hosts (plus possibly a few other things) to change, so these changes do not happen often. also, the functions you need here, are among the most used ones, and even much less likely to change.
this coudl be because of different base files... otherwise i dont know. also this should of corse not happen if you use only one version of spring (unitsync and spring beeing hte same version and using the same base files), are you calling the same spring that you use hte unitsync of?
about changes in unitsync:
These are relatively rare, as changes in unitsync require all Lobbies and dedicated hosts (plus possibly a few other things) to change, so these changes do not happen often. also, the functions you need here, are among the most used ones, and even much less likely to change.
- BrainDamage
- Lobby Developer
- Posts: 1164
- Joined: 25 Sep 2006, 13:56
Re: AI Ladder, v0.1
archive checksum = the hash of just the mod itself
mod checksum = hash of the mod chained with all the dependencies ( spring content, etc )
archive checksum will change only if hash algo gets changed
mod checksum changes almost every spring release because of base content change
the one used in startscript is mod checksum
make sure you got all the mod deps to get correct mod checksum
mod checksum = hash of the mod chained with all the dependencies ( spring content, etc )
archive checksum will change only if hash algo gets changed
mod checksum changes almost every spring release because of base content change
the one used in startscript is mod checksum
make sure you got all the mod deps to get correct mod checksum
- hughperkins
- AI Developer
- Posts: 836
- Joined: 17 Oct 2006, 04:14
Re: AI Ladder, v0.1
It looks like you can totally remove maphash=xxx and modhash=xxx from the start script, and spring still runs, so I'll simply remove them from everywhere, and forget they exist for now 

Re: AI Ladder, v0.1
script.txt wrote:ModHash=4090217643;
unitsync.GetPrimaryModChecksumFromName('ba696.sd7') wrote:4090217643L
- hughperkins
- AI Developer
- Posts: 836
- Joined: 17 Oct 2006, 04:14
Re: AI Ladder, v0.1
which is different again from the value I got
so it seems it's not really a stable value, and anyway it looks like it's not actually checked by spring anyway, so I'll just not use it at all.

Re: AI Ladder, v0.1
the point wasn't the difference between yours and mine, chances are I'm using a different version of spring's base files or sth... the point was mine match 

- hughperkins
- AI Developer
- Posts: 836
- Joined: 17 Oct 2006, 04:14
Re: AI Ladder, v0.1
@hoijui,
By the way, having the bot runner tell the website which maps and mods it as, and also which AIs maybe too if that is possible, is a really cool idea.
I'd still like the bot runner to be able to download at least the AIs though. I can add an option to the bot runner's config file so you can disable that, and the website admin can't override that.
Here's my thought though: the goal of the AILadder to me is that it shows a snapshot in time of where the AIs stand in relation to each other, and any AI dev can come along with a new version of their AI, tell the website about it, and see the results come in a few hours later against the other AIs, without anyone else needing to do anything, like actually have to isntall the AI by hand on their machine.
I understand that some people may not want the web admin to have the power to be able to tell any botrunner what to download at any time, so I'll add in an option to the botrunner config file like "allowaidownloading=true", and botrunner admins can set this to false if they wish.
@aegis, if I understand correctly, having AIs downloaded to your machines would be ok, since your machines are netbooted, and somewhat firewalled off from the rest of your network?
By the way, having the bot runner tell the website which maps and mods it as, and also which AIs maybe too if that is possible, is a really cool idea.
I'd still like the bot runner to be able to download at least the AIs though. I can add an option to the bot runner's config file so you can disable that, and the website admin can't override that.
Here's my thought though: the goal of the AILadder to me is that it shows a snapshot in time of where the AIs stand in relation to each other, and any AI dev can come along with a new version of their AI, tell the website about it, and see the results come in a few hours later against the other AIs, without anyone else needing to do anything, like actually have to isntall the AI by hand on their machine.
I understand that some people may not want the web admin to have the power to be able to tell any botrunner what to download at any time, so I'll add in an option to the botrunner config file like "allowaidownloading=true", and botrunner admins can set this to false if they wish.
@aegis, if I understand correctly, having AIs downloaded to your machines would be ok, since your machines are netbooted, and somewhat firewalled off from the rest of your network?
Re: AI Ladder, v0.1
yeah... that is a good way to go 
btw... i see it the same way as aegis, ther must be something wrong, which should be solved. eg, if you use a different unitsync then the one accosiated with the spring(.exe) you use, you will eg fetch the available mods for one installation, but start an other installation of spring. as you wrote you just started his example and it worked, i guess he/his script somehow searches unitsync itsself. maybe you have to manually tell it the path to unitsync, and hand it over the one specified in the config file.
Also, in the long run it would be better to have the hashes, ad there are sometimes different versions of a map, having the same name (no version). well in most cases it will not be very important for maps, but coudl make some different for mods.

btw... i see it the same way as aegis, ther must be something wrong, which should be solved. eg, if you use a different unitsync then the one accosiated with the spring(.exe) you use, you will eg fetch the available mods for one installation, but start an other installation of spring. as you wrote you just started his example and it worked, i guess he/his script somehow searches unitsync itsself. maybe you have to manually tell it the path to unitsync, and hand it over the one specified in the config file.
Also, in the long run it would be better to have the hashes, ad there are sometimes different versions of a map, having the same name (no version). well in most cases it will not be very important for maps, but coudl make some different for mods.
- hughperkins
- AI Developer
- Posts: 836
- Joined: 17 Oct 2006, 04:14
Re: AI Ladder, v0.1
Okyeah... that is a good way to go

The issue is, it looks like the hashes are not f(map) or f(mod), for some function f, but in fact f(map,springversion,basefiles) and f(map,springversion,basefiles).... so they are not stable, and will need to be updated every time there is a new version of spring, which is fairly often!Also, in the long run it would be better to have the hashes, ad there are sometimes different versions of a map
Since Spring doesn't check the hash anyway, (try "find rts -name "*.cpp" -print | xargs -l1 grep -Hi maphash" and you'll see only a single reference to maphash, setting a variable maphash, and then ... doing nothing


Re: AI Ladder, v0.1
the archive hash is stable, the one including dependencies is not.
- hughperkins
- AI Developer
- Posts: 836
- Joined: 17 Oct 2006, 04:14
Re: AI Ladder, v0.1
Unfortunately, the one that is in the start script seems to be the one that includes dependencies?aegis wrote:the archive hash is stable, the one including dependencies is not.
Re: AI Ladder, v0.1
because when running the game, your base files must match too.
Re: AI Ladder, v0.1
trying to sum it all up:
- it makes no sense to store the Mod-/Map-hash, as it would change every new spring release
- the archive hash could be stored, as it never changes for one map/mod + version
- the archive hash can not be written into script.txt, but could still be used by the AI ladder to verify the mod/map (should be trivial, but is not very important i would say, and surely cna be added easily at any step in development)
- it would be good for hugh to get the hashes to match up, as there is bound to be something wrong if they do not
- hughperkins
- AI Developer
- Posts: 836
- Joined: 17 Oct 2006, 04:14
Re: AI Ladder, v0.1
Stop sounding so reasonable
Ok, that makes a lot of sense, and actually, in the case that I add downloading of maps and mods will be very useful, ie we can have the following algo on the botrunner:
Oh... for the naming, I'm going to do a massive search and replace to change 'calcengine' to 'botrunner' since that seems to be the name we've settled after chatting in this thread for a while, I think?

Code: Select all
getrequest:
if request is downloadmaprequest:
downloadmap
if map archive hash matches requested download hash, tell webserver map downloaded
otherwise just continue to next request (which could be a new request to download the same map again)