Rendering the Red Planet

With NASA’s successful landing of the Perseverance Rover and Ingenuity Drone many folks have been quite excited about Mars lately! One of the ways I like to channel my imagination around a topic is to build something related to it.

While visiting and inhabiting our nearest planetary neighbor might be exceptionally difficult in real life what about creating a realistic simulation of it in Minecraft? I’ve shared some of the process that goes into adding a world to our server here.

The Prompt

At its core every Minecraft world is made up of blocks. The default rendering engine doesn’t create terrain that’s very realistic, but if you think about it every one of those blocks could be a changeable 3D pixel – there’s potential for better! Here at WHIMC we’re really interested in computational thinking and applications – so rather than lay down one block at a time (for a lifetime?) I’ve been thinking about how to algorithmically generate Mars.

NASA has been kind enough to release many ground survey 3D models that we can start with. This leaves us with the challenge of how to best convert this 3D mesh, which is made up of points connected by lines that form triangles, into the square blocks that make up the substance of a Minecraft world.

Approach One: Voxels

Thanks to Patrick Min’s Binvox there’s an outstandingly simple but powerful tool to convert 3D files to .schematic files (OBJ’s with vertices => voxel cubes), which are recognized by WorldEdit, one of the plugins we use to paint landscapes in-game. Applications like TinkerCAD can convert 3D files for Minecraft as well but are not able to do so on a literally planetary scale and don’t make use of a stupendously fast GPU and efficient voxel script to do so. Unfortunately while this process initially seemed promising I quickly realized that creating anything larger than 1/2000th scale (1 block is 1 meter in Minecraft) would crash our server. I then tried it locally and found out why:

My computer has 32 gb of RAM, there wasn’t any left to run other applications!

The initial renders with this method were quite realistic looking, however:

The Valles Marineris geological formation at 1/2000th scale, 512 blocks wide!

So I decided there had to be a more efficient computational method to render a section of planetary surface bigger than the Grand Canyon and got to searching…

Approach Two: Heightmaps

Turns out WorldPainter, one of the other tools we use a lot to generate our What-If simulations can generate Minecraft worlds by using Heightmaps, which are grayscale 2D imagines of 3D files where the lighter parts are higher elevation and the darker parts are lower elevation. This technique can be used for creating custom brushes and textures in crazy games like Doom (hey, that’s on Mars too).

Marcom3D has a great guide on YouTube for how to convert a mesh on over using behaviors in Blender.
WorldPainter can pull in grayscale heightmaps and create custom terrain.

I wasn’t totally happy with the result here simply because the variance in height made many of the craters and nuances on the surface disappear, and the mesh triangles, when blown up at a 10k pixel resolution were quite visible:

I did later go back and smooth out the edges and clean up the floor but it ultimately didn’t look very realistic, and this version was still only at 1/100th scale at 10,000 blocks in size! The NASA 3D files represent an area 1000km wide, which is truly colossal when you think about it.

Realism in Simulation

This entire process revealed another tricky issue: while my absurd computer might be able to load 64 chunks at a time our server will be set to 8 for every-day users. Where’s the right compromise between being life-size and visually-comprehensible? What I’ve settled on for scale, for now, is to try to get more RAM and make a 1/1000 or 1/500 size version for players to explore and view from up in the sky. What I determined was as important to all of this along the way was the ground and atmosphere composition:

So, all-in-all, I’m pretty happy with what I’ve learned and confident that with a little more work and a little more computer memory we’ll have a Mars planet simulation that will be both realistic and impressive looking. The big question remains, however: what will they learn there? To see the final version and find out, you’ll have to sign up 🙂