Jump to content

  • Log In with Google      Sign In   
  • Create Account


Ways to fill space underneath the terrain


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
4 replies to this topic

#1 Lama43   Members   -  Reputation: 136

Like
0Likes
Like

Posted 13 October 2012 - 04:26 AM

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.

Sponsor:

#2 GeneralQuery   Crossbones+   -  Reputation: 1263

Like
0Likes
Like

Posted 13 October 2012 - 08:18 AM

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?

#3 Lama43   Members   -  Reputation: 136

Like
0Likes
Like

Posted 13 October 2012 - 09:32 AM

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.

#4 samoth   Crossbones+   -  Reputation: 4656

Like
1Likes
Like

Posted 13 October 2012 - 12:08 PM

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.

#5 Lama43   Members   -  Reputation: 136

Like
0Likes
Like

Posted 14 October 2012 - 11:50 AM

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.




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS