Ways to fill space underneath the terrain

Started by
2 comments, last by Lama43 11 years, 6 months ago
Hello, i'm currently developing a game (obviously) which has random terrain generation based on Box2D's ChainShape. Pretty much it just chooses between different directions of the terrain within a range (horizontal, vertical and so on). My problem is that given the random nature of the ground i can't think of ways to make it stay within the terrain "bounds", a simple layer system with overlaps and the like wouldn't work, and i'm not really an expert programmer. I'm using OpenGL ES if it is of any help.
Advertisement
I'm really not following your opening post, could you please clarify? I have the following questions:

a) So I assume it's a 2D terrain, but what sort?
b) What do you mean "it just chooses between different directions of the terrain within a range (horizontal, vertical and so on)"? Is it a tile-based terrain and it chooses N, S ,E or W facing tiles accordingly?
c) What do you mean by "making the terrain stay in bounds"?
d) What is the idea of this "simple layer system" and what do you mean by "overlaps"? Overlapping tiles?
e) Where do these hole artefacts appear and why?

I'm really not following your opening post, could you please clarify? I have the following questions:

a) So I assume it's a 2D terrain, but what sort?
b) What do you mean "it just chooses between different directions of the terrain within a range (horizontal, vertical and so on)"? Is it a tile-based terrain and it chooses N, S ,E or W facing tiles accordingly?
c) What do you mean by "making the terrain stay in bounds"?
d) What is the idea of this "simple layer system" and what do you mean by "overlaps"? Overlapping tiles?
e) Where do these hole artefacts appear and why?


-Yes, it's a 2D terrain in a side scrolling game, sort of what's in Terraria.
-No, basically the system decides what's going to be the direction of the terrain, it can be a vertical cliff, a horizontal plain or the side of a hill.
-Avoid the generic terrain texture go above the texture of the generated terrain
-Layer hierarchy, for example one in which the sky is at the background, the generic terrain is one level up, and the generated terrain is on the top of both layers.

Just to clarify, i refer as generic terrain to the filler between the generated terrain the character is actually going to move on, and the bottom of the screen.
Well, can't you just take the points that you have and extrude them in pairs downwards to the bottom of the screen (pretty trivial, keep x coordinate and set y coordinate to 0), and draw a textured quad with those 4 points? Preferrably with a kind of "earth" texture, or with some brown-blackish Perlin noise.

Well, can't you just take the points that you have and extrude them in pairs downwards to the bottom of the screen (pretty trivial, keep x coordinate and set y coordinate to 0), and draw a textured quad with those 4 points? Preferrably with a kind of "earth" texture, or with some brown-blackish Perlin noise.


Yes, that must be it. I was too bent on making it all a single texture for each section (which has 8 of these pieces). Thanks.

This topic is closed to new replies.

Advertisement