Jump to content
  • Advertisement

Zone generation

thecheeselover

2156 views

Subscribe to our subreddit to get all the updates from the team!

I have integrated the zone separation with my implementation of the Marching Cubes algorithm. Now I have been working on zone generation.

A level is separated in the following way :

  1. Shrink the zone map to exactly fit an integer number of Chunk2Ds, which are of 32² m².
  2. For each Chunk2D, analyse all zones inside its boundaries and determine all possible heights for Chunk3Ds, which are of 32³ m³. Imagine this as a three dimensional array as an hash map : we are trying to figure out all keys for Chunk3Ds for a given Chunk2D.
  3. Create and generate a Chunk3D for each height found.
  4. Execute the Marching Cubes algorithm to assemble the geometry for each Chunk3D.

 

In our game, we want levels to look like and feel like a certain world. The first world we are creating is the savanna. Even though each Chunk3D is generated using 3D noise, I made a noise module to map 3D noises into the 2D to able to apply 2D perturbation to the terrain.

image.thumb.png.dabfc74065279611beab5f09c82c5ebd.png

5a8d9e3977e7f_Jdk-9.0.1Screenshot2018_02.21-11_27_44_36.thumb.png.e546c2bba66ca8e483a2406a92f2fee2.png

 

I also tried some funkier procedural noises : 

5a8da258f37cf_Jdk-9.0.1Screenshot2018_02.21-11_44_58_06.thumb.png.e7131ac55bc1980312779cc7b71187aa.png

An arch!

5a8da263044bf_Jdk-9.0.1Screenshot2018_02.21-11_45_15_28.thumb.png.d3baa9a1a385c9229dd1d8ee246f9783.png

5a8da26e86f17_Jdk-9.0.1Screenshot2018_02.21-11_45_20_30.thumb.png.1b2de9b36b1dac32988d481b1199a3d9.png

5a8da2750c771_Jdk-9.0.1Screenshot2018_02.21-11_45_33_61.thumb.png.b6f3a60564e5f2d8a0cf4c4298148537.png

5a8da27b6f980_Jdk-9.0.1Screenshot2018_02.21-11_45_42_05.thumb.png.6b76ffd7a92919eb31abc605e8757e36.png

 

The important thing with procedural generation, it's to have a certain level of control over it. With the new zone division system, I have achieved a minimum on that path for my game.



1 Comment


Recommended Comments

I don't have much specific to say, but I just wanted to quickly comment that I've been finding these entries interesting, keep up the good work! :)

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
  • Advertisement
  • Blog Entries

  • Similar Content

    • By Nilmani Gautam
      In this video we will learn to select the object an perform action to the object
       
    • By congard
      Hello! When I implemented SSR I encountered the problem of artifacts.
      Screenshots here
      Code:
      #version 330 core uniform sampler2D normalMap; // in world space uniform sampler2D colorMap; uniform sampler2D reflectionStrengthMap; uniform sampler2D positionMap; // in world space uniform mat4 projection, view; uniform vec3 cameraPosition; in vec2 texCoord; layout (location = 0) out vec4 fragColor; void main() { mat4 vp = projection * view; vec3 position = texture(positionMap, texCoord).xyz; vec3 normal = texture(normalMap, texCoord).xyz; vec4 coords; vec3 viewDir = normalize(position - cameraPosition); vec3 reflected = reflect(viewDir, normal); float L = 0.5; vec3 newPos; for (int i = 0; i < 10; i++) { newPos = position + reflected * L; coords = vp * vec4(newPos, 1.0); coords.xy = 0.5 + 0.5 * coords.xy / coords.w; newPos = texture(positionMap, coords.xy).xyz; L = length(position - newPos); } float fresnel = 0.0 + 2.8 * pow(1 + dot(viewDir, normal), 4); L = clamp(L * 0.1, 0, 1); float error = (1 - L); vec3 color = texture(colorMap, coords.xy).xyz; fragColor = mix(texture(colorMap, texCoord), vec4(color, 1.0), texture(reflectionStrengthMap, texCoord).r); } I will be grateful for help!
    • By Feirx
      Current Project
      -Action/Adventure/Puzzle
      -Over the Shoulder/3rd person
      -Steampunk/Medieval aesthetic
      -Co-op (2 Player story line)
      Calling all content creators and programmers of any skill and experience level to join the team. Please be at least 16+ years of age. Artist(s) NEEDED (Unspecific; 3D Models, Concept Art, Animation, Ads, Graphic Design, ...)*
      *Artist(s), We currently do not have any art styles set. We are looking for an original artist to set the art style for our production. This is a big opportunity.

      Feel free to ask questions. I am super excited to get started and meet some new people.

      Comment or message me for Discord server invitation.
    • By Nilmani Gautam
      Welcome every one from this section we are going to develop a new 3D game Cube Race
       
×

Important Information

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

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!