Inspiration
The inspiration for this game came from the recent success of the Perseverance Rover that landed safely on Mars. The game teaches people about orbital physics in a very fun and engaging manner, also teaching them about real world maneuvers that are used to control satellites in orbit. Perseverance takes the help of the Mars Reconnaissance Orbiter to relay information to and from from mission control thus making the MRO an integral part of the success of the mission.
What it does
What this game basically does is simulate the experience of controlling the MRO satellite currently orbiting Mars. The first objective of the game is to convert your orbit around mars from an elliptical shape to as circular as possible and the second objective is to reduce the altitude of your orbit to a lower value but not too low otherwise the satellite will burn and crash in the atmosphere of Mars. The physics behind this game is pretty airtight and you can even ask for help by pressing 'H' on the start screen if you would like to become a tiny bit smarter in the field of orbital mechanics in just a minute of sweet and sumptuous physics.
How I built it
The game was built completely with python using the pygame module. The main law running the game is the Newton's Law of Gravitation with the help of which I calculated the supposed acceleration of the satellite due to attraction by Mars is calculated and appropriately the position of the satellite is changed (along with changing its linear velocity and angular velocity). The law of gravitation states that two point objects attract each other with a force that is directly proportional to the product of their masses and inversely proportional to the square of the distance between them (i.e. F=G*m1*m2/r^2). This is then used to find the magnitude and direction of satellite. To calculate the angular velocity of the satellite we make use of the distance between the satellite and Mars, using the relation (v=wr), where w stands for the angular velocity of the satellite, and v stands for the linear velocity of the satellite. The final law used in the project is Kepler's 2nd Law of Planetary Motion which states that the areal velocity of a any object in orbit remains constant, i.e. if the satellite is near to Mars then it will go faster and if it is far away, its velocity will become much slower. The use of this law is used to speed up/slow down the satellite in the game, making it more accurate.
Challenges I ran into
One of the biggest difficulties I faced was to incorporate the gravitational force in such a way that it does not attract the satellite too much that it crashes into mars immediately, or too less that the satellite achieves escape velocity as soon as the game starts. So after a few hours of trying and trying with random values, I narrowed the range down to the sweet spot and also figured that things would become much easier by assuming the mass of satellite to be unity.
What I learned
A new thing that I learnt is how to read and write to files using python. I had learnt this to simplify our life and store data such as image names and image positions/size so that the code doesn't become too long. While writing the code I also used this knowledge to maintain a recentscores.txt file that stores all the scores and is then used to display the last 10 scores in a window at the end of each game.
What's next for Mars Reconnaissance Orbiter
The nest step for this game is to change the orbit of the satellite from equatorial to polar and hide the satellite when it goes behind Mars as well as locking the controls for the satellite in this shadow region, thus increasing the difficulty a notch. Another thing I wanted to implement but did not have time enough to do is to modify the code so that at random time intervals (but not too frequently) an asteroid/meteor passes by and thus affects the satellite so that its orbit gets messed up.



Log in or sign up for Devpost to join the conversation.