Welcome to the very first official Development Log for Lacuna Passage. This game has been a pet project of mine for the last 6 months or so and I am finally at the point where I would like to start talking about exactly what I am working on.
I’ve always been a huge fan of space exploration and the recent success of the Mars Curiosity Rover inspired me to make a game that embodies the nature of exploration and discovery. Lacuna Passage is that game. I wanted to create an experience that might fulfill my own desire to set foot on another world, and for the last 6 months I’ve been researching and prototyping exactly how I might do that.
When I started the project I tried to get a sense for the types of games that have attempted this in the past. From what I noticed it seemed that many space exploration games focus on some kind of tension mechanic. You have limited oxygen, you are being hunted by mutant aliens, you are trying to survive or fight… Games like Dead Space, Metroid Prime, or Mass Effect, and many of these take place far in the future where we lose some context for the difficulty and high risks associated with space exploration. Everyone has a spaceship, and things like gravity, physics, and engineering are trivial matters. On the other end of the spectrum are the space simulators (Kerbal Space Program, Universe Sandbox) that don’t have a story to tell, they simple try to replicate the nature of space or space travel. There are very few games that sit in between those styles. I wanted to create something contemplative and awe-inspiring, not fear-inducing or pedantically accurate. I wanted to create an impressionist representation of modern space exploration. Think Dear Esther in space.
Mars was and has always been a particular fascination of mine so it was only natural to have the game set there. However, I quickly realized that Mars is a fairly dull landscape. It is certainly nothing like the bright reds and oranges you might imagine or that have been depicted by Hollywood. In reality, most of Mars is relatively flat and brown (as can be seen in some of the amazing images sent back by the Curiosity Rover, including the one above). I set out to create a “hyper-real” version of Mars that combined its true features with something that might satisfy our imaginations.
The first step in this process was to find out how much real Mars data I could incorporate into the generation of the game’s terrain. When I discovered the Mars High Resolution Imaging Science Experiment (HiRISE) I started getting really excited. The problem then became how to utilize this newfound data source in relation to terrain generation.
The HiRISE site features several hundred independently scanned locations with various formats of image data. Best of all, there are absolutely no copyright concerns. All images are public domain. Science is awesome.
When you enter the page for a particular scan you are presented with several image links. On the left you will find the raw image data in .IMG format, but they are giant files that you can’t just open up in Photoshop (we will talk about those more next week).
In the middle of the page you will find links to some standard .JPG images that feature various representations of the Martian terrain. Most notable are the Color Altimetry images (as seen above) that show the relative heights of geologic features according to a color gradient. While informative (and very colorful), they are unfortunately not very useful to us for direct application in a game engine. Luckily, we can find another type of image file here that will likely be familiar to anyone who has dealt with terrain in any modern game engine. Though they may not call it by the same name, the HiRISE project has seen fit to supply us with grayscale heightmaps. For those unfamiliar, a heightmap is an image that communicates height data via pixel grayscale values. Simply put, the whiter the pixel, the higher the altitude. These are invaluable in the production of high quality terrains that can tessellate their mesh data depending on the location of the player in the game. A much more optimized solution than using giant static meshes to build the terrain.
Unfortunately, the rendered heightmaps provided by HiRISE are only 8-bit images that do not contain enough data to translate to smooth terrains. Using these images alone will result in a “stepped” effect where the grayscale transitions are too harsh.
If you would like to use these 8-bit heightmaps there is still hope for you though. With some experimentation I was able to convert the 8-bit images to 16-bit RAW in Photoshop and then downscale them and composite several together to form a full 2048x2048 scale heightmap that renders in Unity quite well. By getting creative with cutting and pasting different features together you can composite very large heightmaps with very little noticeable stepping. You can always add a slight blur effect after converting the images to 16-bit, though this may result in a terrain that is smoother than you would like.
If you want to take your heightmaps a step further you can effectively “post-process” them in a procedural erosion simulator like World Machine to add in detail that was lost in the conversion from 8-bit to 16-bit. Since World Machine is a fairly complex application I won’t go into a step by step tutorial, but you can easily import your composite heightmap and run an erosion simulation on it and export a new, higher-detailed heightmap to be used in your game engine. (This tutorial sums up the process pretty nicely). You could always start with World Machine directly to procedurally generate your entire terrain, but in my case I wanted to use the exact features from Mars as scanned from orbiting satellites. It adds a level of authenticity that still allows for creative rearrangement of features to suit my game.
I was fairly happy with this workflow for quite some time, but the composite method for creating heightmaps becomes a bit more difficult when working with giant terrain sizes like the ones used in Lacuna Passage (8192x8192). Ultimately the fidelity of the heightmaps fails and it becomes too much of a jigsaw puzzle to find the appropriate images to composite together. I’m sure that others may find this technique satisfactory, but next week I will talk about how you can utilize the actual raw data from the larger .IMG HiRISE data files to generate your own high-poly meshes and render your own (incredibly large) heightmaps.