Terrain Generation Complete

May 16th, 2009


My university term is now over, which means my terrain generation application has been completed and handed in.

The project page is here, where you can download the executable and source, and watch a high-definition video of the generator in action.

Here’s some screenshots of the application at various stages during development:
textured100over20fnoise

Pertty lights in first-person mode.watershaderonterrain

Dare

April 29th, 2009


We got in!

So excited, I can’t wait for it to begin.

Waiting to hear back after the interview was nerve-wracking, though thankfully we were all told whether we’d be taking part before the official announcement was made. As for the interview itself, it went surprisingly well. I can’t speak for everyone, but I was terrified about having to speak, and about what horrible question we might be asked that we hadn’t even considered before. In reality though, the judges were all friendly and the setting for the interview was fairly informal, so we were all relaxed and our presentation went more smootly than in any of the practice runs. It left us feeling that whether or not we got in, it went as well as it could have and there wasn’t really anything we’d later be kicking ourselves over messing up, which I guess is the best outcome you can hope for.

As with in other years of the competition, we’ll have to update blogs and video diaries, so I’ll share a link to those as and when they start existing.

terrainfinishedAnyway, before that I’ve still got some coursework to get through (not a huge amount though – it’s due on Friday after all).

I’ve finished my OpenGL coursework and I’m pretty happy with it – I’ll share some more details, code and the executable itself once I’ve handed it in. Conforming to the requests of UKR’s Blue Skies in Games Campaign I’ve made everything considerabley brighter and more cheerful. I also made some technical improvements as well, so that now the application actually runs at a decent framerate on hardware I can afford to test it on.

More Terrain (in case you aren’t sick of it yet)

April 20th, 2009


It’s a video this time though. So that’s better.

You can see the program layering the octaves of Simplex Noise here, going from large, gradual slopes to finer surface noise. Colours are now blended as well instead of just popping in at certain points, and at the end the whole terrain is smoothed. As the water and terrain are constantly in motion, normals have to be calculated each frame which is fairly processor intensive. However, since this video was captured I’ve switched over to using vertex buffer objects which has made a noticeable difference to the frame rate, and almost all the remaining changes I have to make relate to the graphics card, so hopefully the demo will remain at about 30fps on the target platform.

Even more Simplex Noise

April 4th, 2009


Just thought I’d upload some further screenshots from the terrain generation program I have in development.

Last time I wrote a post about Simplex and Perlin noise it ranked highly in google for searches about Simplex noise almost immediately, which really demostrates how under valued it is and how few resources are already available. For this reason, I definitely intend to share any source code I write and hopefully offer as simple an explanation as possible of my understanding of how it works after this project is complete.

 First, I started colouring my terrain according to changes in its height. Soon I’ll improve this further by texturing the terrain and also varying colours on areas with certain gradients, for example to create the appearance of cliffs.
blendedcoloursloadsofpolys

 
 Getting the river to a realistic value wasn’t easy (and I’m still constantly fiddling with the values I feed it).
rivercolourriveroflava

 
 I added a water plane to the scene and sloped the terrain downwards to form a coastline.
slopesideviewwaterplanesmoothed

 
 Obviously, the next step was to simulate some waves to make the water more realistic. Here, you can see points along an edge of the plane are being displaced to create ripples across the water.
generatorsterrainwithgenerators

 
 In the actual simulation, these “generators” are on a part of the water plane not being drawn to make the water look more natural. I also drew edges of a box around the terrain so that it isn’t simply a plane floating in space: not more realistic, but it looks kind of interesting.
waves2box

Simplex Noise

March 30th, 2009


No huge update, just figured I’d share some screenshots from my terrain generation/openGL project:

Here, several octaves of Perlin noise (on the left) and Simplex noise (right) are layered to produce a fairly bland landscape. At the moment I’m not sure whether to get it a little more bumpy or to leave it flat and try and plot some buildings. These maps both use 2D noise, inputing X and Z coordinates to give a height at each point.

perlinnoise3 simplexnoise2

 
 As these top-down views show, Perlin noise (left) is less ‘active’ than Simplex noise given the same values. Simplex noise is also lacking Perlin noise’s distinctive thread-like patterns.
perlinnoise4 simplexnoise4

 
 These images both show Simplex noise using the same X and Z coordinates, this time using time as a final variable in generating 3D noise in order to allow different landscapes to be produced.
simplextime1simplexnoise2

 
 Finally, here’s the landscape with a river cutting through it. As you can see it still needs some work – the repetitive sin wave is far too obvious at this scale – but the function is actually very flexible and after some experimentation with values and some more variation I think it will be fine.
simplexwithriversimplexwithriver2

 
 The next step is to look at using noise maps to create procedural and possibly animated textures, and getting some water in there.

In other news:

  • We’re demonstrating and handing over our group project game “Some Assembly Required” to the BBC tomorrow. It’s looking rather nice (screenshots and videos to follow) and we might need to do a little more work before our coursework hand-in, but I think the whole team is pretty pleased with the final product.
  • The whole “Variables don’t vary” deal with functional languages is only weird when you stop and think about it. When you actually get to writing code, it isn’t really something you notice. Just a different mindset I guess. In other words, my experimentation with Haskell continues.