Options

Google AI Challenge

13

Posts

  • Options
    The AnonymousThe Anonymous Uh, uh, uhhhhhh... Uh, uh.Registered User regular
    edited October 2010
    Might as well give up and just start using Java...

    The Anonymous on
  • Options
    SirUltimosSirUltimos Don't talk, Rusty. Just paint. Registered User regular
    edited October 2010
    The problem isn't on my end at all. According to their forums there's a memory leak in the version of mono they're using. I keep getting errors saying there is no space left, so I'm assuming there's no memory left to compile it with thanks to the leak.

    SirUltimos on
  • Options
    PeccaviPeccavi Registered User regular
    edited October 2010
    Welp, got an account, downloaded the starter package, and per the website, tried uploading the starter package right away. ERROR. Ah well, guess I'll start tinkering before I even get on the leaderboard. Let's see how much I remember from that Intro to Java class I took 4 years ago.

    Edit: Was finally able to upload some code, won a match with it, and am attempting to view the match. How long does it take the viewer to load?

    Edit 2: The visualizer on the website doesn't seem to work for me. All I see is a black square with a grey circle in it. Anyone got any ideas?

    Peccavi on
  • Options
    CmdPromptCmdPrompt Registered User regular
    edited October 2010
    If you guys have accounts, you should post links to them! The competition is fun.
    Peccavi wrote: »
    Edit 2: The visualizer on the website doesn't seem to work for me. All I see is a black square with a grey circle in it. Anyone got any ideas?
    I think it's a HTML5 thing, so you should make sure your browser supports it.

    CmdPrompt on
    GxewS.png
  • Options
    PeccaviPeccavi Registered User regular
    edited October 2010
    CmdPrompt wrote: »
    If you guys have accounts, you should post links to them! The competition is fun.
    Peccavi wrote: »
    Edit 2: The visualizer on the website doesn't seem to work for me. All I see is a black square with a grey circle in it. Anyone got any ideas?
    I think it's a HTML5 thing, so you should make sure your browser supports it.

    Yeah, it works if I use Chrome, but not when I use Mozilla.

    Peccavi on
  • Options
    HalibutHalibut Passion Fish Swimming in obscurity.Registered User regular
    edited October 2010
    I think this is the quickest game I've ever won. http://ai-contest.com/visualizer.php?game_id=5528887

    Edit: I'm pretty sure it was against a starter bot, so I'm not nearly as awesome as I thought.

    Halibut on
  • Options
    PeccaviPeccavi Registered User regular
    edited October 2010
    http://ai-contest.com/profile.php?user_id=10783

    Uploaded this bot this morning. Considering my last one stabilized around 1800, it's a good amount of improvement. And there's still a lot of stuff I need to add in (haven't even looked at fleet stuff yet).

    Edit: Welp, looking at this game, I'm not really sure why my bot went after the 87 planet when the 46 was closer, weaker, and had a higher growth rate. That's pretty much exactly opposite of what it's supposed to do.

    Peccavi on
  • Options
    HalibutHalibut Passion Fish Swimming in obscurity.Registered User regular
    edited October 2010
    My bot rewrite is based on planet clustering and Kanban style fleet ordering. So far, I've only implemented logic to expand to neutral planets and to defend my planets (and the neutral planets I'm attacking), and it is already beating my previous bot on every map I've battled them on (new bot has the most ships after 200 turns).

    Next step is to work on distribution of my ships, and finally I'll implement some attack logic.

    Halibut on
  • Options
    CmdPromptCmdPrompt Registered User regular
    edited October 2010
    Psuedo-code for a top 50 bot, courtesy of the forums:
    public static void DoTurn()
    {
       Create a prediction of the future:
       For each planet
          for each step into the future
             consider growth rate
             arriving fleets
             resolve battles
          
       Get the moves chosen, from the logic part of the Bot(GameState, fleets, futurePrediction).
       
       Execute the moves:
       foreach move
          if the attack fleet has to leave this turn, IssueOrder().
    }
    
    public static List<Moves> Bot(GameState, fleets, futurePrediction)
    {
       If it's the first turn, and we're really close to the enemy, Consider a Kamikaze attack.
       Otherwise:
       
       Generate a list of surplus ships, and ship deficits (potential planetary losses):
       Parse the predicted future for my planets
          if never lost the planet, the minimum # ships is a surplus
          if planet lost, the deficit in ships is added to lossprevention list.
       
       Generate a list of possible conquests:
       Parse the predicted future for not-my planets
          dont include in list if it'll get conquered in the future
          
       Sort the lossprevention list according to # ships required (smaller is better), growth rate of the planet (bigger is better), and number of turns till the potential loss (smaller is better). The algorithm and weights given to each of these variables is critical. The # of turns is important, because we want to prefer sending in ships from sources closer to the target, than from farther away. This algorithm I made up works pretty well, but this part is begging for improvement through some sort of simulated annealing or other automated method: [SIZESORTWEIGHT =60, TURNSORTWEIGHT=1200]
    
    LossPrevention.Sort(delegate(EditTuple a, EditTuple b){
    return ((a.Size*SIZESORTWEIGHT + a.Turns*TURNSORTWEIGHT)/a.GrowthRate).CompareTo((b.Size*SIZESORTWEIGHT + b.Turns*TURNSORTWEIGHT)/b.GrowthRate);});
    
       Sort the capturables list. [Same disclamer as above]
    
       go through each of the losspreventions and the capturables, having preference for the ones we sorted for:
          ConsiderAttack(ListSurpluses, TargetPlanet, #TurnsFromNow)
          
       Any sources left unused get redistributed to planets closer to the front lines of the battle
          [It basically tries to minimize (distance source planet->recipient planet + distance recipient planet->nearest enemy planet), and only approves the move if said sum < (distance source->nearest enemy * 1.3)]
    }
    
    static void ConsiderAttack(ListSurpluses, listMoves, TargetPlanet, #TurnsFromNow)
    {
       Sort the surpluses by distance to target planet.
       if necessary, increment the # ships needed for the attack by a ResistanceFactor
          (number of possible reinforcements from other enemy planets nearby, that can get there in time)
       foreach surplus 
          if surplus has > # ships needed for the attack, and the fleet can get there in time
             reduce surplus by the size of the attack fleet
             add the attack fleet to the list of moves, arriving #turnsFromNow
             return   
    }
    

    CmdPrompt on
    GxewS.png
  • Options
    mrflippymrflippy Registered User regular
    edited October 2010
    Hmm, I signed up, followed the instructions and submitted the java starter pack.

    I "won" on turn one, but it says "mrflippy crashed / did not start / timeout"

    Buh?

    mrflippy on
  • Options
    EndEnd Registered User regular
    edited October 2010
    mrflippy wrote: »
    Hmm, I signed up, followed the instructions and submitted the java starter pack.

    I "won" on turn one, but it says "mrflippy crashed / did not start / timeout"

    Buh?

    Is this what it is saying via the visualizer? I guess if someone crashes, apparently the visualizer always says player 1 crashed, even if it was actually player 2 who crashed.

    End on
    I wish that someway, somehow, that I could save every one of us
    zaleiria-by-lexxy-sig.jpg
  • Options
    mrflippymrflippy Registered User regular
    edited October 2010
    End wrote: »
    mrflippy wrote: »
    Hmm, I signed up, followed the instructions and submitted the java starter pack.

    I "won" on turn one, but it says "mrflippy crashed / did not start / timeout"

    Buh?

    Is this what it is saying via the visualizer? I guess if someone crashes, apparently the visualizer always says player 1 crashed, even if it was actually player 2 who crashed.

    Yeah, it's on the website. Something's weird because the game doesn't show up on the opponent's game list.

    Edit: Probably not a huge deal unless it keeps happening.

    mrflippy on
  • Options
    HalibutHalibut Passion Fish Swimming in obscurity.Registered User regular
    edited October 2010
    mrflippy wrote: »
    End wrote: »
    mrflippy wrote: »
    Hmm, I signed up, followed the instructions and submitted the java starter pack.

    I "won" on turn one, but it says "mrflippy crashed / did not start / timeout"

    Buh?

    Is this what it is saying via the visualizer? I guess if someone crashes, apparently the visualizer always says player 1 crashed, even if it was actually player 2 who crashed.

    Yeah, it's on the website. Something's weird because the game doesn't show up on the opponent's game list.

    Edit: Probably not a huge deal unless it keeps happening.

    This happened to me on my last submission. It said I won my first match and the visualizer said I timed out or whatever. Then my bot wasn't played in a match for like 3 hours and I started thinking my bot got suspended (the rules say timed-out bots get suspended), so I spent another hour or so figuring out how to get the game output off the server so that I could run it in my debugger. Turns out it's just a glitch on the server.

    Halibut on
  • Options
    mrflippymrflippy Registered User regular
    edited October 2010
    Man, my bot does ok, but it makes bizarre decisions, like going after planets all the way across the map when there's a better choice closer. Time to revamp the targeting selection process I think.

    mrflippy on
  • Options
    HalibutHalibut Passion Fish Swimming in obscurity.Registered User regular
    edited October 2010
    Woohoo! Busted my way into the top 300! We'll see how long I stay before I start dropping again.

    Halibut on
  • Options
    HalibutHalibut Passion Fish Swimming in obscurity.Registered User regular
    edited October 2010
    I keep moving up in the rankings. I'm currently at 160, which makes me happy because I didn't think I'd ever get above 250. Also, testing my bot on the TCP server led me to believe that it was crappy because my win rate was about 20%. I guess most people using the server are high in the rankings.

    Halibut on
  • Options
    PeccaviPeccavi Registered User regular
    edited October 2010
    From the not-so-elite ranks, woo amazing comeback!

    http://ai-contest.com/visualizer.php?game_id=5900958

    Haven't updated my code in about a week. I'm kinda waiting for Go! to get support, but I do have some pseudocode that I could quickly throw into my java bot to make an improvement. Maybe I'll do that sometime this weekend if they still haven't added a compiler for golang.

    Peccavi on
  • Options
    bowenbowen How you doin'? Registered User regular
    edited October 2010
    Wow that was an awesome game Peccavi.

    bowen on
    not a doctor, not a lawyer, examples I use may not be fully researched so don't take out of context plz, don't @ me
  • Options
    mrflippymrflippy Registered User regular
    edited October 2010
    I've done some testing on the tcp server linked in the official forums, and usually my bots get stomped. I looked up the guy from my latest loss on the official leaderboards, and he's ranked 25 or something, so I guess I don't feel quite so bad.

    Edit: I updated my bot on the official leaderboards with a lot of new upgrades.

    Though, according to the first match, I still need to tweak the targeting/attacking routine:
    http://ai-contest.com/visualizer.php?game_id=5902845

    Why can't my bot just read my mind and do what I want it to? gah

    mrflippy on
  • Options
    PhyphorPhyphor Building Planet Busters Tasting FruitRegistered User regular
    edited October 2010
    Damn I've dropped a lot. I should probably work on this again

    Phyphor on
  • Options
    mrflippymrflippy Registered User regular
    edited October 2010
    Arg, the official game servers are wonky and only processing about 6 games per minute. :(

    mrflippy on
  • Options
    HalibutHalibut Passion Fish Swimming in obscurity.Registered User regular
    edited October 2010
    Yeah, I've only been getting a few matches a day. Hopefully they can beef up the available CPU cycles or something. It's taken a long time for my bot to get settled in at its current ranking, but even this morning it jumped about 40 places (up, fortunately) without ever entering a battle.


    Here's my profile for anyone who's interested.

    Halibut on
  • Options
    mrflippymrflippy Registered User regular
    edited October 2010
    Nice score :)

    Mine's quite a bit lower (http://ai-contest.com/profile.php?user_id=11199) , but I'm still doing better than I expected. (Though I'm not sure how accurate the rankings are with the low number of games)

    mrflippy on
  • Options
    HalibutHalibut Passion Fish Swimming in obscurity.Registered User regular
    edited October 2010
    mrflippy wrote: »
    Nice score :)

    Mine's quite a bit lower (http://ai-contest.com/profile.php?user_id=11199) , but I'm still doing better than I expected. (Though I'm not sure how accurate the rankings are with the low number of games)

    Thanks. It took me a few weeks of on and off coding and a complete rewrite to get there. You learn a ton from your first few bots, and then it's about refining it in small increments. I've been keeping old versions of my bots around for testing purposes since the TCP server is so much better than me, and the starter kit bots are so weak. I figure that if my new bot beats out my old bot on a significant portion of the maps, then It's an improvement that will translate to more wins on the server.

    Also, after only 1 match, I don't think your ranking would be very accurate. My first match with my current bot was a win over a player who made an illegal move for his first turn. After that one match, it put me at about 1200th place. With your first match as a win, I would think you would move up in the rankings once you play more games.

    Halibut on
  • Options
    mrflippymrflippy Registered User regular
    edited October 2010
    Yeah, my previous upload (which I should play against my current upload at some point) got up to 700 or 800 after about 8 or 10 games I think.

    mrflippy on
  • Options
    HalibutHalibut Passion Fish Swimming in obscurity.Registered User regular
    edited October 2010
    Whoa, I just entered the top 100. I am suddenly way more motivated to keep making improvements.

    Halibut on
  • Options
    mrflippymrflippy Registered User regular
    edited October 2010
    I just fixed a bunch of math errors in my bot. That should help it quite a bit. I still need to fix the targeting though. All these stupid errors make me want to implement some unit tests.

    mrflippy on
  • Options
    mrflippymrflippy Registered User regular
    edited October 2010
    http://ai-contest.com/visualizer.php?game_id=5906253

    Ugh, my bot was doing great in a game, took over all of the enemy's planets, and then... I lose.

    Buh?

    I found a script to let me pull the turn data and ran it back through my bot at home, and it turns out there was a divide by zero in there.

    Who knew that planets could have zero growth?

    mrflippy on
  • Options
    CmdPromptCmdPrompt Registered User regular
    edited October 2010
    The center planet can have zero growth, others are 1-5.

    CmdPrompt on
    GxewS.png
  • Options
    HonkHonk Honk is this poster. Registered User, __BANNED USERS regular
    edited October 2010
    OK, so I thought this looked pretty interesting. I tried to follow the quick start guide, and to just upload the original zip file as a start - like they suggest. But I'm actually only getting errors - with their unaltered file.

    It says that MyBot does not have a valid extension, but I checked and it is in fact .py like it should be.

    Did anyone else have trouble with this?

    Honk on
    PSN: Honkalot
  • Options
    mrflippymrflippy Registered User regular
    edited October 2010
    Honk wrote: »
    OK, so I thought this looked pretty interesting. I tried to follow the quick start guide, and to just upload the original zip file as a start - like they suggest. But I'm actually only getting errors - with their unaltered file.

    It says that MyBot does not have a valid extension, but I checked and it is in fact .py like it should be.

    Did anyone else have trouble with this?

    I think there are posts on the official forums regarding this.

    mrflippy on
  • Options
    HalibutHalibut Passion Fish Swimming in obscurity.Registered User regular
    edited November 2010
    Anybody still doing this?

    I took a couple weeks off and fell from 80th down to about 250th. Competition has gotten fierce.

    I rewrote my bot this weekend (for the 3rd time). I'm hoping this last one strikes a better balance between expanding and attacking (and hopefully it will be easier to tweak than my previous attempts).

    I also created a batch script that runs my bot against previous versions for a list of maps, and then gives me a nice win/loss record at the end. Makes it really easy to quickly see what affect a change has across a whole set of maps. For instance, my latest bot beats my previous version on 91/99 maps.

    Halibut on
  • Options
    Mr RayMr Ray Sarcasm sphereRegistered User regular
    edited November 2010
    I'm still doing this!

    Which is to say, have started. So far my bot isn't doing very well at all, which isn't too suprising given i've only been working on it for a couple of hours.

    Does anyone know if there's an easy(ish) way to actually step through the code's execution in C#? I think the main thing my bot is having trouble with is distance. It prioritises enemy planets to neutral ones of a similar strength, but it also needs to take into account that by the time my ships arrive its strength will have grown some. Well, I mean it does do that now, but not very well, as I'm not sure what sort of values to expect for distances so i've fudged it. I seem to have overcompensated somewhat and now it hardly ever attacks enemy planets unless they're right next door.

    It also used to crash if I ran out of planets, which is something I didn't consider. I mean, if I run out of planets i've lost, right? Well it would have been nice to have at least seen how this game would have gone.

    Mr Ray on
  • Options
    FremFrem Registered User regular
    edited November 2010
    I hacked some on a small bot this evening. Fun stuff.

    Why on earth doesn't the server included in the starter package show bot stdout? Or stderr? This is going to drive me insane. I guess I'll try some of the alternate Python kits tomorrow.

    Frem on
  • Options
    HalibutHalibut Passion Fish Swimming in obscurity.Registered User regular
    edited November 2010
    Oh shit. Somehow I've managed to get up to 24th place. Wonder if this is a fluke, or if my bot is really that good.

    Halibut on
  • Options
    HalibutHalibut Passion Fish Swimming in obscurity.Registered User regular
    edited November 2010
    This match is pretty awesome. I thought we were going to just swap places at first, but fortunately my bot was able to maintain a few planets for longer than the other guy.

    http://ai-contest.com/visualizer.php?game_id=6994701

    Halibut on
  • Options
    HalibutHalibut Passion Fish Swimming in obscurity.Registered User regular
    edited November 2010
    Fluke is looking more and more likely. Just lost 3 in a row.

    Halibut on
  • Options
    HalibutHalibut Passion Fish Swimming in obscurity.Registered User regular
    edited November 2010
    The contest has officially started (as of midnight this morning). How's everyone's entry doing? What was your strategy?

    Halibut on
  • Options
    Shazkar ShadowstormShazkar Shadowstorm Registered User regular
    edited November 2010
    oh this looks cool

    too bad i missed it

    good luck to you

    Shazkar Shadowstorm on
    poo
  • Options
    PhyphorPhyphor Building Planet Busters Tasting FruitRegistered User regular
    edited November 2010
    I ended up reviving my other AI project and forgot all about this

    Phyphor on
Sign In or Register to comment.