Chapter 3. World Building

In this chapter, we'll go through some of the fundamentals behind generating a code-based world and its lighting before we go beyond the basics and discuss more advanced techniques.

This chapter contains the following recipes:

  • Using noise to generate a terrain
  • Lighting your world and providing it with dynamic lights
  • Deforming a terrain in real time
  • Automating trees' distribution
  • Endless worlds and infinite space
  • Flowing water with cellular automata
  • The essentials of a cube-based world

Introduction

In Chapter 1, SDK Game Development Hub, we used Terrain Editor to manually create a heightmap and Scene Composer to put things together into scenes. Those were the two ways of creating worlds in jMonkeyEngine. In this chapter, we'll look into creating worlds using code or procedural generation. This can often be very quickly set up, but getting it right (and performant) can be tricky. To achieve this, we will make use of techniques such as custom meshes and batching. Batching is a method of taking several geometries using the same Material instance and creating one mesh out of all their meshes. This can significantly improve the performance of the application.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.189.178.53