Jump to content
  • Advertisement
Sign in to follow this  
  • entries
  • comments
  • views

New Terrain!

Sign in to follow this  
Sir Sapo


Hey everyone!

So today Mark decided that the current terrain in A22 is boring and too 'perfect', so, after much discussion, he finally convinced me to try a technique he thought up to make the terrain more.... rough.

Terrain Surface Decals
As you may already know, the terrain in Angels 22 is a 2D heightmap, which generally means that the terrain is very sharp, as it is comprised of a bunch of 4 vertex boxes stuck together. I was convinced that the terrain was fine how it was, and that no one would care if it was so sharply defined. Well, I tonight I coded up Mark's technique (which will be described below), and I must say, I was wrong, the new terrain looks much better than the old stuff, and actually solves a lot of my problems, such as how to make good roads.

The Technique
Because the actual 2D distance between two heightpoints isn't standard, you can't simply slap a sprite in between two points becuase it will either be too little, or too small, resulting in gaps. Mark's idea was to use a relatively long texture, and only use the length of the texture that we actually needed. I guess it's not that novel of a concept, but it never really occurred to me. Anyways, in order to render the overlay, a quad is drawn, and rotated so that it completely covers the distance between two adjacent height points. Then, it is texture mapped using texture coordinates modified using the distance between the two points. The result is a nice texture line that can be stretched, without distorting the texture, which is what allows us to now do stuff like roads, grass, etc. Anyways, you can see the new terrain with a grass overlay over it in the screeny below:

The type of terrain covering can also be changed on a per segment basis, so the whole level doesn't have to be covered in grass, and some parts can have other covers, like roads, or rocks. Also, I implemented a random feature, so that once Mark puts together some more grass textures, the game will randomly pick the ones to be displayed, giving the levels a lot more visual diversity.

Well, that's all for now, and thanks for all the positive comments, they really boost my morale, and keep me coding. Peace Out!
Sign in to follow this  


Recommended Comments

Wow, I hadn't expected that the terrain could have been updated to look this great. Definitely a great idea of Mark, the grass covered terrain is awesome.

Share this comment

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!