Reflections

The process I used to create the forest game began with watching a whole lot of you tube videos. These are my main source of research whenever I work in unity and always the best place to start. So far no matter what I am looking for in unity I have been able to find a you tube tutorial to walk me though it.

The second step was using what I had seen in you tube to create a testing environment. this was the first environment I have created and while It was not strictly necessary for the assignment I found it extremely useful. During my previous work in unity is was frequently worrying that I would ruin the project, it was much less stressful working on things in the test area and making the assignment environment later. The test island is based on this image from my plan:

new-zealand-mountains

Finally I took everything I had done and researched then created the assignment environment. This way much easier than making the test island as I now know what to do.

While I liked making the testing area, I could have saved a lot of time by going straight to the final design but I don’t think it would be as good if I had done so.

The final product was exactly what I intended it to be when I was writing the task, but I still think it could have been better. The trees don’t really look good next to each other, and the bushes all look the same. They were all free assets and individually good, just not great together.

complaining.PNG

Still on the whole it looks OK and apart from minor issues it all functions perfectly.

Advertisements

Problems

I have only found one problem that I have been unable to fix, sometimes when running and jumping the sun jumps with you and lands at midday. I have absolutely no idea what causes this.

The jump scripting is a unity standard asset and the time is from the time of day system. The two seem to have nothing to do with each other, yet it still happens and I still have no idea what causes it or how to fix it.

Trees, Rocks and Menus

this is the last development blog, the project is done everything in my task plan has been made and functions correctly.

Trees and Rocks

The last of the work on the environment, adding decorations. The final product is the result of every type of tree and rock I used in testing placed throughout the environment.

9.PNG

Menus

There are two menus. The Start menu, which contains the game modes and the Quit menu which has yes or no buttons when the user tries to quit the game.

Start

this menu contains several UI elements, all of which are text boxes, some have button scripts attached

10.PNG

The title text box Forest Walk and instructions are not buttons. Day, Night, Morning, Fast Time start the game witch different settings. Quit opens the quit menu.

Quit

the quit menu is three text boxes placed over a grey and transparent image. Yes and No are buttons.

11.PNG

Yes quits the game, No closes the menu. In the finished game it looks like this:

finished menu.PNG

Scripting the Menus

This script is much longer and more complicated than rotate and find checkpoint. MenuScript contains everything done by the menus, accessing the menus and button clicks in the menus.

variables.PNG

In this part of the code everything im going to be using is made a public variable. This includes both menus, the Canvas objects and the buttons that are placed on them. There are also GameObjects for the player, a camera and the time of day system.

The two float variables will be needed later.

Start.PNG

This is the start method it is called when the script is first enabled, in this case when the game is run. Here the variables are set to get there components so the variables can be used in other methods.

Quit menu is disabled at the start, it should only be seen when quit is clicked. Player is disabled as it would start the game if it was active. A camera is used to display the environment behind the menus.

quit.PNG

 

 

This is what happens when the quit button is clicked. The quit menu is enabled and the other buttons are disables, this prevents the quit menu from being open after the game has started.

no.PNG

No press is the opposite of quit press, it closes the quit menu and enables the start buttons.

time buttons.PNG

These are three of the four start buttons and they are all the same except for the time variable. These methods disable the start menu, activate the player controls and disable the menu camera. the time of day script is accessed through the public variable and set by 24 hour clock, a number between 0 and 24.

this starts the game at a specific time.

fasttime.PNG

Fast Time is similar to the other three game start buttons except it also changes the day length to 60 seconds, resulting in a very fast moving skybox.

exit.PNG

Exit is attached to the yes button and closes the game. That is all the buttons covered but we still need a way to access the menu.

update.PNG

When the escape key is pressed the opposite of game start occurs. The player is disabled and the start menu is displayed through the menu camera.

The Cursor settings allow the mouse to be used while the menu is open.

To get this script working in unity I created a empty object called game manager. This object does nothing but hold scripts that are used elsewhere.

game manager.PNG

The game objects and UI elements I need have been dragged from the hierarchy and dropped into the public variables.

on click.PNG

To set methods to buttons game manager is dragged into the on click commands for a button, then the required method is selected.

The completed game can be downloaded Here.

the link for the games files is Here.

Playing with Fire, Running into Walls, watching Grass Grow and Commanding Time and Space.

Before creating menus and filling out the terrain I want to get all the smaller details complete. If I added trees and rocks first then they might get in the way, so I will add them last and the menus will be added to the complete environment.

Playing with Fire

Unity has a very complex and detailed particle system. There is a lot of settings to change to make realistic fires. Things like the particle colour, rate of particles over time, shape of particle effects, size over time and materials. This is my attempt on the right compared to the unity complex fire standard asset.

fire.PNG

Mine isn’t great, and the standard asset isn’t really all that useful for this project. I went looking for a better campfire in the asset store and found this:

fire asset.PNG

The campfire by David Stenfors, much better than mine:

best fire.PNG

Running into Walls

Its very easy to break my game, because you can walk off the map of into the ocean. To fix this I created invisible walls around the ocean and lake.

These are cubes that I have made into long rectangles, then disabled rendering. They are still blocking the game breaking holes in the environment but are not being displayed.

Watching Grass Grow

This is the same method I used in testing, add the texture to the terrain, then paste it onto the terrain.

I used the same colours and lengths I made in testing.

I made 2 different grass textures, both use the same shape grass1. The lighter coloured grass is slightly longer than the dark but its 2nd colour is less bright than the others. both were place over each other using a low strength brush.

Commanding Time and Space

I added the Time of Day manager to the scene. For this to work I first removed the directional light that imitates sun light, then added the Time of Day object to the hierarchy. There are a lot of settings in this asset, and a lot of scripting. The instructions that came with it is 17 pages long. Most of the setting don’t need to be changed but there are 3 variables that are important, playtime, day length and timeline.

Play time, when active is what turns on time. the length of the day is measured in seconds, in the final version it will be set to 300 seconds or 5 minutes. Timeline is the time of the day in 24 hours, when play time is active this number increases until 24 at a rate determined by length of day, then resets to 0. The number timeline is set to determines the position of the sun and moon.

The download link for the game is Here, the link for the game and its files is Here.

 

 

Forest Path

I have made the terrain for the final submission. This terrain is designed based on what I have learned in during my research, and using the test island.

1.PNG

I also considered that I would need clear paths through the environment as well as realism.

2.PNG

There is a lot of flat space that will be filled with trees and grass, as well as mountains that will help direct the player while providing diversity, if it was all forestĀ  and ocean it would be boring.

3

During the testing I found that the brighter grass textures worked better for area that would have grass added.

4.PNG

I closed the sides of the map so the player wouldn’t walk off the edge of the map, there is an invisible wall at the entrance.

5

I added 6 checkpoint at these locations for the player to find.

To complete the project I need to decorate the environment with trees and rocks, add a skybox with a day/night cycle, place a campfire at the end of the path and add a menu screen. All of these except the menu are things I did on the test island and can do again easily, I have made menus before on other projects and shouldn’t have a problem here.

The download link for the game is Here, the link for the game and its files is Here.

Scripting the Checkpoints

The path through the environment will be marked by checkpoints. These will rotate and change colour when the player has walked up to them. They will stand out from the environment and stop the player from getting turned around.

The checkpoint itself is simple, made from a cylinder with a cube floating above it.

13.PNG

I might make a more detailed checkpoint later, but for now this is fine. The cube has a red material place on it. It will change to green when approached.

To detect when the player gets close to the checkpoint I added a larger cube over the checkpoint.

14.PNG

This cube has had rendering disabled making it invisible. I also enabled triggers for this cube as it will need to detect collisions.

The collision detection script looks like this:

15.PNG

This script is attached to the invisible cube. I have gone to the first person controller and added the player tag. When a object with the player tag collides with this game object it is disabled. The player will be able to walk through the invisible cube and disable it. the next script looks like this:

16.PNG

This script is attached to the floating cube. It has 2 variables a Boolean set to false called found and a public GameObject called checkpoint. As checkpoint is public and a game object its value can be set in unity3D to the invisible cube. Every frame the script looks to see if checkpoint is enabled, if it is enabled then found remains false, if it cannot find checkpoint then found is true. When found is true the object the script is attached to rotates and its colour is set to green.

So walking close to the checkpoint turns it green and it rotates.

There are other ways to do this. other methods I considered where changing the find checkpoint script to set found to true on collision but I decided that the simplest way was probibly the best and using activeInHierarchy was much less complicated. Setting the variable for anther script would require finding the game object it is attached to then altering the script, which can be done but I am making several identical checkpoints which makes finding the specific object unnecessarily complicated.

The download link for the game is Here, the link for the game and its files is Here.

Adding Grass, Trees and Rocks

I have the terrain made, I painted textures onto the terrain and added water to it. Now I found assets to decorate it. First I added a path to the terrain so the users can see where they are going, Then I added grass around the path.

8.PNG

The grass was created by getting the grass texture from Nature Starter Kit 2 and adding it to the terrain editor then painting it onto the terrain. After the grass I added trees, also from Nature Starter Kit 2. Some of the trees and bushes where painted on but most where placed individually.

9

Next I placed the rocks from Boulders 2, these where placed individually.

10.PNG

Now it looks like a relatively realistic environment. From the game view it looks like this

11.PNG

Once the skybox is working I will make a bigger environment using all these assets and techniques, then add the guideposts and the scripting for movement and colour changes. I added a campfire to this scene using unity particle standard assets.

12.PNG

The download link for the game is Here, the link for the game and its files is Here.

Finding New Assets

I need a lot of new things to create a convincing environment. Mostly things like trees and rocks to decorate it as well as new textures to make the ground look more realistic. To get these assets I went to the asset store and searched for free assets, as well as YouTube for examples with these assets.

The Trees and grass asset package I found is called Nature Starter Kit 2 by an asset development team called Shapes. I’m using this for the trees and bushes, there are also ground textures that I’m going to be using under grass.

Nature starter kit.PNG

The rocks I will be using came from Rocks and Boulders 2 by Manufactura K4. This contains a number of rocks in several sizes and shapes which I will be using to add more decorations to my environment and make it more realistic.

rocks.PNG

The next asset is a skybox system that changes over time. This will replace the unity default skybox and meet one of the criteria that I set in my task plan for a scripted change in texture. It is called Time of Day System Free by A.C, an indie developer. This creates a day/night cycle with lighting effects.

time of day.PNG

This should be everything I need, and when I finish testing these assets I will make my planned terrain with a walking path and guide markers.

Creating an Island

I wanted to tests the terrain system and the things I have seen in the videos I researched, to do this I made an island using the terrain tools and unity standard assets. I started by shaping the terrain using the raise terrain tool and then added a grass texture to it. After that I added a rock texture to some of the mountains to see what it would look like.

1

Obviously this looks crap. You can barely see anything and what you can see looks very fake. I smoothed out the mountains, making them more natural looking. The grass texture was the wrong choice as I am trying to create an island, I painted over this with sand where the ocean would be. Then I painted grass onto the flat parts of the island. Finally I used a wet rock texture on the lowest part of the island.

2

This looks much better, not great but more realistic than it was before. It needs some changes before it is ready, Final touches with the textures and the terrain.

4

Now its ready for water to be added.

5

The final version of the test island from the game view looks like this.

7

Testing the tools out as well as the standard assets helped me a lot, I can see what I need to do now for the final product, as well as the assets I will need. I am now fairly confidant I can mare something natural looking by the end of this project. The textures in standard assess are not very good up close and don’t include trees or rocks, I will also need to find skybox textures. The water looks fine but there may be something better.

After I find more assets and build the terrain I will move onto the scripting and create the guide posts.

The download link for the game is Here, the link for the game and its files is Here.

Create a free website or blog at WordPress.com.

Up ↑