PRODUCTION - WEEK FIVE
Monday 1th - Sunday 7th of April
Monday 1th - Sunday 7th of April
For Week Five, I have two main aims. As I have to wait till the multiplayer is done before I add the mechanics, I will work on the basics of shooting in a new project. I also aim to make a concept for the menu in unity to show the style we will go for.
For the shooter mechanics, I aim to get the basic foundation of the shooting done. I am making a slight change from the time planner as instead of spending the entire week on the mechanics, I will spend some time on other features. I am doing this to avoid adding the multiplayer features, as some shooting requires them. For the shooting, I aim to get at the shooting function working and, if it goes smoothly, I will add the reloading.
When it comes to the menu, I aim to create the basic layouts for the menus I outlined in my planning. I will use the base of research I made using my mood boards as a reference. I will make the main menu and the settings menu, finishing off with the modes menu. After I create them, I will show my team and gather feedback.
To start with making the shooting mechanics, I had to create a basic level to add the shooting mechanics. For this, I created a new level in the Unity Hub using the basic 3D scene. This is because the game will be 3D, so using a 3D scene only makes sense. To turn this scene into a scene able to be lit properly when we move on to the actual game, I will add the universal RP. This will ensure any effects made will work in the final game.
Next, I will begin making the gun that will shoot for now this will just be a display feature and not affect the mechanics. I just added a cube for this into the scene to have a point for fire.
Item & Gun Script:
All the shooting code will be comprised of scripts from both series I outlined in my research. I will be using parts from both while making the shooting following along with the outlined flowchart. First, as I outlined I will add a scriptable object class for the items. This will be used for all in-game items including guns, throwables, and knives. To this script, I add a public string for the name of the object. This will help keep them sorted and have all the guns easy to separate. As I scale up the mechanics this may increase in features. Then after I create this script I create one for the guns forking from the item class scriptable object. I add a title header using the create menu code. Then lastly I go back into Unity and begin creating folders to add my weapons into it.Â
Using these I add the guns in using the new scriptable object adding one for each gun in the game. Like I said before this will be the method for the other weapons too. For the naming convention to keep it organized, I put the type of weapon as the object name then on the scriptable name option I put the model/make of the gun. All of this can be seen in video one.
Creating Gun Objects:
Next for the gun system, I will move on to adding the guns and the scripts to control them. First I will create an item script which will control the information of the item. I create a script and add a variable for the item class. This will take in the items I made last time, which I will drag into the area. Then to this script, I add a game object variable which will take in the object for the guns, including the parent and gun model.
Now that I have created the script, I will begin making the item hierarchy. I add an empty parent to hold the items. Every time a player picks an item, it goes into this parent. To this parent, for now, I add two empty game objects for the guns. I added the gun model which for now are cubes which I will switch for the actual models. Now I have done this, I can move on to the player controller script, which will handle a set amount of the gun code.
To begin on the player controller, I have to add the variables to the script. The first variable I added is the item array variable, this will hold all the current items the player has picked up. When I expand, this is the array all items will be put into once the player has picked them up. Next, I add the item index int and the previous index int which will control the current held item and the item held before. These will be used in the script to determine what gun to either switch to or pick up. For the previous index, I set it to -1 as the game will start with no previously selected item.
Next, for the player controller script, I wanted to work on the equip function. This will be used at the start to equip the first weapons, and it will be used when the player switches weapons. First, in the equip function, I set the index to the index int on the function. This allows me to, anytime I call the function, set the index to a specified int I chose at the time. An example of this is in the start function, where I will later set the equipped item to int 0 to select the first item in the list. Next, I set the object in the item array equal to the index to active. This will activate the selected object specified in the int I set. Next in this code, I need to add the code that checks for the previous weapon. Here I check if the previous int is not set to the default of -1, if so, I set the previous item to false. This ensures that the previous item is set to false when the code needs the item to be loaded. Lastly, for this function, I set the current index to the previous item index. This allows the script to constantly update the previous index with the last gun held.
Lastly, for this script, I wanted to add the photon code. While at the moment this will not work, it allows me to have less work when implementing it into the base game. For now will be able to comment this out so it does not affect the code, allowing me to remove this when the time codes. To start, I added the reference for the photon view, which the script will call upon. Then I add a reference to it using the get component in the awake function, allowing the script to find the local photon view. Now to start, I check if the photon view is that of the main games' player, if so, I equip the first ite. This makes sure that it does not equip all player guns, causing multiple issues. Lastly, to check the code, I added the equip function into the start method, which I can remove once implemented into the vase project. Throughout writing this part of the code, I left some comments, so I can remember what the multiplayer code does and what to change when I move on to the actual project.
In the end, I had set the entire object to inactive, which I later fixed by only setting the game object to inactive. An example of the pistol being loaded can be seen in video two. This video also includes all the code I made.
Adding First Guns:
Next, as my team member Kyle sent me the first of his guns, I decided I would work on adding the mint to the game. This will help with two things, as I get to test if the model works and I can see if the materials will work in unity. I imported his meshes and textures beforehand, and I created a material for the textures. To begin creating them I add the base map using the coloured map. Then I add the metallic and ambient map. Lastly, add the normal map remembering to change its texture type to a normal map. I added these to the 3D models and they worked perfectly. This was unfortunately the last thing I could get done this week as I had the entire issue with re-designing the menu after my team made their critiques.Â
Video One!
Video Two!
Video Three!
Next for this week, I want to move on to making the menu. I will start by adding scenes to the unity level I made last time for the shooting mechanics. The main menu and settings will be in the same scene as each other, so the buttons can rely on the same scripts. This will make it easier to keep systems like transitions smooth. There will be a separate screen for the mode selection where the lobby choices will be made.
First I had to decide on a look for the main menu. Using my research, I wanted to keep the UI simple but memorable. For this, I want to use images of the level that cycle through, so the menu stays fresh. For this example, I am going to use renders of the map blackout images which can be seen below.
For the code to get this working, I first had to get a list of the images, so the code could switch between each image. I also get an int for the amount of time between each cycle, which will control the speed. There are some game objects for the images chosen and the last images chosen to ensure no image is repeated. In the start function, I make sure the reset bool is true so the code cycles first. I then added the find object function so it can find the images.
Next in the update function, I check if the images have been found and picked, then begin the cycle function. This will handle the cycles, making sure to cycle every time the reset is called. For the cycle code itself, it checks if the reset is called and then begins the do cycle. This code decides a random image using a random int generated using unity engine random. This only runs when the previous choice is the same as the current one, to avoid the image repeating. Then to switch the images it uses each loop to set all the non-chosen images' active status to false, and activates the selected image.
The reset function is called whenever the script should reset, which is after the image is selected on a timer using the int set above. Down below is the code of this work. I added some buttons to the menu, but all the code other than the scene switching is handled by the menu manager. All the hovering and pressing animations are handled by the Unity built-in animations.
The next script is handling the scene mechanics that go from scene to scene. These are in two ways, one that loads a scene based on a string and the other transitions to a new menu based on a switch. This script also will handle all the main menu mechanics like volume and sensitivity. I will handle most of the scripts, but Mitchell will handle some parts.
First on the menu controller script, it starts with setting all the basic variables. First, it has the animator for the transition for each scene move. Then there is the volume and its text, which will be used for the game's volume change. Then there are the game objects for the panel and it's switching bool. Lastly, there is the code that handles the switching of sensitivity, but it is not fully implemented. For the start, it sets the volume using the function and sets the text for the other code using the update text function.
For the load seen function, it starts by taking a string which is the scene to load. The script starts by playing the animation for the transition, then starts the coroutine for the panel transition. That function also takes in a string, which will be the one from the main function. It starts with waiting for half a second, then loads the scene. After it has loaded the scene, it plays the animation for the transitions, completing the scene completion.
The change panel function starts by playing the transition animation, and then starting the panel switching coroutine. That function starts waiting half a second, and then checking if it should switch the order. The switch changes depending on if the button is pressed. This is handled as if the switch bool is not true then it sets the switch to true and switches the scene, then if pressed again it will be true. Now that it is true, it will change the game objects back to the original order, switching back to the menu. This allows the button to switch between two active states depending on if the buttons have been pressed. After all this, it starts the move-right animation for the transitions.
The full-screen function simply toggles the full-screen by setting full-screen to not full-screen using the built-in Unity switch, the exclamation mark. For the volume code, it adds ten to the current volume each time, and then it checks if the volume is one hundred. If it is, the script sets it back to zero so it can cycle again. Lastly, it sets the volume using the set volume function and the current volume. The set volume function sets the audio listener's volume to the volume int divided by one hundred. After this, it sets the volume text to the volume turned to a string to the nearest zero. Lastly, there is the cycle text for the sensitivity, this does not change anything yet but cycles the text.
Settings & Modes Visuals:
For the visuals of the settings, I kept it simple using the buttons and built-in unity animations. With this, I could further expand on the animation and improve the menu. I did the same for the modes adding animation on button hover. I could use this method further as well but it is an improvement over the settings menu visuals.
Team - Contributions
For the menu, I wanted to bring my team into the conversation. I start by sending in the current menu into the team chat. After I sent it into the chat, it ended up getting no traffic from the first video I sent. I look at this as them not seeing the message rather than them validating the process, so I will wait for further messages. After more work, I sent in an image of the mode select menu to gather the team's thoughts on it. The team seemed happy with the menus so far, but there were not many messages still. Alex sent two saying he was happy with the look of the menu.
After I added the settings menu, I asked the team for suggestions for the features they expected to see on this menu. I sent an image along with this question to gather feedback on the look of the main menu. Mainly the only suggestion was the sensitivity options, but Mitchell suggested he make it, which I am fine with. Kyle critiqued the layout, so I set out to work on this. He did not mention the above work, so I feel it is valid so far. First, the big change was a recommended change to the UI text colour. Mitchell proposed I change it to white. I had changed this before, and it did not work, but with the newer colours, it works better now. This also aligns better with the original plans.
The next suggestion came from Kyle, as he did not like the level behind the settings menu. To fix this, I took their suggestions to blur the backgrounds, which they seemed happy with. I asked if they wanted the main menu to be clear or blurred, and Kyle seemed to prefer clear, as do I. After some time, once I created all the menus, I got a message asking if I could change the menu design. At first, I did not want to do this as it would take a lot of time to switch and create new backgrounds. After Alex suggested this, Kyle also came out saying that he did not like having the level in the background at all and would prefer a design similar to what Alec was proposing. While I was not going to do it at first, the entire team was starting to seemingly prefer having the menu without backgrounds. So now outvoted, I decided to begin making the changes.
After they mentioned changing the menu, I brought up that it did not go along with what I put on my mood boards, but they did not seem to mind. I will still keep the menu as close to the ideas on the mood board as possible to keep the integrity of the research. I believe this change will bring a less unique nature to the main menu and get rid of some of my planned fluidity, but the other team members desired the change. We had some back and forth as I thought a change in the menu would be too hard on the time, bringing up that I am not an artist. They brought up alternatives like AI, but I could not find any reliable or useful tools.
I sent out some new images taking in the layout ideas where I started by removing the original images. I brought up the fact that this will eat out of my time during the week as I will have to spend longer on the menu. They seemed content with this, so I carried on with the changes. First I moved around the features and copied the menu like CS: GO. This was what they were looking for, but they desired it to look more different. After I created this, they said they thought about making the menu more of a blue-and-white colour scheme. This, again, did not fit the mood boards but did have contrasting bold colours, which is a good feature. Again they had more suggestions to change up the design again to get more originality, sending in a reference. I copied this reference and got to a result they were happy with. For this, I just created a bunch of panels to create the lines on the blue backgrounds. I copied them to add the grey lines seen in the images below.
Cycle Example!
Modes Example!
Final Menu: Pre-Change!
Final Menu: Post-Change!
Menu - Reflection
To reflect on the menu, I would like to split it into two parts. One part pre-team change and part two is a post-team change. As a big part of this part was sticking to the original mood boards, I will use that as a reference to reflect on.
PRE-TEAM:
For the pre-team, I am happy with the work I did, even if it did not see through to fruition. First, for the main menu, I created all the buttons. While keeping it simple, I got all the required mechanics. This aligned with the mood boards as they said to keep a simple, bold layout. I also added the green selection colour I outlined in the mood board, which worked well with the UI look. Looking back, comparing it with the team change of white text think the green worked better with the white text, so I am not the most happy with the black text. For the layout, while it is not that dynamic or smooth, it is bold, stands out to the player, and is easy to understand for everyone.
For the Settings menu, I enjoyed having the environment blurred as it made it easier to focus it on for the player. I preferred the style of keeping s similar background with just the blur compared to the new menu. I managed to add all the options and even got the functionality in. Again the buttons and layouts are simple but work in the settings. I would like to add a selection animation similar to the modes in the future. This would make the menu a lot more interesting to the player and improve the final product.
For the modes menu, I am extremely happy with this menu. First, I added more variation to the mode selection using shapes I made in Photoshop. This made the menu more unique. I am happy with the temporary visuals as they will be replaced in the final menu. The buttons scale on select this adds motion to the menu making it more interesting to the player. I could maybe improve on this but it is an improvement over a boring basic menu overall.
POST-TEAM:
For the main menu, I am happy with the look although I think it is a decrease overall over the original design. The colours work well and it is simple but it now lacks the fluidity and uniqueness of the original. I would personally not have changed it but I was outvoted by the team. I think this new menu could get boring to look at but the player will not be on the menu that much.
The settings menu again like the main menu has been fully changed from what it once was. I still prefer the old version of the menu as this menu is the same as the main menu. I would personally prefer the settings to have a slightly different look even if it is just a slight blur, but now it does not. We could change this but like the other menus, it would be a lot of work for the time we have. The layout did not change so it is still simple and bold in layout.
There was no change to the modes menu on the new menu change. The only problem that arises in my mind, is that the menu does not match the other menu now they have been changed. this could be changed but that would remove all the originality of the menu and they would all be the same.
Shooting - Reflection
For the shooting, my biggest regret was just how much I was unable to get done. Now this is because I had some unexpected issues but I could have done better to avoid them. First, I should have asked my team more about some of the issues I was having and shown more work this would have helped avoid the whole menu redesign. Secondly, I could have spent less time on the main menu as a whole.
I am happy with the functions so far and the equiping works. I will have to spend a lot of time next week trying to get the guns to a point that I am happy with. If I am still behind I won't mind debating scaling the game back slightly if the team is down for it. The guns I added look good and the materials worked so I am happy with that aspect of the week's work. There was some time spent on this and if I pushed it to week six I may have had an easier time.