Twitter  Facebook  Google+  YouTube  E-Mail  RSS
The One Man MMO Project
The story of a lone developer's quest to build an online world :: MMO programming, design, and industry commentary
So Many Glitches
By Robert Basler on 2018-03-05 01:35:44
Homepage: email:one at onemanmmo dot com

I've been working on procedural generation of cliffs and rock formations. Previously Miranda had a heightmap terrain with rock models (made by artists) placed on it by the terrain generation utility. All of these standalone rock models are placed based on a complicated set of rules. To help players identify impassible terrain, rock textures are placed on areas where vehicles can't navigate. I was never very happy with textured cliff faces, particularly at the map limits.

[It's so wrong, but sort of beautiful.]

I started with a bunch of research, looking at all the different types of rock formations in nature. That was wonderful. I saw chalk deserts, volcanic glaciers in Iceland, and sandstone formations in Arizona among many others. Nature is amazing.

When I researched procedural rock generation algorithms, I was rather surprised to discover that nobody else seems to have done this before for games. I found a few articles on modelling individual stones procedurally, but nothing on a larger scale.

I also spent several hours looking at the rocks in games from my library. All the games I've looked at have artist-designed rock formations. They look great, but there is undoubtedly a significant art cost. In case you're wondering, Guild Wars 2 has the best looking rocks I found.

The one true thing about building mesh geometry procedurally is that it is painfully difficult to get correct. I spent a lot of time these last couple of weeks looking at glitches. Everything would appear to be working, then I'd shift to a different area and things would be poking out all over the place and I'd have to break everything down to try to figure out what was going wrong.

[Procedural geometry is painfully difficult to get correct.]

It was kind of a thrill the first time Miranda produced rock formations that looked like something you might see in nature. I was even more surprised when I discovered that the map borders are now covered with huge cliffs instead of walls of smeared textures. When I was working on this, I hadn't considered that problem at all.

Rock generation is done on the CPU on a per-terrain-block basis. Initial performance of the rock generation was pretty poor, sometimes taking minutes to generate a single block (Miranda keeps a minimum of 72 terrain blocks loaded.) Performance is better now, but it is still a work-in-progress. Most terrain blocks have over a thousand individual rocks and several megabytes of mesh data. Surprisingly, the rendering performance is really good.

One interesting problem was Miranda's deformable terrain. When a player places a building, the terrain under it changes. I didn't want all the rocks on an entire terrain block to change with one small change in the heightmap terrain, so I seeded the random number generator on a per-rock basis, so only the rocks right where the terrain deforms will change.

At this point, the rock meshes are coming together. The terrain covered in rock formations is certainly much more visually interesting than the old system. I have one more rock mesh type I'm working on (basalt columns,) and some work to do on the shaders that cover those meshes before I move on to the next engine upgrade. I'll be coming back to do the art for the rocks once all the renderer upgrades are complete. I had a good chat with my unoffical art director this weekend, and he was able to remove some big items from my to-do list.

New Comment

Cookie Warning

We were unable to retrieve our session cookie from your web browser. If pressing F5 once to reload this page does not get rid of this message, please read this to learn more.

You will not be able to post until you resolve this problem.

Comment (You can use HTML, but please double-check web link URLs and HTML tags!)
Your Name
Homepage (optional, don't include http://)
Email (optional, but automatically spam protected so please do)
Multiply: 2 and 6 = (What's this?)

  Admin Log In

[The Imperial Realm :: Miranda] [Blog] [Gallery] [About]
Terms Of Use & Privacy Policy