Skip to content

Instantly share code, notes, and snippets.

@DiMasta
Created January 9, 2024 13:30
Show Gist options
  • Save DiMasta/213f21f44aa8989fba2cec39f831d6af to your computer and use it in GitHub Desktop.
Save DiMasta/213f21f44aa8989fba2cec39f831d6af to your computer and use it in GitHub Desktop.
CG Fall Challenge 2023 PM of Di_Masta
Di_Masta, 460th
Even though the contest seemed pretty random at the end, I've enjoyed it.
I've spend a lot of time, working on it every day and evening for 21 days straight. This time I really wanted to reach top 100m and fulfil a small dream of mine. But even with the enourmouse efforts I've invested I wasn't able to do it and I'm pretty disapointed of myself. But at least I've managed to improve my possion form previous contest, which puts a little smile on my face. Also I'm happy that I've managed to implement every idea that I had, eventough most of them didn't work at the end.
## How did I aaporach the task:
- In the first leagues I wanted to research the game using just simple heuristics. And it paid of at the end. I discovered that a predefined path for my dornes to follow works pretty nice. I've scatterd Check Points with radius 600 in the middle of all habitats, two points per drone and make my drones follow the CPs if the drone is in the radius of the CP target the next one.
- When the monsters came makeing one full lap without being hit was pretty hard, so I've surface the drone after hitting a CP and that moved to Silver.
- There I've noticed that in order to collect enough fish I need a simulation of the entities. I wanted to implement accurate simulation and keep the data for the detected fish for the next simulaions. This was really hard for me, I spent days porting the referee simulation logic to C++, after that I needed several days to debug and polish the simulation. I cannot understand why I spent so much time on that, does it happend to anybody else?
- For the first time I've read and used the Java referee code, which was definetly a good approach.
- When I polished the simulation I noticed that my Check Points weren't working very well in different scenarios. So I wanted to make an AI search algorithm with simulating the future. I first tried GA with evaluation for each drone, but this didn't work at all, for days I couldn't come up with a nice evaluation. Actually I always struggle with this evaliuations, could someone give me an advise how to approach them properly. I even made my own visual debug tool to analyze the GA but it didn't help also.
- After the fail with GA I tried MC with random moves, simulating the game until a drone is hit or a Game Over, didn't work at all again...
- After so many fails I decided to implement DFS for each form getting him closer to the next Check Point without being hit by a monster. I've managed to run DFS with 5 turns depth and finally I saw good results which moved me to Gold, the bottom of Gold.
- There I noticed that my CPs are not working very well in all cases, so I decided that I need more precises targets for my drones. A friend of mine advised me to use the Drones' radars to estimate the positions of the fish. And I came up with the idea to average the radar direction for all remaining fish taking the directions for fish on the right of the right drone with bigger wait and ignoring them for the left drone and vice versa. This worked well moved me to 185th in Gold, so close to my dream...
- Then I decided to send the drones to report only if they are above of one of the enemy drones otherwise I wanted to scare unscanned fish by the enenemy. Took me days to implement decent scare logic. Tried the new bot against the 100th player and my bot won 8 out of 10 matches, got pretty excited and submitted moved me 100 places behind ..., fixed some bugs again good tests against the new 100th player, submit, 100 places behind ..., and again and aganin ... I reverted to my 185th both but maybe it was too late it didn't reach tha same place.
## Mistakes:
- Probably I should have been more active on Discord.
- For future in Gols league I'll first test my new bots in separate account before submitting in my main.
## Request:
- CodinGame, for the next contest please consider a more simulation friendly game, with this collisions and vectors it's very easy to mess up even with having the game code ending up in days of debugging. The randomness of the fog of war is also very hard to deal with by the average player. Perfectly, I would suggest something that could be solved with MiniMax, I know it's old school but a nice game, I also believe will be a goog challenge for NN players. Some classic borad game like: https://en.wikipedia.org/wiki/Chinese_checkers
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment