The AnonymousUh, uh, uhhhhhh...Uh, uh.Registered Userregular
edited October 2010
Might as well give up and just start using Java...
The Anonymous on
0
SirUltimosDon't talk, Rusty. Just paint.Registered Userregular
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.
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?
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
0
HalibutPassion FishSwimming in obscurity.Registered Userregular
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.
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
}
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
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.
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.
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.
HalibutPassion FishSwimming in obscurity.Registered Userregular
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
0
HalibutPassion FishSwimming in obscurity.Registered Userregular
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.
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.
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.
HalibutPassion FishSwimming in obscurity.Registered Userregular
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.
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)
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.
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.
The center planet can have zero growth, others are 1-5.
CmdPrompt on
0
HonkHonk is this poster.Registered User, __BANNED USERSregular
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.
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.
HalibutPassion FishSwimming in obscurity.Registered Userregular
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.
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.
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.
HalibutPassion FishSwimming in obscurity.Registered Userregular
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
0
HalibutPassion FishSwimming in obscurity.Registered Userregular
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.
Posts
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?
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.
Edit: I'm pretty sure it was against a starter bot, so I'm not nearly as awesome as I thought.
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.
Next step is to work on distribution of my ships, and finally I'll implement some attack logic.
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.
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.
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
Here's my profile for anyone who's interested.
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.
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?
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.
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.
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.
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.
http://ai-contest.com/visualizer.php?game_id=6994701
too bad i missed it
good luck to you