Fun With Craters

As with many things in life, one thing led to another.

It all started when I decided to revisit my noise generator.  I was never 100% satisfied with the one I created because there were some artifacts like the mountains would favor a diagonal orientation.  So, I completely re-wrote the noise generator and now it is so much better.  The mountains are truly random now with no obvious visual bias.

Then I turned my attention briefly to the hydraulic erosion simulation and a sudden thought occurred to me.  Why am I simulating hydraulic erosion on planets that don’t even have an atmosphere?  No atmosphere means no rain.  No rain means no hydraulic erosion.  Whoops.

So, I turned off the hydraulic erosion simulation pass in the planet generator for those planets with no atmosphere.  But then it occurred to me… hey… we know what happens to planets with no atmosphere, right?  We have a “planet” in our very own backyard with no atmosphere in real life.  We call it the Moon.  How is the Moon visually different than the Earth?  That’s right… craters!  Lots and lots of craters.

So, I headed back out into the Internet in search of anything that can help me here.  I came across some very good DEM (digital elevation model) maps created by the very nice folks at USGS.  Take a look at their very nice website here: https://astrogeology.usgs.gov/search

I grabbed some elevation maps of the Moon, of Mercury, and I think either Ceres or Vesta.  I brought them into Photoshop, resized them, and readjusted the values.  Here are the three maps after adjustment:

Craters 1 Craters 2 Craters 3

I updated the planet generator to use these maps (a random one is selected for each atmosphere-less planet).  And here is an example of how it looks in the game (click on the image to zoom in).  The second image shows the terrain vehicle and ship near the rim of a large crater.

Craters Crater Rim

Also – I made it so that for all other planets with an atmosphere, the amount of rain that falls depends on the atmospheric density.  In addition, the velocity of the water moving across the surface when simulating erosion depends on the gravity of the planet.  With those changes, the planets in this Starflight remake look less uniform and more varied.  Good stuff!

By |2019-02-25T06:41:44+00:00February 21st, 2019|Starflight|3 Comments

We Want… a Shrubbery!

Over the past few days, I’ve been working on getting trees and shrubbery in.  After consulting with the knights who say “Ni!” about shrubbery, I was able to wring some halfway decent looking plants and trees using Unity’s built-in tree editor.  Their tree editor is nowhere near as nice as SpeedTree, which is what I am used to working with during my video game programming days, but for the purposes of this game, I think it works OK.

I’ve created 5 different tree types and 2 different shrubbery types.  In the original game, they were called “producers” which I guess meant they produced fruit or something.

I took a video of the terrain vehicle exploring the liquid planet at 123,101 around the lower elevations.  The vegetation favors the lower elevations – they become less common the higher up you go.

Next, I think I will need to work on the mining system (terrain vehicle cargo hold).  I think that is one of the last major bits before the game will become truly playable, as far as gathering elements and selling them at Starport to get money to upgrade your ship.

By |2019-02-09T19:20:04+00:00February 9th, 2019|Starflight|13 Comments

It’s Just an Ordinary Rock, Sir!

Yesterday I spent some time coming up with the component that populates planets with rocks.  Not elements, mind you… that’s next.  These are just plain old ordinary rocks that you don’t mine.  Why?  Because if the planet was populated with just elements, it’d look really weird.  So having a blend of ordinary rocks dotting the terrain along with elements you can mine should make things look and feel more natural.

Also, the number of rocks present on a planet is proportional to the mineral density reported by the ship scanner.  And, they will generally be placed in the higher elevations.

I have made it so that you collide with the rocks instead of driving through them.  Having the TV drive through 3D objects in the game would just look broken and wrong.  The collision behavior works nicely for the most part but will need some fine tuning later to clean up the extreme angle cases.

I have discovered another weakness in Unity.  Unity takes 4 whole seconds to instantiate the 2500 rocks I am placing on the planet.  And that is on my bleeding edge 10 core Alienware PC!  That is a ridiculous amount of time.  So, real-time instantiation is a major performance issue with Unity and I’m going to have to try and think of alternative solutions.

Here is a video showing a nice cruise through the terrain finding and bumping into ordinary non-mineable rocks.

By |2019-02-04T06:00:54+00:00February 3rd, 2019|Starflight|2 Comments