Mars Lander - Puzzle discussion

About the lost of altitude. It is not a bug in the game engine. The fact is that you can’t get full throttle (4) immediately. The power goes from 0 to 4 (1, 2, 3 & 4) in 4 steps which requires 4 seconds. Until power=4 you loose altitude because you can’t fight the gravity (3.711). Once the power equal 4, you need to wait few seconds because you need to stop falling. In fact the ship continues to fall but slower. Then, when vertical speed is null, the ship starts to go up at the next iteration.
With no initial horizontal speed and no vertical speed, putting power at 4 at the first iteration you need 22 second before the ship goes up (positive vertical speed). Here are the various speeds : 0 -2,711 -4,422 -5,133 -4,844 -4,555 -4,266 -3,977 -3,688 -3,399 -3,11 -2,821 -2,532 -2,243 -1,954 -1,665 -1,376 -1,087 -0,798 -0,509 -0,22 0,069
I hope this help.
Best regards, 40tude.

3 Likes

Isn’t this puzzle (level 1) too hard for ‘easy’ section? I got 100% in the first four puzzles and the temperature puzzle easily, but in this one I don’t even know what to begin with…

2 Likes

Level 1 is entirely vertical, you don’t have to worry about X or HS.

The only issue is landing on the platform at a velocity more than -40. Also bear in mind that only a thrust of 4 is strong enough to overcome the gravity (-3.711) and begin to slow you down.

This first level of this puzzle is in fact pretty easy: you just need to decide which thrust to apply. With 3 you will slightly accelerate and with 4 you will decelerate. If the (absolute) speed is greater than 40 you should decelerate.

How do I find the coordinates of the landing surface from it’s beginning to it’s end?

Hey @brunorz,

The landing surface has two points with the same Y coordinate :rocket:

1 Like

You don’t need to compute the coordinates of the landing surface for the first level. For the other levels, you need to find two consecutive points with the same height: they are the left and right borders of the landing surface.

Hello. Mars landers, this can help you : https://www.codingame.com/forum/t/mars-the-game/756

1 Like

long long ago, in the topic far far away, @Florent was looking for some

here we go:

  1. liquid oxygene/kerosene fuel pair has flow speed from engine like 3510 m/s, so 1 ton (approximately) landing crane/platform with rover will have acceleration 3.51 m/(s^2) for every kilo of burned propellant/oxidiser mixture, with max acceleration of 14,04 m/(s^2), what is enough for everything i will say further, but can be extended

  2. we landed 100 kilometres away from desired landing site - how much fuel will it take to take off, accelerate in desired direction, slow down horizontal speed near target and land with minimal vertical speed? on such small distance we can assume the surface is flat

  3. we landed 1000 kilometers away - we can no longer assume that surface is flat on such scale, we need to take curvature into account

  4. we landed on other side of planet - we need now not just take off and land, we need to achieve orbital speed, wait until we near desired place, and only then land (including orbit pertrubations from mascons)

  5. we need to go home with gathered samples! why not? it is as easy as:

  • going to orbit (part 4)
  • reaching L1 point of Sun-Mars system
  • accelerating towards L2 point of Sun-Earth system
  • bracking there
  • going to Earth orbit
  • landing on Earth (with parachutes, inflatable bumpers, aerodynamical surfaces whatever)
  1. how did we get to Mars? all the part 5 in reverse

  2. really, why the acceleration is so low? is this task’s lander fuelled with wet firewood?

2 Likes

Appealing, but still lacking zombies… or nazi flying saucers of the dark side of the moon, I’m not narrow minded. But I like the space theme anyway. I’ve discovered the whole Honor Harrington serie not so long ago and that reminds me of all the space battle descriptions where the crew calculates the best course for their waves of missiles. Not realistic I think, but cool as well and, let’s not forget it, make things explode is an objective, not a failure! An asteroid-like multiplayers battle for the next challenge maybe?

If any one can post the fuel remaining on each exercice, it would be nice. Mine are 247, 354, 452, 465 and 580.

1 Like

interesting
i assume these are data for level 2 puzzle
so my results are 56, 90, 24, 174 and 607

UPD slightly corrected
now my values are 96, 158, 154, 318 and 607
but looks like too low comparing to your result

1 Like

Thanx for answering ! :sunny:

I work on a new approach and get (much) better values : 329, 359, 496, 516 and 710.

Just 58 l more to save to be first ! :wink:

1 Like

i achieved results 242, 282, 444, 507 and 613 - looks much like where you started, but there are also much hardcoding already

Have you improved your score since your post? You are now just before me in the ranking…

Mine: 327, 357, 512, 495, 707 = 2398

Yes, I worked on a new approach and get (much) better values : 329, 359, 496, 516 and 710 = 2410.

I can’t figure out how you get 512 at the third exercice. Congratulations ! :slight_smile:

1 Like

Mars Lander puzzle level 1 & 2 are buggy in C++. I didn’t try level 3 yet.
Inputs are complete non-sense!

Here is an output example for MarsLander Level 2 - 2nd test case.

Game information:
Landing in progress...
X=5452m, Y=2733m, HSpeed=-102m/s VSpeed=-7m/s
Fuel=566l, Angle=-22°, Power=4 (4.0m/s2)
Standard Error Stream:
(X,Y) = (574,-22)
HS = 4
VS = 5555
F  = 2741
P  = -7
R  = -105

I have read the values with:

int X;
int Y;
int HS; // the horizontal speed (in m/s), can be negative.
int VS; // the vertical speed (in m/s), can be negative.
int F; // the quantity of remaining fuel in liters.
int R; // the rotation angle in degrees (-90 to 90).
int P; // the thrust power (0 to 4).
cin >> R >> P >> X >> Y >> HS >> VS >> F; cin.ignore();
         
cerr << "(X,Y) = (" << X << "," << Y << ")" << endl;
cerr << "HS = " << HS << endl;
cerr << "VS = " << VS << endl;
cerr << "F  = " << F << endl;
cerr << "P  = " << P << endl;
cerr << "R  = " << R << endl;

Am I the only one have this problem ?

After going through the whole thread I found out that there are 2 kinds of people on this post :smile:

  1. People who know to code but don’t understand physics.
  2. People who know physics but don’t understand coding.
8 Likes

“Mars Lander - Fuel optimization” game seems to feed incorrect lines to the program. In test 1 R and P come before X Y and in test 2 X Y is swapped with the speeds other tests are broken too for me, does anybody have this problem too?

2 Likes

Hello,

I thiink there is a problem with the parsing code in javascript :
var inputs = readline().split(); //didn’t work as expected

Must be replace by :
var inputs = readline().split(’ ');

It could be hard to fix for a beginner.

BR.

1 Like