while (X < 5600)
{
Console.WriteLine("-20 4");
while ( Y < 590)
{
Console.WriteLine("0 4");
}
}
Basicly once the space ship reaches a section of the mars it will start to counter
the gravity and stuff but once all that works the while loop inside the while loop that supposed to initiate once the spaceship is near the ground to land wont run why?
Also yes I am a noob :> I did not finish the second one but i just wanted to see what the 3rd episode looked like
The variables X and Y wonât update themselves. If you need updated values of the position, you have to read the inputs again and update those variables after your Console.WriteLine.
After 1 month trial, I finally pass Level3 with reinforcement learning approach!
my steps:
write a simulator, modified base on âgymnasiumâ LunarLander env
mainly learn Box2d to simulate physical movement and detect collision
design action space: since the space is large, I reduce the action to 3x2 (+15/0/-15 for rotate with clip of ±45degree, +1/-1 for power with clip of 0-4)
train a policy with help of âstable baseline3â PPO model
tried DQN first, then switch to PPO
need to carefully design the input and the reward function
input: in final version, I give a 13 dimension vector as input [distance in 6 directions, h/v speed, rotate, power, relative h/v distance to the middle of landing zone, whether the lander can see the LandingZone]. normalize with modified sigmoid function to get all input in range [-1,1].
reward: lots of pains in reward function design, +++ for success landing, + for approaching (i use the angle leftOfLandingZone-rocket-rightOfLandingZone as a indicator), â for collision, - for too high speed, - for high power, â for wrong direction
training: since the space is very large, I train gradually (at beginning, the rocket start very near to the LandingZone, to get a good Q-value/Policy for that area, then gradually move the start far away and eventually the actual start point). I use random map between the 2 tests and random starting point (with randomness on position(with in the chosen area)/speed/rotationâŠ) in âmake_vec_envâ to train.
network arch: first I used a 4x200 nodes policy network and a same form of vf network, but then find out the parameters are too big for the 100k code limit.
in final version is 2x100 nodes policy network and 4x200 vf network.
transfer the parameters (tensor or numpy array to base64 string) and use in codingame.
thanks to the help from @ jacek1 and @ FrancoisB about this part :))) (the Unicode method is genius, but since I reduce my network, I wonât need that magic this time)
manually calculate the âpredictionâ part to get output from neural network
Hello everyone,
When I did this puzzle, I wrote a program that allowed me to run my solution locally and draw on the visualization. This allowed me to see the trajectories I was simulating and it helped me a lot.
So I wanted to share my program with you, in case it might help you too.
How did you even manage to make the code for it? besides i thought i had to do a entire if factor to do all of these conditions, which is driving my brain insane.
I also tried a physics approach (computing the distance necessary to brake and comparing with the current one) and it failed as well. I looked at the logs carefully and I found something weird (even in the episode 1):
as long as I donât switch on my thruster the (vertical) speed increases as expected (well decreases as it is negative)
Then when I switch on the thruster at full capacity (4) I was expecting the speed to stabilize right away (and even reduce a bit, by 4-3.711=0.289 to be precise) but it still increases significantly for 2 rounds (more than 2m/s2). It doesnât make sense to meâŠ
Got it: the thrust cannot go from 0 to 4 in one second, it will increment second after secondâŠ
if you were at 0 and ask for 4 you will get 1 then 2 then 3 then 4
This puzzle sems broken. The default code reads in an x and y that when output with cerr do not match the Game Information.
### Game information:
Landing phase starting X=2500m, Y=2500m, HSpeed=0m/s VSpeed=0m/s Fuel=500l, Angle=0°, Power=0 (0.0m/s2)
### Standard Error Stream:
landing left (1500,100) landing right (3000,100)
x = 5000
y = 5000
### Standard Output Stream:
0 1
### Game information:
Landing in progress... X=2500m, Y=2499m, HSpeed=0m/s VSpeed=-3m/s Fuel=499l, Angle=0°, Power=1 (1.0m/s2)
### Standard Error Stream:
x = 0
y = 0
I have created a series of code solving videos for Mars Lander Episode 1. The videos walkthrough demonstrates how to approach the problem in a way new programmers can follow. You can watch them in order and follow along to solve the puzzle with me, or you can pick and choose the videos that work best for you. The whole playlist can be found here: https://www.youtube.com/playlist?list=PLA696TZkxEnJFhLQO0PQ2Mp1xSPu4S0aY