Our brief for this submission is to create a basic design and grey box for the opening sequence of a first person game. We are to work as a designer in a games studio during the pre-production phase. The sequence must be scripted using the Unity games engine.
The level must have 3 triggered events, music and sound effects and at least two minutes of game play. It cannot go over 3 minutes, have artificial intelligence or realistically textured meshes. The support material must include a one sheet, a story board, a map of the level and any models that have been created as part of the process.
Here is my one sheet. I made it with the idea of a full game in mind.
I was quite undecided about the name for a while but decided to go with the most defining part of the game; the pillar of light that the player must get to during the opening sequence. Once they get there, they are to make a choice between offence and defence. In the final version of the game, I changed these options to "weapons" and "items." What would happen next is that the game will treat the player differently based on which choice they made and different opportunities would be presented to them. Some scenarios would be identical but the options your character is given to deal with these situations would be different and ultimately lead to a different experience.
I then made a map of the level as well as the storyboards.
There are quite a few triggered events. The first is the tree falling. The next is the broken bridge area which triggers some dialogue from the character. The planks also have their own trigger boxes attached to them so that they change colour and are interactable when the player is near. There is a trigger box at the end of the path way for some more dialogue. Finally, there is a trigger box surrounding the light that triggers a dialogue box to pop up and stops the player from being able to move, allowing only for input on the dialogue box. Once a choice is made, the light gets so bright that it blinds the player and completely washes out the scene, ending the level.
Here is my progress.
I started by making a plane in Maya but after exporting it into Unity, I decided a terrain would be better because I needed a lot of trees to make a forest. I also found the terrain tools to be convenient when making raised and smoothed areas.
This came with its own set of problems though; the FPS controller from the standard assets was out of scale with the terrain and I had not realised that I would not be able to resize the terrain after I had already moulded it into what I wanted. Instead of redoing the whole thing, as this would have been too time consuming, I decided to play around with the settings of the FPS controller first to see if I could fix it. Just making the walk speed faster made the movements too unrealistic; the head bop was too fast and the footstep sounds were too slow. However, I found that by making the walk speed match the step interval, as well as doubling the new walk speed to make the new run speed, all the movements were much more realistic and the FPS controller moves around the level at a believable pace. I also checked the Smooth box to make the camera movements follow the mouse a little bit slower than without it. It is important that my game immerse the player as much as possible and I felt that the smoother movements added to the atmosphere.
Here is what I ended up with.
I wanted to restrict the player's movements in the very beginning of the game to help set the story. I did not want the player to just charge into the game without understanding the context and hearing the clues on where to go and what to do. I had no previous knowledge or reference point for this, but I thought that it must have something to do with the character controller. If I could disable the character controller completely, that would allow the camera (the "head") to still be active whilst otherwise restraining the players movements. I went into the FPS controller script and had the character controller set to false. Then I added a coroutine to make the script wait a set amount of time before allowing the character controller to be true. The amount of time was determined from how long the dialogue lasted for, which I set up in a separate script. I also used the StartCoroutine function for this and other bits of dialogue throughout the game. I like this part of the game because it lets the player look around and take in the area whilst the story is being set.
I animated a tree falling in the beginning in Unity. I found it quite difficult at first to get the timing right, originally having it last for one second, but then I added a tree falling sound onto it. I changed the timing so that it moved with the length of the sound clip and now it feels more realistic. I created the trees through Unity's built in tree editor. Originally I only used one type of tree, but later added a second one to try and make the forest look more like a real one, where the trees are not all identical.
I struggled with having the tree falling sound clip play at the same time as the voice over. The game object only had one audio source on it, so I tried to put two instead so that the different clips could be taken from different sources. Unfortunately, this didn't work either. I wanted to keep as much of the coding in one script as possible, but in this situation I found it easier to create two new empty game objects on the parent animation trigger and add two separate scripts to them; one for the tree crashing sound and one for the voice over. This worked a lot better because each object had its own audio source on it.
The "keys" and the broken bridge were the hardest parts for me to code. Because my level is set outside, instead of having a key open a door like we learnt in class, I decided to have a broken bridge that needs to be fixed before the player can cross. I wanted to push myself so I made two "keys", which are actually planks.
I had 6 planks in total; two were the missing planks, two are already placed at the bridge, and the last two are deactivated, waiting to be reactivated and used. I decided it would be easier to have these last two planks act as the missing planks so that I could position and animate them along with the other two that are already placed there. This part was tricky because I needed both missing planks to only act as a half way point between fully opening up the blocked pathway. If the player approaches the bridge with one plank, only one plank will be placed and they will be prompted to go and get the other one. If the player approaches with both planks, then they will see both being placed at the same time. However, I kept having the issue of either plank triggering both animations to take place and fix the bridge. I realised that this was happening because I was using only one script for both of them and that I would need to make separate specific ones so that they could act independently of each other.
I also struggled with the voice overs that are triggered when interacting with the planks. I had two audio clips; "This should work... I might need another one though." and "Perfect." I wanted the first clip to work when collecting either plank as long as it was the first one that had been clicked on. Likewise, I wanted the second clip to be played when the player picked up their second plank. I found that using public static bools "gotPlank1 = false" and "gotPlank2 = false" in my globals script helped make them specific. After that, it worked fine.
There is a bit of a lag in terms of pacing as the player makes their way to the light after the bridge has been fixed. Originally, I had placed a trigger box about half way down the path which would trigger a growl audio clip, followed by the character reacting to it. After this, I had planned for the run speed to increase as if she were sprinting. Unfortunately, I could not get the speed to increase through code and also could not get a suitable sounding growl. This is now a very boring part of the game and I regret not being able to come up with an interesting, effective solution.
I added some planes in to give the appearance of water. I used multiple planes and sorted them all as children of an empty parent game object. I added an audio source to this and attached a one minute long audio clip of a stream, making it loop so that it would last as long as the level. The loop is quite seamless. I changed the spacial blend to "1" to make the sound 3D then set the volume rolloff to "Logarithmic Rolloff" so that the further away the player is to the water, the harder it is to hear it. As the water is always on the right of the player if they follow the path directly, I moved the stereo pan slider to the right, to "0.53". This was to help with the atmosphere and immersion.
I chose not to have any music in the level because I felt that the forest sounds in the background and the voice over were enough to contribute to the kind of eery atmosphere I wanted. Music would have taken away from the feeling of being alone in a dark woods.
The voice overs themselves were recorded by me and voiced by Harriet Cheshire, my housemate who is a 2nd year Illustration student at UCA. I used a recorder that I borrowed from the university. The quality of the sound is not very good, so if I used voice acting again in a game whilst here at UCA, I will definitely try and see if there is an option for better sound equipment. I felt that having the character talk would add more to the story and atmosphere. My weakness is coming up with fun and interesting gameplay, so I focused on my strength; creating and telling stories. I originally wanted to add subtitles for all the voice overs, however I found this difficult to execute after the first bit of dialogue and in the end decided that it is more effective without the subtitles. The player can immerse themselves easier if they do not have to bother with reading as well as listening and looking around.
I did not model anything in Maya specifically for the game because 3D modelling is another one of my weaknesses and I did not want to complicate the process of making this game any further. I really wanted to focus on the coding, gameplay and aesthetics. To make the bridge, I used cubes created in Unity. However, I did use some rocks that I had created for my 3D Art Production class. I added them to try and make the scene look more like a forest.
Finally, I created the menu at the end of the level by using several panels and buttons. Using an image, I stretched this to fit the canvas then set its transparency to 0. Then I used the animator to create the flash that we see when the player presses a button by manipulating the transparency. I created a script so that I could access this through the built in OnClick function on the buttons in the inspector. This part was very tricky but after some searching online, I found that I needed to make a new public function that would contain my animation play command, and only then I could access it through the inspector. I did the same thing with the text that appears at the end; I had its transparency set to 0 for 2 minutes and 30 seconds (the length of time the flash takes to turn the screen completely white) before it then begins to fade in. I also put the gasp audio clip into the PlayAnimation public function I created so that it would run at the same time as the two animations through one function.
The trigger for the menu did not work when the game was turned into an .exe file. It worked perfectly within Unity, but for some reason it did not work in the .exe. Fortunately, I found out that it had something to do with the rigid bodies. The trigger did not have one so that the player could walk through it. What I did instead was delete this trigger box, add a capsule collider to the light, which is actually a cylinder, and add the relevant scripts onto the light. At the time of writing, this seems to have fixed the problem.
Creating this level showed me that there is a lot of trial and error in scripting a game as a beginner. At first, it was difficult as I did not know what I was doing and I mostly used the things we had been taught in class as a close reference. However, as I created more and more scripts, a lot of the basics started to come naturally to me and I am more confident now. I found more creative ways to solve the problems I came up against, but when I could not figure it out I would refer to the Unity forums and tutorials. I feel that this level was a success and am very pleased with the result, although I feel that my idea was too big for a first game and as a result, it feels incomplete. As said before, the game is lacking in areas in terms of gameplay. For my next personal game project, I will try to explore more games to see what kinds of design I could implement into my own games. I will also manage my time better next time and make sure that I meet the milestones set by the tutor.
No comments:
Post a Comment