Uni here! Silver (~516th)
First contest, can't really say I had high expectations of performing well, considering I'm not familiar with the contest system. I watched a few previous contest replays in advance for fun, fully aware that I'm probably not as competent as other experienced contestants to write a bot like what they had in the limited time. With that in mind, even though I'm still aiming for as high as possible (why not?), I wasn't trying too hard and used an exotic language that not many other users are using for a language ranking badge. (It worked out, I was 2nd out of 2 users.) Also, I didn't have any contest badges prior to this point, which is why I even signed up. Though, I did get a lot of fun for my free ticket.
I had made it a commitment before the contest started that I would do it in Bash for honors. I would actually have solid chances if I practiced beforehand, as while I knew the commands I've had to look them up (-lt, if syntax, decimal places in bc output) way too many times. If I wanted a chance to climb to silver in under three days I would have to switch out of bash. Maybe next time.
I had a clear battle plan: I knew it would never get easier than wood, so treat it like a Clash, get to bronze, and sleep (contest starts at 1 AM my time. I was up late and would like to sleep ASAP)
Wood 3: Find closest pond, move to it. This was simple, but it took 7 minutes while I expected it to be done < 5, and it took some precious time.
Wood 2: Find closest pond, move to it. While waiting for the ranking to settle, I found out you can attach messages to your cars, so I made them say something for fun.
Wood 1: Find closest pond, move to it. If no pond, move to the water truck that our destroyer is aiming. Rage truck just runs towards whoever that was player 1. I'd had thought about using skills, and had implemented a very simple system that tried to throw a grenade to player 2 every few rounds, but it was performing poorly and I didn't want to work on it further. Submitted rudimentary bot and went to sleep.
I didn't think the bot that I worked on for a grand total of 10 minutes (~20 if you include the time in / moving out of bash) and was 10 ranks below the bot at 10% battles done would actually carry me to bronze. This is good news because being on the top current league I can actually take time off and worry about a few other things before 11/21/17 (Silver league opens). Also it means I have two days to learn some algorithms for this, I was more of a "build stuff" coder, not really an "account for environment and perform well" coder. By that I mean I stared at the game with three main ideas in mind and didn't know how to implement any. Since my bot building knowledge was at theoretical minimum, I had to ditch general tactics and focus on heuristics I concluded from analyzing replays. These elements are:
- Reward: Find "hot spots" of wrecks. If there are big wrecks connecting, it is good loot. By that I mean the reward of a wreck spot is proportional to how many other wrecks are in reach, and also that reaching a farther/bigger wreck may be a better option than competing for a closer, but remote / small wreck.
Also: Merge adjacent wrecks (to modified x,y) with a bonus to encourage the bot to harvest from multiple ponds at once.
- Cost: If a wreck has many obstructing units like opponent looters, they may be competing for the water or just getting in the way to make navigation hard. Also, there are way too many cases where a reaper runs between water trucks and promptly gets stuck, losing valuable time. This means if there's a distant wreck in plain sight it would be better to aim for that than rush towards a hard-to-reach wreck.
- Skills: Eventually I'll need to replace the behaviour of my doof, while having him run to an opponent is funny, I probably wasn't getting as much rage as I could. I felt this doesn't matter early on anyway so my Bronze bot just throws a grenade properly and accounts for the range instead of stopping to try an impossible action.
Even though I didn't think I could had, I tried implementing a basic simulation. I failed horribly. Ended up spending the rest of the evening sitting around watching cartoons.
I woke up with an epiphany that I could target whoever that currently had the most score to delay him, rather than choosing whoever that happened to be an arbitrarily set player. I refactored out some of my mess of code that was a result from randomly throwing in a variable just because I needed it. This meant looking up the syntax of structs and pointers (it's been years since I've used C properly) and trying to initialize things properly. This was not successful, and my printerr statements are telling me that I'm reading in 6250566 as almost all integers into field locations. Hurriedly deleted all the struct stuff and just made a table of int declarations.
After finally formalizing the data storage (with an array), I'm quickly struck by another problem: My bot was hilariously incompetent when submitted, and would often fail games where it had an advantage. As it turns out, it stops moving, so it probably crashed. However, loading the same parameters into the IDE to test couldn't reproduce the crash, and often times even have my bot emerge as the winner.
After spending most of my day debugging, at 3:36 am I've discovered the problem: In the ide code running procedure, out-of-bounds coordinates as output is allowed, while the same thing for the real game is rejected as an invalid move. I had ran out of will to fix this and promptly shut down my computer, leaving the task for tomorrow.
More debugging. I fixed a lot of bugs, it took the entire day. Going through them would be hard, plus you can write this section for me and still probably be on point.
I thought I'd implement something, and I did. Top 250 is probably good enough for silver, I thought. While users in chat are frantically building their own simulations, I looked up a few algorithms.
My bot comfortably sits on the near bottom (~2/3) of silver league. When it opened I was promoted and the bot ranked somewhere in the middle out of sheer randomness, but future submits proved it's actually trash. In fact, it was a simple "score ponds based on water and distance and a few other factors". I implemented tar -> bot got worse -> deleted it and implemented oil -> bot got worse -> deleted it and implemented depth-1 search for pond clusters -> bot got worse -> ...
I think I speak for most people on that pressure doesn't help when you're already struggling. With the pressure of Gold league opening soon I was getting worried that I couldn't even make it to the upper half of the leaderboards if I wanted to make it to gold, which started to get to me. Instead of trying to redo what I failed to do, I took the day studying the rules of the game (and reading the arbiter code) and looking for inspiration. Unfortunately I didn't get that inspiration I wanted.
I attempted to code a genetic algorithm. I've seen a video on it before but I've never coded one myself. Even harder that I'm not using a familiar language.
I am not a good programmer.
Near the end of day 9 with ~23 hours left, I gave up trying to make a GA.
I (properly) redid using the oil and grenade spells, and look for pond intersections properly. This helped me reach the high quartile of silver, which is totally where I'm fine with being. In the end, I had a few for-loops and not much more. If anything, it's a really pragmatic bot.
I made a few observations. Unfortunately I did not have them in time to use them as grounds for decisions to make during the contest:
- 10 days is quite a lot of time to go on, if you figure out what you have to do early.
- Near the early hours of a league, there are more bots that are performing poorly to boost your ranking, where as if you join late it is harder to get wins / ranking points.
- Due to the nature of games between suboptimal players being mostly determined by a random number generator, having more games played seems to directly correlate to how high your ranking gets. If you submit your bot early, in addition to the primary batch of games used to determine your initial ranking, you will also be played against other new submitters, which push you further up. Conversely. submitting late puts you against huge odds which you have to fight against.
- There doesn't appear to be replacement for the rating points that are lifted as a result of already promoted players. This makes it a disadvantage to players trying to catch up. In fact, it might even be feasible to make a simple bot early on than craft a below average but sophisticated bot if it takes a lot of time.
- I don't know if it belongs here, but I showed three of my friends (who don't use CG a lot) Mean Max and none of them even made it to bronze.
Good games to everyone that played!