Category Archives: Uncategorized

Sick weekend: terrain generation

This weekend I’m sick and it sucks. As good a time as any to try myself at terrain generation.

I’m a lousy programmer and it’s the first time I ever dabble with this but here’s the thought process I went through.
Also, It’s not finished, but I figured I’d give myself a motivational boost!

The first step was for me to draw a grid and use the vertices’ coordinates to create triangles. Triangles are then combined into a single mesh.

  • The lines and yellow handles are just there as visual guides.
  • I used coroutines to show the processes step by step (useful for debugging and to make fancy gifs)
  • The two pics below show some various steps in the work. I gradually simplified things and replaced coroutines with methods to go faster.

gen02

gen

Up to this point I was adding height noise with a basic Random.Range but switched to Perlin noise to create the terrain-like topography . Thanks Mr.Perlin! <3
I rounded the height values to int to achieve the “ground ladder” effect.

gen03

Then some fanciness. I created a basic texture with the terrain color and figured out a basic algorithm to match the mesh’s vertices uvs to the texture.

terra

By far this was the most painful and not funny bit. And my algorithm sucks.

  • I need to remove the “spiky color corners” (tech-savvy language FTW)
  • I need to figure out how flat shading works to make this look appropriately old-school

gen07

I also added an arbitrary water plane.

gen05

Same thing with noise not rounded to int.

gen06


Quick note/question:

I’m quickly limited in mesh vertices count. The limit is set at 65000 meaning that a 275*275 units terrain is already out of bounds. I guess the way to fix this is to generate the terrain data and when creating the mesh, switch to a new mesh when the vertex cap is reached?

Generated playable levels

Some more progress on the level generation front. All levels generated seem to be playable.

At this point the downside is these levels not having a lot of “character”. It would make sense to add some kind of generation profile to induce more variation (columns, long platforms, clusters, etc.). Don’t know if I’ll pursue this further though since the prototype it’s working with is not very satisfying.

proc_second

Jamulus – OCVR gamejam

I was quite happy to see some people enjoying Jamulus. Considering Olivier Lhermite and I developed this small (neck-breaking) game in less than 36 hours, this is super heartwarming.

Jamulus is on the 16th spot in the video below. And by the way, those other games seem absolutely great. I wish I had an OCVR device myself :-p