Team Project Development Log 1: Idea Generation and Prototyping
The team I was assigned to was called The Lego Munchers. This name was chosen to match our game idea as the characters in the game are based off of Lego bricks. The role I had within the team was game designer and scripter. We decided that our game was to be Lego-based in some way very early on and that the game would have some kind of connection to the word defenestration which is the word that describes someone the action of throwing something or someone out of a window. This is why the title of our game was chosen to be Delegostration.
After we had decided on a title, we had to decide on what type of a game we wanted to make. Eventually, we settled on the idea of a Gang Beasts type fighting game set in an office with two players against each other. The idea was for each player to try and knock the other player out of a window to win the game. The team leader then gave tasks for each of the team members to do and made sure that each person had enough to do.
I made a prototype of the game to test the various game mechanics I would have to implement. The mechanics that were implemented in this prototype were player movement, multiple players and picking up and throwing objects.
This prototype shows the player movement working for both the players as well as both players being able to interact with objects (the blocks) by picking them up, dropping them and throwing them. However, at this stage the winning conditions were not implemented so there is no way for the players to damage or knock each other around. There was a dummy player in this prototype to display how this would function later. The models used in the prototype are placeholders implemented by me which will later be replaced by models made by our 3D modellers.

This script is the one that enables the first player character to move around the game environment. The first part of the script is where the variables are set up to enable the script to work. The controller variable links to the character controller of the player and the cam variable links to the camera of the game scene. The speed variable is a float used to set how fast the player moves while the turnSmoothTime and turnSmoothVelocity are floats used to to make the turning of the player character smoother. The first section of code within the void Update section is used to detect the input of movement linked to WASD by using the Horizontal and Vertical input tags and to create a Vector3 linked to these inputs so that the player can be moved using them. The normalized part is at the end of the Vector3 line is used so that the speed of the player doesn’t increase when multiple keys are pressed to get the player to go diagonally. The if section of the code only works if the player is moving because it is looking for the number that represents the input of the player to be higher then 0.1. The first line of the if section is used to make the player turn to the direction they are moving in while the next two are used so that the player doesn’t snap instantly to the direction and instead turns. The last bit of code in the if section is what actually moves the player by determining the direction it needs to move in as well as actually moving the player by using the character controller.

This script is virtually the same as the previous script except that it is the one for the second player. The only difference is that the input that the script is looking for is the arrow keys rather then WASD which is linked to by using Alt in front of Horizontal and Vertical.

The above script is an incomplete script that was used to test some functionality for the damage system that will be later implemented. It detects when the objects are near the player while being thrown by adding a log in the debugging menu that says that damage has been done. It also disables the trigger used to detect the player when the object either hits the player or the environment so that the player wouldn’t get damaged if they walked near the objects on the ground.

The above image shows the first part of the script used for the functionality of the player picking up and throwing or dropping objects. This part of the script starts with the variables needed for this script. The itemOG variable is used to link to the object that this script is attached to in the game. The damageObj variable is used to link to a component of the object that contains the trigger used to detect the player when the object is being thrown. The next variable is a float called throwForce that is used to set the force at which the object is thrown. The objectHeld variables are booleans used to determine if one of the players is holding this object when the other is in the radius of it. The next two variables are floats used to see if the player already has an object when they try to pick up another one. The two transform variables are used to set where the objects will go when they are picked up. The withinRadius and pickedUp booleans are used to detect when the players are in the radius of the object so it can be picked up and if the object has been picked up by the players. The two trigger sections are used to set the withinRadius variables to true or false whenever the players enter or exit the trigger on the object.

The first if section of this part of the code is only active when player 1 is within the radius of the object, the object isn’t held by the first or second player and the amount of objects the player has is below one (since the player should only be able to hold one object). The part inside the if section is an if section that detects when the player presses the E key as this is the key that is used to pick up objects and has the functionality for the object being picked up. The object is made kinematic so that the other objects can’t affect it and is made to not use gravity so it stays where it is moved to. The object is then moved to the destination set in the variables section and added to the player object so that it stays with the player when the player moves. The related variables are also changed so that the script knows that player 1 has picked up this object. The next if section that isn’t contained inside the first if section is only active when the player has picked up an object. It contains two if sections that detect when the R and F keys are pressed respectively. R being the key that drops the object and F the key that throws it. They both reverse all the changes made in the code contained inside the first if section with the only difference being that the F section enables a trigger contained in the object that detects the player for the damage script and throws the object forwards.

This image shows the functionality for Player 2. It is in the most part the same as the part of the script for Player 1 but instead uses Return/Enter as the key for picking up objects as well as Right Shift for dropping the object and Right Control for throwing the object.