Day one: Unleash the Geek – day I

Day two: Unleash the Geek – day II

Day three: Unleash the Geek – day III

Day four: Unleash the Geek – day IV

Unleash The Geek Series

After a long weekend of coding, Unleash The Geek has finished.
95 players managed to reach Legend, 600 ended up in Gold, another 600 for Silver, 800 were stuck in Bronze and a few curious players didn’t manage to beat the Wood Boss.

I finished in Gold 252 after two days of struggle to be honest but after going up and down (waaay down) in the ranking all the weekend it feels like a victory haha.

A thousand lines of Javascript and a lot of fun, mostly during the first days. And the results, a bit below my expectations, I wanted to reach top 100 Gold but it is good enough.

Global ranking347 out of 2,162
Gold League252 out of 598
Javascript ranking19 out of 192

Python was the most popular language on the contest with 582 players, followed by Java and C++ with 400 although Legend League was pretty much C++ territory (hint: there is a limit of 50ms per turn to respond, otherwise you loose the match):

Top 10
Top 10

Anyways, it was a great code marathon after all. Four evenings during the week and a day and a half during the weekend. Around 25 or 30 hours in total.

Aggressive or pacifist bots?

Gold League was a fight between aggressive bots that tried to kill you and very efficient bots that just tried to score points and avoid traps.

Going the aggressive way is risky, cause if you spend turns requesting traps and waiting for opponents to be close enough you are going to collect less ore so you better kill those enemies. Otherwise you will loose for sure.
So I decided to go the pacifist way and try to collect really fast while playing safe.

Dangerous enemy
Dangerous enemy… or not?

Things I tried in order to be more efficient:

  • Instead of ignoring all enemy holes I keep track of enemy bots that spend a turn at base. Those bots might be requesting a radar or requesting a trap. I cannot know, but if an enemy digs a hole after spending a turn at base, that hole might have a trap so I will never ever dig there.
  • I made my robots place radars to explore faster. Instead of placing radars on ore (one DIG command places the radar and extracts the mineral in the same turn) I try to reveal as many cells as possible.
  • I try not to dig more than once on a cell that has 2 or 3 ore until the end of the game. The idea behind is that smart bots would consider those cells dangerous, they don’t know if there is a trap so they play safe. So you can leave that there and compete for other resources and then come back to extract that before the match ends. But you need to explore fast if you leave resources behind, that is why my radar placement needed adjustments.

But there are also things that didn’t work at all. And this is the frustrating part: you spend an hour or two coding something that might work and then you submit it and drop to top 500. Even fixing something that wasn’t working as intended actually made the bot worse.
That is SUPER annoying. Also because you have to wait a few minutes after submitting your changes to see if there is an improvement or not, you end up submitting multiple changes at once. And if it doesn’t work you have to guess what happened exactly and decide if you discard all those changes or try to submit them one by one.

Maybe I should have invested some time on simulating matches locally. Fighting against other versions of my own code might have helped decide if a change was viable or not before submitting. Although you never know until you fight other players.

The version that scored best had actually 3 hours less work than my latest version. At this point I didn’t know if it was worth investing time on that latest version (sometimes things get worse before improving) and risk wasting even more time or just go back and try something else. Either way it is frustrating cause time is very limited.

Lane selection
Prevent bots from using the same lane when close to base

For example, things that proved useless:

  • Using different «lanes» when returning base. That is, different coordinate Y. In my head this should make things harder for aggressive bots that wait for you at base. If your robots are spread across the map and they don’t always move in a straight line they cannot be killed with a single trap easily. That didn’t work at all. I should have implemented a more sophisticated algorithm.
  • Many radar placing tweaks did work against the Boss but didn’t work in the ranking against other players. I think I spent way too much time on this, focusing on exploring the map in the most efficient way possible without hard coding radar locations.

Now that the contest has finished many top players are sharing their strategies and there is one thing that I didn’t think of, and it is such a smart play:
Because the enemy is tracking when your bots spend a turn at base (requesting an item) you can trick them by just waiting a turn there. Instead of requesting a trap, you just wait. Why? Cause after that you can go to a big ore, extract 1 ore and the enemy will think there is a trap there and never touch it. You now have 1 or 2 ore remaining on that cell that is safe to leave there till the end.
Why would you place a trap when you can trick the enemy? If you place a trap you cannot collect the remaining ore! Traps are actually a waste of resources cause no enemy will kill himself that easily, not in Gold or Legend.
Ah I wish I had thought of that myself!

Next contest will be on March next year. Hopefully I will be able to participate. We don’t know the rules yet, all we have is:

Spring contest
Spring contest

You can register here and will get a notification when the contest is open.

Until then, you can also have a look at previous games and compete without the deadline (I highly recommend Hypersonic) or participate in small battles of 5 minutes using your favorite language.

If you think my content is worth it you can Buy me a Coffee at Buy me a Ko-fi