Mad Pod Racing - Puzzle Discussion

Don’t make it too complicated for Bronze.

All you need to do is this article:

And also collect the checkpoints and just before you reach the checkpoint target the new checkpoint. (Ideally with your steering calculation)

(I’m not sure if the second part is necessary). I jumped by a big margin.

No collissions, no simulations. Nothing.

Excited to learn about these things…

Im new here and I dont understand how to get to the higher league. Im 1 rank in wood and Ive beated boss 3 many times already.

You have to wait until all the battles are finished before your rank is stabilised, then you will get promoted if your score is still above that of the boss. And I see that you are in bronze league already.

How can I get to silver league? I’m in bronze league.
Here’s my code:

import sys
import math

# Auto-generated code below aims at helping you parse
# the standard input according to the problem statement.

count = False
# game loop
while True:
    # next_checkpoint_x: x position of the next check point
    # next_checkpoint_y: y position of the next check point
    # next_checkpoint_dist: distance to the next checkpoint
    # next_checkpoint_angle: angle between your pod orientation and the direction of the next checkpoint
    x, y, next_checkpoint_x, next_checkpoint_y, next_checkpoint_dist, next_checkpoint_angle = [int(i) for i in input().split()]
    opponent_x, opponent_y = [int(i) for i in input().split()]
    
    # Write an action using print
    # To debug: print("Debug messages...", file=sys.stderr, flush=True)
    if next_checkpoint_angle > 90 or next_checkpoint_angle < -90: thrust = 0
    else: thrust = 100     
    # You have to output the target position
    # followed by the power (0 <= thrust <= 100)
    # i.e.: "x y thrust"
    #print(next_checkpoint_x,next_checkpoint_y,"BOOST")
    #print(next_checkpoint_x,next_checkpoint_y,thrust)
    k = 20
    if (next_checkpoint_dist > 5000) and (next_checkpoint_angle <= 30) and (count == False):
        print(str(next_checkpoint_x-k) + " " + str(next_checkpoint_y-k) + " " + "BOOST")
        count = True
    else:
        print(str(next_checkpoint_x-k) + " " + str(next_checkpoint_y-k) + " " + str(thrust))

Please refer to the earlier discussion, e.g. the most recent posts in this thread. You will get some ideas there.

what should i do

import sys

import math

Moderator note: Please do not paste complete code in the chat. Snippets are fine. If you are having an issue, just tell us what it is (maybe with an error message or a description of what you’re trying to do or the results that you were expecting) and we can try to help you.

Hello, I don’t understand how I’m supposed to implement steering ?
I tried to understand this guide Understanding Steering Behaviors: Seek but I’m missing something so if someone could confirmate or deny what I understood It would be nice.
In this equation : desired_velocity = normalize(target - position) * max_velocity
target is the checkpoint , position is the pod current position and normalize is a function that calculate the unit vector and max_vel is 100 because it’s the thrust ?
In this equation : steering = desired_velocity - velocity
velocity is the current velocity of the pod, I have a doubt on how to calculate it, for me there is two possibility either it’s the thrust so you calculate it like this :

curr_velocity = (np.cos(next_checkpoint_angle)*thrust,np.sin(next_checkpoint_angle))

or like this :

curr_velocity=curr_pod_poss-prev_pod_poss

then you just calculate the next_position with this :

velocity = curr_velocity + steering
position = position + velocity

I’m doing this but my simulation isn’t really changing much.

I’m in Bronze league

1 Like

How do I get the previous x and y position of my pod?
I want to calculate the velocity with the previous x and y position.

For the first turn, previous x and previous y are the same as current x and current y, because the pod has not moved.
For subsequent turns, previous x = current x of last turn, previous y = current y of last turn. You may use some variables to store those values yourself.

It’s because at the bottom there is a timer and the timer is set to 1 second. To change it, some reason you have to change the destination for what you set or/and change the thrust.

I don’t quite understand how scoring works. How is my score calculated? It doesn’t seem to simply be the ratio of wins to losses. Also, does it just play 40 matches immediately when you submit and then you have to submit again to play 40 more? I will admit that at first I thought the matches I was watching were going on in real time and was confused as to why I could win a lot in a row without moving up the leaderboard–but from what I can tell they are replays of matches that have already taken place? so is it just 40 matches each time you submit?

1 Like

Please refer to this post for more information and relevant links: https://www.codingame.com/forum/t/how-is-the-rank-for-single-finished-bot-programming-computed/194147

Oh, thanks, that helps!

A post was merged into an existing topic: How is the rank for single finished bot-programming computed?

Hello! i am trying to calculate my current trajectory angle in contrast to the direction the pod is moving in is there a way i could calculate this?
any help would be much appreciated

Please read the post-mortem by Magus as linked on the cover page of the game.

Hi, I’ve beaten the boss in Silver league but got stuck there.
I always have the message “you will be promoted to golden league in …” and timer keeps resetting… for more than a day now.
Any clue please?
Thanks.

Please refer to the discussion here: https://www.codingame.com/forum/t/bug-report-league-not-promoted-in-bot-programming-game/194995

If you still aren’t promoted after re-submitting your code, write a post in the above thread to let CG know so that they may take action to fix the issue for you.

Thanks. I will check that.

i’m doint the task now in c++ and i can’t understand, bc i thought it would teach me first about if and else loops. i did it that way, but it also say that i need use cout. i thought that i need use it only, but i still cant finish it. What should i do, if it doesn’t teach…