this was my first contest and I finished as 287th.
I’m 27 and a professional Java backend developer.
I spent a lot of time on the game the first weekend and got really hooked. I have not much of a maths or physics background, so at the beginning I had great trouble predicting future positions of the pods but I thought that this would be key in order to make nice fast circles.
First, the only thing that came to my mind was the Pythagorean theorem and that led to quite an heuristic approach. My method was called something like “getThrustByDistanceAngleAndSpeed”. The target point was always fixed on the next checkpoint and the angle wasn’t the way more interesting velocity angle… I didn’t optimize the different values of thrust I had (around 30, because 4 different thresholds for distance, angle and speed, but if the angle is totally wrong nothing else could counter for that) because I felt it was too cheap for a real solution.
Reading the chat got me thinking about vectors and later in vectors! It then took about 4-5 days in which I refreshed my pretty rusty knowledge of those. And boy, if school math would have been this graphic I might have actually understood some things way better. My motivation wasn’t as high, because the learning took some time. But I knew, I could do it until the end. Although I still don’t understand much about sin, cos or tan, I got the prediction of the next position almost perfectly (sometimes off by 1 unit, but totally fine!) Ironically this method wasn’t applied in my final solution. The thing that really made a difference for me was knowing whether my pod would cross a checkpoint given its current velocity and no further thrust.
I ended with no collision detection, no simulating of x future rounds with random values and measuring the different outcomes, never used the shield and both my racers had the same strategy:
Check if the current velocity is good enough to reach the next checkpoint and the “distance to speed” ratio was small. If so, use 0 thrust and start rotating towards the next checkpoint.
Unless the velocity angle is already perfect (guess that’s almost never the case), rotate the target point (checkpoint coords) by 18% undercutting the target because velocity drag will do it’s work (I saw that on others racers on the first day but I only got it in the last hours of the contest).
Given my “distance to speed” ratio I used different thrust values. Something that happend from time to time was infinite circling around the same checkpoint because the thrust was too high to reach it. I played around with some values and hope that didn’t happen anymore as I submitted my solution.
In hindsight I’m very proud of my ranking, as I was very overwhelmed by the physics at first (though now I see how simple it is in 2 dimensions with not that many variables). There are some easy fixes I could have done, like if the next target would be in a straight line, my racers wouldn’t need to slow down … but the time was limited and as an amateur numberwizard, I believe my moves fullfilled their purpose good enough.
Victory replay vs RicardoN (rank 126): https://www.codingame.com/replay/85166668
Looking for future challenges and especially multiplayer contests!