Building atmosphere

Now, the base of our world has been created; let's add some effects to make the game even more visually appealing and start to fit in with the survival horror feel that we're going to be giving the game.

In Unity 5, we are given a default skybox for 3D projects, but it's only for a bright sunny day, which is not ideal for a horror game. To fix this, we will be using a skybox. A skybox is a method to create backgrounds to make the area seems bigger than it really is. This is done by putting an image in the areas that are currently being filled with the light blue color, not moving in the same way that the sky doesn't move to us because it's so far away.

The reason why we call a skybox a skybox is because it is made up of six textures that will be the inside of the box (one for each side of a cube). Game engines such as Unreal have skydomes, which are the same thing; just that they are done with a hemisphere instead of a cube. We will perform the following steps to build the atmosphere for our horror title:

  1. To add in our skybox, we are going to first go to our Example Code folder and open up the Art AssetsSkybox folder for this chapter. From there you'll see a number of images. Drag this folder into your project (the files will need to be unzipped for this to work).
  2. Next, from the Project tab click on Create | Material and give it a name of Nightsky. Select the newly created material and from the Inspector tab under Shader, change the property to Skybox | 6 Sided. Next, fill in each of the 6 images in the Inspector with the appropriate image from our Skybox folder. When you're finished, it should look like this:
    Building atmosphere
  3. With this file imported, we need to navigate to Window | Lighting next. Once there, confirm you are in the Scene part and then set the Skybox option to the Nightsky skybox:
    Building atmosphere

    If you go into the game, you'll note the level starting to look nicer already with the addition of the skybox, except for the fact that the sky says night while the world says it's daytime. Let's fix that now.

  4. Switch to the Game tab so that you can see the changes we'll be making next. While still at the RenderSettings menu, let's turn on the Fog property by clicking on the checkbox with its name and changing the Fog Color value to a black color. You should note that the surroundings are already turning very dark. Play around with the Fog Density value until you're comfortable with how much the player can see ahead of them; I used 0.005.

    Fog obscures far away objects, which adds to the atmosphere and saves the rendering power. The denser the fog, the more the game will feel like a horror game. The first game of the Silent Hill franchise used fog to make the game run at an acceptable frame rate due to a large 3D environment it had on early PlayStation hardware. Due to how well it spooked players, it continued to be used in later games even though they could render larger areas with the current technology.

    Building atmosphere

    Let's add some lighting tweaks to make the environment the player is walking in seem more like night.

  5. Go into the DirectionalLight properties section and change the Intensity value to 0.05. You'll see the value get darker, as shown in the following screenshot:

    Note

    If for some reason, you'd like to make the world pitch black, you'll need to modify the Ambient Light property to black inside the RenderSettings section. By default, it is dark gray, which will show up even if there are no lights placed in the world.

    Building atmosphere

Note

In the preceding example, I increased the Intensity value to make it easier to see the world to make it easier for readers to follow, but in your project, you probably don't want the player to see so far out with such clarity.

With this, we now have a believable exterior area at night that will fit quite well for our horror game!

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

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