3D 1:1 Scale Lunar Landing Simulator

High-Level Project Summary

You've almost reached the moon, when suddenly a solar flare fries your navigational computer! You still have manual thruster and engine control, can you make the landing?Explore a 1:1 scale Moon from above in a spacecraft, and attempt to land. The Moon is modelled with real data for the macro features, and filled in with procedural details calculated on the fly when up close.

Detailed Project Description

Gameplay

  • The aim is to attempt to land your ship using manual thruster and engine control,
  • And to experience what it might be like to land on the moon
  • For future work: Fuel management, takeoffs, landing zones

Graphics

  • Uses real-time raymarching in WebGL Shader Language to render 1:1 scale 3D model of the Moon.
  • The base color of the Lunar surface and base heightmap comes from real data captured by Lunar satellites. Uses two 8192x4096 maps (one for height, one for base color). Bilinear interpolation is used to smooth the transition between 4 data points when close to the moon, then procedural detail is added using Simplex Noise.
  • The direction of the sun shining on the Moon is calculated based on the arrival date entered in the title screen.
  • For future work, the procedural detail generation could be made to more approximate the lunar surface at that scale, perhaps by generating a lookup table based on area containing information on smoothness, amount of boulders/rocks, smaller craters, etc.
  • With some data and parameter changes other planets (i.e. mars) could be rendered.

Screenshot taken at a high level

Medium level

Low Level

Physics/Lander control

  • The lander is currently displayed as a box frame, with indicators on the floor showing where the thrusters & engine are, in the HUD on the left there is a display which shows the controls for the 4 thrusters, grouping controls, and engine controls. As well the HUD displays the velocity relative to the ground, the altitude, and speed of each of each of the four corners on the bottom of the ship (used for determining safe landing velocity)
  • Uses CANNON.js to simulate rotation and velocity integration
  • A small offscreen 1 pixel render to a shader which returns the current altitude encoded in the color components is used for basic collision detection.
  • The lander has 4 turning thrusters, and an engine. To make things a little easier, adjacent thrusters have "groups" where they can be triggered at the same time with a single keystroke. (I.e. pressing W to hit the top-left and top-right thrusters at the same time)
  • Several engine power settings, the highest setting for slowing down your approach and even going higher, the lowest setting for fine-tuning to reach < 1m/s velocity just as the lander hits the ground.
  • The HUD on the right shows the current rendering framerate, shows the rendering quality setting, and controls & setting for the simulation speed setting.
  • For future work, adding roll thrusters would make it easier to go in directions that aren't axis-aligned.
  • For future work, basic air resistance modelling for landing on planets with atmospheres.
  • For future work, Better collision detection, actual landing gear, enforce landing up-right.

Space Agency Data

Color & Displacement datasets from the SVS: CGI Moon Kit dataset: https://svs.gsfc.nasa.gov/cgi-bin/details.cgi?aid=4720

Hackathon Journey

Q. How would you describe your Space Apps experience?

A. It's been a fun and informative experience.


Q. What did you learn?

A. One thing I've learned is that landing anywhere, even the moon, is very, very difficult (at least manually).


Q. What inspired your team to choose this challenge?

A. I've (Chris Adams) wanted to make a game like this for a while, this hackathon gave me the perfect excuse to implement it.


Q. What was your approach to developing this project?

A. Our approach was to work hard, quickly, and accurately and get everything essential to the idea implemented and working first.


Q. How did your team resolve setbacks and challenges?

A. Stay calm, think things through.


Q. Is there anyone you'd like to thank and why?

A. Thanks to John Adams (my dad) for fostering an interest in space exploration in me from a young age.

References

Data used:

  • Color & Displacement datasets from the SVS: CGI Moon Kit dataset: https://svs.gsfc.nasa.gov/cgi-bin/details.cgi?aid=4720

Source libraries used (game):

  • THREE.js: https://github.com/mrdoob/three.js
  • CANNON.js: https://schteppe.github.io/cannon.js/
  • moment.js: https://momentjs.com/
  • Simplex 3D Noise shader by Ian McEwan, Ashima Arts

Data-preprocessing:

  • (npm) pngjs
  • (npm) tiff

Development tools:

  • Atom Source Editor
  • GIMP
  • NodeJS 12
  • Google Chrome

Tags

moon, lander, scale, 3d, physics, simulation

Global Judging

This project has been submitted for consideration during the Judging process.