Rank kind of irrelevant since the ladder system has its issues and these issues become even clearer with this contest.
Bot can rank between #45 and #60 in Legend. So far my best contest result.
My experience throughout this contest, quick write up:
Joined in Friday to watch the stream, but TV was on with football playing so i had to give up on it.
Reached Wood2 by outputting "MOVE 11 8"
Wood1 was indeed easy fun short if else write up.
Stuck! I was actually stuck in wood1 and so were many others. There first wood1 boss was horrible. It felt like i need to code for the gold league already.
Also slashers were confusing.
Bronze I had to write a sim to get out of wood1.
Started off with my Wondev Woman approach (code is available online if anyone is interested) and added a sim. Only thing i lacked was a better way to select the best direction, which i did by adding a simple algo, from there on the contest became very easy, mainly because of the sim.
When i reached bronze i realized i simulate the explorer with ID 0 instead of first given in the input as i assumed the first in the input has ID = 0
I didn't even look at the referee this entire contest because the code was hard to read. Best referee so far was the Code Royale, it's in fact the tidiest referee i've seen so far.
Maybe Kotlin helped with actually making it look cleaner.
So from here on i fixed some bugs, added slashers, added plans, added lights and finally added yells. This got me to around spot 20, where i stayed for most of the contest.
Silver not much was changed. I kept tweaking my depth 0 sim. It was simulating my explorer movements.
Gold added depth 0.1 to stay at the top of gold.
This included basically trying to predict how hurt my explorer gets in 2 moves. That's it. Still hovering around 20.
Around this time some people were finally done copying the referee and simulating, probably to greater depth than i bothered doing it.
Added wanderers, slashers and the other explorers to my sim. Added a simple wallinbetween check to exclude the ones that are too far away to be dangerous.
I thought this is when i finally have to add pathing. Well i might have added it, but i didn't have any time during the weekend.
What i inteded to do was to either:
- create a graph with the best routes and dead ends (like the god damn shrines on Typhoon map)
- or add neighbour weights and other propreties on each square
All this would be precomputed turn one and i would then end up reducing some of the loop counts in my code.
My code is around 500, maybe 550 lines of random stuff after last night trying to climb further into legend as i was more excited about experimenting with other things than doing the obvious.
I added an incomplete depth 1 to my sim. Slashers aren't worth the trouble imo. And with the pathing i just described above i guess rank 20 would have been easily within reach again.
About my solution and some hints:
Everything is very straight forward in terms of calculating best next action. It's when you want to go depth higher than 1 that things get messy and complicated because each bot has a different approach to trying to survive.
When these approaches differ too much from one another is when things start to look random. But overall there is still a best move with occasional 2 options.
I only checked possible moves next to me and the overall inspiration for finding best route / direction is the slime mold algorithm. It acts pretty much same like my bot. It's looking for food (the goal) but has no idea where it is so it expands where it can.
At its core the algo is basically:
- go in the direction with most food (that's how it expands)
- reinforce preferred routes
- remove paths of no interest / no food
To better explain, you can treat explorers and shrines as the food source and the all the minions wandering around can be treated as unappealing edges.
I even treated light and plan as food source.
I reinforce preferred routes through the simulation. This is basically the most important part. Reinforcing the correct route and thus you can reach high rank in gold easily with just one neighboring tile checked.
Best part is you don't need any pathing, you can just increase depth, which is more reliable since paths are in a way blocked and unblocked by minions.
I did like it for most part, with few exceptions:
- Wood1 boss initial difficulty. I just wanted to get into bronze and optimize some intuitively well selected tactics against best bots there. It's what i usually prefer to do.
- Slashers - they were too complicated. It looks like 2-3 minions fused into a single one. The game would have been much easier and more enjoyable with 2-3 simple minions, would make life easier for absolutely everyone.
The way it was you could easily make mistakes, be it through conditions or evaluation.
Could have picked instead the following 3:
- A rushing minion
- A a stalking minion
- A minion with random moves
Not all three in one.
- Wanderer target selection was messy and apparently didn't even work as described in the statement. This should have been avoided.
The good parts:
- Everything clear and straight forward.
- The next possible move was always obvious, you know what yields a good result without much effort.
- Grid system made it easy - you even added auto pathing (too bad i never used it)
- no poorly explained physics in the statement that forces you to check referee, because inevitably some details will be left out
- no collisions and the resulting chaos
- well picked skill set for the explorers
Honestly, it's a nice game overall.