I then moved onto the more complex side of the environment creation and began creating the collectibles ready for the scripting that will need to be added to my entire level and some aspects of the entire game. I began by creating the collectibles though and modeled out the eucalyptus leaves, the extra life token and the energy drink model that is going to be in the different levels, along with the relic that is going to be the collectible for my individual level.
At this stage I began by modelling the relic that appears at the end of my level, this is what you need to be able to access the next level in the game. The relics are then stored in the basement part of the hub world. This was a fairly easy shape to model out, and I used the designs that I had previously created to generate the shape of the relic.
I then modeled the energy drink which is going to be Keith's power up in the game, this allows him to get around the level more easily, and if he gets hit whilst holding one he doesn't loose a life, once he has collected three, he has a brief moment of invisibility.
I then modeled the extra life token, originally I had wanted this to be a circular disc with Keith on it, but thought it looked a little too clunky and choose to model out the shape instead, making it a silhouette of Keith instead, the only concern is that he is looking a bit too Micky Mouse here.
I then modeled the eucalyptus leaves, which I really liked the look of in the end. They were a bit annoying to get the shape right but I think this turned out really nice in the end and will definitely stand out in the levels, especially mine as it is all gold and blue.
I then moved onto UV mapping them, again a simple enough process that I got done fairly quickly as most of them were flat discs, so I could simply take a map from the front and then from the back and they turned out really easily to then draw from.
I then finally textured them and overall I think they look brilliant. They are really bright and colourful and stand out against everything else that I've made. The colours used are bold and stand out, and the style is consistent with the rest of the game, making them feel like they belong.
Adding Animation to my Environment
I then moved onto adding in the animations onto my own level, Egypt. This included adding in the necessary scripts to get the spike traps moving up and down in the correct manner along with getting the blades swinging and the correct doors to open once the lever is pulled using an action button. This seemed quite complex to begin with but as I moved through it began more apparent that there wasn't as much scripting as I initially thought there would be.
I began by sorting out my level further. I had previously had a problem with the lights slowing down the running of the game, but this was fixed by changing some of the player settings to show all of the lights. This didn't slow the game down at all which I was very happy with. I then also played around with the shadow setting and anti aliasing to ensure that the lines where not too janky, this again didn't slow the frame rate down.
I then moved onto changing some of the textures slightly that where in the pits to make them darker so that it felt like it went down a long way. This made the level seem a bit darker and gave it a more enclosed feeling. You can see the shadows more around the bottom of columns and Keith himself - this gives off a really nice effect and the level is really starting to look nice.
I then also thought about what would be at the bottom of the pits in the larger room, with nothing there they look a little bit bland so I added in a large body of water into the last one and made it quite high up, giving it the appearance of there being a flooded area down there as well, and giving a bit of diversity away from the gold of the stone. I choose in the end to go with this murky greeny-blue, then gave it a yellow reflection so it looked like the lights where reflecting off it.
I then moved onto actually animating my level, ensuring that the necessary animations where in the correct places. I started with the spike traps which was quite difficult to wrap my head around how I would get it to animate successfully, but thankfully my tutor Annabeth helped me to create a script that moved the spike up and down over time and continued that animation throughout all of the game play. This worked really well and the script is shown below at the right hand side.
I then created the script to animate the swinging blade, which was similar to animating the spike traps, just moving the rotational values instead of the translate ones. In this case all of them could be animated at the same time, the same as the spike traps where, due to the way that I have imported them in. I imported them separately just so they could be moved later on, but they are all grouped into a Game Empty and can be moved together.
I then moved onto animating the beetles to move once the player gets into the collider near them. I wanted to bring in this small element of movement into the environment as otherwise this corridor is very static. Although I do have movement throughout the environment there where still bits that just needed to be added to bring the environment to life further and these beetles was definitely a good idea as it was something that could be added in quickly, but creates a really nice effect overall.
I did have a little bit of trouble getting this to work in Unity originally so I went back into Maya and animated here before taking it back into Unity with a legacy animation. I then set up a collider and wrote out a small bit of script so that when the character enters the box the animations plays once and then stays there forever.
I then lastly animated the falling platforms that I have in my level, this was a fairly easy task as I had previously done this before in a exercise for the last project. I followed the notes that I had made on creating this and applied the script and the animation onto my falling platforms in the level.
I got the falling platforms working really easily and then simple animated the rest of them and applied the same script onto all of them to get them all to act the same way, resulting in a really nice simple animation.
Placing the Collectibles on my Level
I then moved onto placing the collectibles into the correct place in my level. This was really fun to get them all in the right place and I also ensured that they were the right size at this stage so that I could add the collection script on after.
I firstly added in the Relic, I wanted to make it look really mysterious and give off a blue glow to ensure that it looks like it is meant to be picked up as there is nothing else like it on the level. I think this looked really good and makes it stand out so much against the gold throughout the rest of the level.
I then added in the portal, this features at the beginning and the end of the level and when the pattern is in the middle this means the player can use it, when there is no pattern it can't be used and is simply an archway.
I then placed the extra life in the sixth room in the level. This is a room that also has one of the last leaves in as well and is only opened once the last lever is pulled, requiring the player to backtrack to it to find the last little bit to get 100%. I again added a light onto it, this time a more orangy one just to give it a bit of life and I think it looks really nice overall.
I then added in the energy drinks and place them in the correct locations, according to my designs and ensured that they were the correct size. I placed them on a slight angle to give them a bit more of a dynamic look and ensured that they looked right.
I then added lights to them just to give them a slightly purple glow as if they are a bit magical. This light will then disappear when the player picks up the energy.
Lastly I added in the leaves, these act purely as the collectible in the levels and there are 20 in total. Again like my energy drinks I followed my original design to see where the best place for the leaves should be.
Adding the Scripts and Other Details
I then looked at adding in the final details to my level and added in the extra scripts that allow the game to be fully played. The first one that I added was the destroy script so that when a collectible is picked up it is destroyed. This was helpful to add on to begin with before adding other details, because then at least I can test that it works and the object is being successfully destroyed. The script is shown below and the screenshots show that because it is applied to the energy drink, once Keith walks through it, it disappears.
I then moved onto creating the script that allows a door to open once a lever is pulled. This was a little tricky to get my head around as I had to first create a script that meant that when a certain key is pressed the lever then animates, then the door opens. But I was getting the hang of scripting and with some help from the internet I was able to successfully make this happen.
I found a script that just needed a little bit of editing and I had to add in the extra animations for the doors to be able to animate at the same time and it was really simple to get my head around. I was finding it difficult to animate in Unity so opened it back in Maya and then animated both the lever and all of the doors separately before linking them together with the script, and tested it. It worked really well and I am very happy with how it looks.
I then began working on a death and re-spawn script. I had previously created one of these before but this was in first year so I did need a refresher on how to make one and make it work. I looked at a few online tutorials to be able to see the best way of setting up the script and found the best way to do it.
I found a really good one online that showed how to create checkpoints that then became the spawn point once you hit the respawn trigger. This worked well but I have a lot of pits in my level and I wasn't sure if I needed a respawn and checkpoint on each hole or whether I could drag it out over a number of different ones.
I then went around my entire level working out where the respawn points need to be laid out and also where the spawn points/check points would be so that they could be brought back at specific points. I tried to not clutter the level too much with these as I didn't want them game to have too many, otherwise there would be no challenge.
I then moved onto doing the respawn points for the traps, which was fairy easy to apply as the animation had already been added, the points just needed adding in, which I did by working my way through and just assigning it to the nearest checkpoint.
At this stage Sophie had made the texture to go inside the portal, so I took the time to put it into my level and used a nice bright purple light on it as well to make it glow. We couldn't get texture to animate due to the portals all being different sizes but the final look to it is really nice anyway.
I then set up a script for when Keith picks up the relic, at this point we do want an animation/cut scene of him picking up the relic and holding it out in front, but this depends on how much time we have later on as to whether or not we will get this done. But after the animations plays picking up the relic has to trigger the animation of a door opening as well so that you can leave to the final corridor and go through the portal.
I got this to work relatively quickly after animating the lever and the doors, and when Keith touches the relic it triggers the door animating in the next room, and then disappears as well.
Lastly I then created a script that takes you from the portal to the next part of the game, in this we hope again that it will be an animated cut scene but this is providing that we get everything done and are able to produce them in time. Even if we do not have cutscenes this is a script that will load the next level so I just used the one that I had previously created from my last project. For now the script loads to the 'hub world' which will be created late on.
Testing the Collection Script
We then set up a collection script for the game, to be able to collect the leaves that we had added in. Sophie was in meant to be doing this but was having a bit of trouble getting one to work. Therefore I helped and found one on the internet that I adapted to suit our game. This was the basic script added but we still had to get a GUI interface on it, which Sophie did manage to do, but not working correctly with my script which is what we need to look at next.
I then took a quick video walk through of the level with all of the necessary scripts in the correct place to show how they work when the character gets close and how then they activate. For this stage I used a very early version of Keith for the purpose of the video as I haven't finalised the animations yet. For this video we didn't have the interface working but it shows that when collecting the leaves, the counter in the very top left corner does count it, it is still just waiting for the final UI details.
No comments:
Post a Comment