(Sebastian Lague, 2016) [1]
Video 1
"Introduction to Game Development (E01: variables and methods)"
By Sebastian Lague
Uploaded March 21, 2016
Length: 6 minutes, 14 seconds
Task: Watch this video.
Status: Watched.
Summary of what I understood/learnt
A variable is a name to which data can be assigned. It can be accessed and modified at runtime.
There are multiple types of variable classes such as:
Int, which is for whole numbers;
Float, which is for non-whole numbers (data must have "f");
Bool, which is for true/false data; and
String, which is for storing plain text (data must have quotation marks).
Methods, also known as functions, are an isolated set of instructions in a code that are carried out at runtime. They are stored in a way that allows them to be called upon, therefore reducing code repetition.
Floats can be created in methods to be exclusive to those methods. This is done by changing the method's "signature" to reflect the specific floats that are being called upon in the method. These floats can then be changed to whatever is specified whenever the methods are called upon (this is passing data into a method).
For example, void Explode(float damageAmount, float blastRadius).
There are multiple methods of classes that are for passing data into them and/or returning data from them. The void class is a class that returns nothing, hence why it is called "void"—this is a class that can only have data passed into it. Something like a string class, however, is a class that returns data; for example, if you make a string method that generates random names in a string and returns that data.
(Sebastian Lague, 2016) [2]
Video 2
"Introduction to Game Development (E02: classes)"
By Sebastian Lague
Uploaded March 23, 2016
Length: 8 minutes, 29 seconds
Task: Watch this video.
Status: Watched.
Summary of what I understood/learnt
A class is a way to group related methods and variables together.
Aside from organization, classes have an ability that reduces code repetition called "inheritance". This basically allows classes to inherit methods from their parent classes.
For example, in creating classes for each animal of the animal kingdom, the parent class called "Animal" has the methods "Eat" and "Sleep". A child class called "Mammal" could then have the method "live birth to offspring". Because Mammal is a child class of Animal, Mammal will have the methods of Animal as well as its own methods.
There are some problems that can arise with inheritance. Using the same example, if we create a child class to Animal called "Bird" with the methods "Lay eggs" and "Fly", and then create a child class to Bird called "Penguin", we run into an issue because penguins can lay eggs, but cannot fly—they have that trade-off for the ability to swim, and because the Fly method is in the parent class Bird, there's no real way to remove that method from Penguin.
A way to get around this limitation is with the concept of "composition", the idea being to split up the classes so that each one implements a single behaviour. Using the previous example of the animal kingdom, you could create a list of classes such as "Swim", "Walk", "Eat", "Lay eggs", etc., and then construct your animals using the specific applicable classes, kind of like building blocks.
There are three main ways to use classes, two of which this video discusses: classes as behavioural components and static classes.
The classes as a behavioural component are scripts that are attached to the objects to drive their behaviour.
The behavioural component classes must inherit from Unity's MonoBehaviour class, which contains some common object functionality—some of these functionalities include the Start method, which gets called once at the start of the game, and the Update method, which gets called once every frame.
This is represented by, for example, "class Thing : MonoBehaviour".
By default, variables are instance variables, which belong to the individual instances of the class. The opposite of this is a class variable, which belongs to the class itself instead of the individual instances.
Class variables are represented by adding the keyword "static".
Static classes are classes that belong to the class and not any specific instance. They can't be attached to objects in the game and must have static variables and methods within it. Static classes are very easy to access from other classes, which makes it well-suited to what's called "Utility classes".
For example, in a static class called "Maths", you could have a public static float of pi with the first 10 digits called "pi", and then easily be able to access it from another class by just calling upon it with "float x = Maths.pi", saving you from having to get a reference to a specific instance.
(Sebastian Lague, 2016) [3]
Video 3
"Introduction to Game Development (E03: Unity overview)"
By Sebastian Lague
Uploaded March 25, 2016
Length: 4 minutes, 58 seconds
Task: Watch this video.
Status: Watched.
Summary of what I understood/learnt
You can change the whole layout of your Unity window to whatever layout you want by just dragging the windows to any container in the editor.
You can save a custom layout in the Unity editor by clicking on the top right button where it says "Default" (by default, if you haven't already used that context menu to change the layout) and pressing "Save Layout..."
By default, the Unity editor has six windows: the hierarchy, which is a list of all the GameObjects in the scene; the scene view, which is an editor view of the current scene; the game view, which is a runtime view of the current scene (using Camera GameObjects); the inspector, which is the control panel for all the GameObjects and such in the scene; the project viewer, which is the file viewer for your project assets; and the console, which is an output for things like debug logs, warnings and errors.
From what I've learnt in the past, you can add more windows to the Unity editor by going to the Window context menu and selecting whatever window you want, such as the Animator window.
If scripts are dragged from the project viewer onto a GameObject in the scene view, it will assign that script to the GameObject, which can then be viewed in the GameObject's components in the inspector.
You can start a test run of the scene by hitting the play button at the top, which will then put the scene into a runtime instance. You can also pause the instance as well as step it. Note that anything that's changed in this runtime instance is not saved and will revert back to its original state (before you pressed the play button) once you end the instance.
You can create multiple different scenes in your project, which can be useful for things like separating a game menu from the game itself. Game scenes are stored and are accessible in the project viewer.
Reading 1
Task: Take a look at this webpage.
Status: Read.
Summary of what I understood
This W3Schools page defines what C# variables are. They are containers for storing data values. It defines the type of variables, such as "int", "char", "string", etc., and then goes into detail about how to declare (create) variables, providing some useful examples alongside it. It also explains constants in variables, which creates a variable that is read-only and cannot be changed under any circumstance. This is expressed by adding "const" to the start of the variable.
One thing I did notice was the use of "double" for floating point numbers instead of "float", and after doing some research, I found a forum post on Stack Overflow by Khaled Alshaya almost 13 years ago that states that "although double allows for higher precision in its representation, for certain calculations it would produce larger errors. The "right" choice is: use as much precision as you need but not more and choose the right algorithm."[5]
It also goes into detail about display variables, which are used to display variable values to the console window, and shows some examples alongside it. It also tells you about some miscellaneous things such as declaring many variables, which is done by creating a comma-separated list, and C# identifiers, which is basically the unique name that you give a variable.
(Programiz, n.d.) [6]
Reading 2
Task: Take a look at this webpage.
Status: Watched.
Summary of what I understood
This Programiz page talks about what C# Operators are and how to use them. Operators are symbols that are used to perform operations on operands (operands may be variables and/or constants). They are used to manipulate variables and values in a program. It provides the example of "2+3" to this, with "+" being the operator and "2" and "3" being the operands in this case.
The page then goes over all the different types of C# operators, some of which include:
Basic Assignment Operator—used to assign values to variables, and is presented with "=";
Arithmetic Operators—used to perform arithmetic operations such as addition ( + ), subtraction ( - ), multiplication ( * ), division ( / ), etc. (% for Modulo Operator/Remainder);
Relational Operators—used to check the relationship between two operands (whether or not the relationship is true or false), and are represented with the following:
Equal to ( == );
Greater than ( > );
Less than ( < );
Greater than or equal to ( >= );
Less than or equal to ( <= ); and
Not equal to ( != ); as well as
Logical Operators—used to perform logical operation such as "and", "or";
Logical operators operate on boolean expressions ("true" or "false") and returns boolean values.
(Wikipedia, updated 2022) [7]
Reading 3
Task: Take a look at this webpage.
Status: Read.
Summary of what I understood
This Wikipedia page talks about conditionals in computer science. Conditionals are programming language commands for handling decisions. Specifically, conditionals perform different computations or actions depending on whether a programmer-defined boolean condition evaluates to true or false. It then talks about the terminology of conditionals and how that varies in the different types of programming, such as the term "conditional statement" in imperative programming languages and "conditional expression" or "conditional construct" for functional programming. It then goes on to talk about expressions such as, but not limited to, the Else if expressions and the If-then-else expressions.
So we are at it again! As last trimester's GAD170 class was a fail (a strategically intentional choice, but a fail nonetheless), I shall be embarking on the journey of the illustrious and legendary Super Blox Man once again! Hopefully this time, Super Blox Man gets the glow up he deserves, as more time can be allocated to working on the projects in this class.
The project's inception and first steps
But to embark on the journey of the fantastic Super Blox Man, we must first make the world that he exists in (also known as creating the Unity project).
In the Unity Hub, I began with creating a new project and selecting the base 3D option. There is the option to use the new Universal Render Pipeline or High Definition Render Pipeline, but for where we're going, we don't need fancy-shmancy graphics rendering. Once I hit "Create project", the program will build the project for me and will then open up a new window, allowing me to get started on creating the beautiful prototype world that the legendary Super Blox Man inhabits.
The first thing I decided to do after loading into my new Unity project was to construct a simple level to get things set up. I started by creating a simple plane and textured it with a green-tinted developer texture to represent grass. I took the developer textures from Sven Co-op (Sven Co-op team, 1999) because I think those dev textures specifically, as well as Valve's Source engine dev textures, are some of the most useful; they are simple and yet serve their purpose perfectly. I was able to correct the scaling perfectly by assigning the dev texture to a cube and using that cube for reference against the plane.
I then created a very primitive-looking maple tree (in Autumn when the leaves are orange) using a cylinder and sphere, also using the tinted dev texture materials. To help with scaling, I decided to use the original Super Blox Man model from my trimester 1 project and compare the two, which you can see in the picture. I then decided to use a system we haven't actually been taught how to use, but one that I have experience with from before I came to SAE: the particle system.
Using an Autumn leaf clipart picture from the web, imported as a sprite into Unity and then converted into a material, I created a particle system that simulated falling leaves that were falling from random places from this very primitive-looking maple tree. It was a touch that was completely unnecessary, which is also the case for the tree itself, but I thought it was a nice touch and something I could put into my level when I expand on it.
And expand it I did. You could say I went overboard on just a simple test level to use for my scripting, and in all fairness, you'd be totally right. Do I regret going overboard on it? Absolutely not.
And just with a few touch ups on post processing using Unity's Post Processing Stack V2, we have a nice looking environment. Now we can move on to the important stuff.
The (re)birth of Super Blox Man
Now onto the most important part for this week: bringing Super Blox Man to LIFE! To make this game, well, a game, we have to give the player some kind of control. In the last trimester, I gave the player direct control over Super Blox Man, where they could move (and strafe) and turn Super Blox Man, as well as making him jump and sprint. The controls were simple, primitive and very janky—the only problem is, the only thing that was actually documented was the sprint mechanic in the advanced player controller. Everything else was not documented, so I will have to go through everything again and document it.
The first stage of (re)birthing Super Blox Man: physically creating Super Blox Man. Where we are at right now, Super Blox Man doesn't need his aforementioned well-deserved glow up, so I just reused the model created for him from last trimester. It's a primitive design but it's all that's needed for now, and no, the cylinder in front of Super Blox Man's head is still not a Pinocchio nose—it's a pointer.
Well now that we have the player model, let's give the player control of it with scripting. My lecturer for this class, Pete Philips, was kind enough to include a player controller script for us to import and assign to our player model. Also fortunately, I have the entire script archived on this learning journal, which you can actually see for yourself here. Seeing as this page is archived and is therefore irrelevant, however, I decided to make another page for it for this trimester's directory, which you can find here. I also go into more detail about how the script works on this new page.
This player controller script is primitive but works nonetheless. With this script, the player has the ability to move forward and backward, turn left and right at a fixed speed and strafe left and right. The script originally only gave the player the ability to move forward and backward and turn left and right, but after testing the script for myself a few times last trimester, I found that the controls were WAY too clunky and decided to add another method of movement that would help alleviate some of the control issue.
I hid something. Find it.
How did it go? Explain what you did, what that tells you/how you felt, and what you'll do next time.
This week was actually my first class for GAD170 this trimester as I had to go to Kalgoorlie for personal reasons. I attended GAD170 last trimester but had to strategically fail the class so I could get my other classes done, and before you think I'm just wording my epic fail for the class, I was given the suggestion to do so by Glen, the guy who I guess oversees the whole Games course. Because I knew what it was I had to do from last trimester and from reading the unit site, I decided to just put on my music and work on my project.
I made a start on my park scene while I was at campus. By the time I had to leave, I had made the floor, the trees with the particle system set up and the textures for all these things. I stayed behind for a while after class to do as much as possible before I was kicked out because of the next class. When I got back home, I spent the next couple of days working on my park scene and finally got it complete. To make the scene look nicer, I decided to add post-processing to my scene with effects such as ambient occlusion, bloom, chromatic aberration, lens distortion, etc. I've messed around with post-processing in the past and I also look at the way games such as Resident Evil 7, Layers of Fear and Silent Hills P.T. handle their post-processing effects, and I try to make it look subtle but also strong enough to make a noticeable difference to the image.
After some further unnecessary-but-also-necessary finishing touches to the scene, I then decided to add in the simple player controller script to make my work for this week's time at least worth while, so I can say I actually did some of what was expected of me this week.
Honestly, it feels good to have more time to be able to do things like this. I feel like I can have more creative freedom with my class work without it having as much of an impact on important time, which is great because I can make stuff that I'd be proud to look back on instead of just seeing my old work as really early "learning-stage" stuff. That being said though, I feel like I might have spent a bit too much time procrastinating and being distracted easily by other things, and therefore I didn't get as much done as I think I should have. Next week I will try to distance myself from the distractions such as Discord or YouTube and focus on getting my stuff done, within reason of course (taking breaks and such), and I'll make sure to do those darn TS reflections and pre-class activities. There's also a set of videos that I need to watch by a certain deadline, so I will need to look into that as well and get that done.
Week 2: Practice
Question 1
How have you changed your practice/processes since starting at SAE to improve your skills?
Answer 1
Well for starters, one thing I'm doing that I definitely didn't do before I came to SAE was writing down my progress on my personal projects, not only for game project, but for pretty much any project. I would only really write down a few notes, or at best, explain to a friend what it is I'm doing and how the project is going, and that would only be maybe once. With writing my stuff down in a learning journal, not only can I go back and see the progress I made on a project over time, but I can also take a look at anything I've forgotten about with my documentation on things like my scripts.
Another thing would be that I've tried to actually make a functional game instead of trying to be way too ambitious and try and code in mechanics that I would not be able to see the whole way through with the skills I had at the time. In my old personal projects, I focused a lot on experimentation and just seeing how things would look if I made them a certain way, whereas with the projects I've done at SAE, they are like functional games.
Question 2
Who is your icon in the field, what do you need to learn to be like them?
(Metal Gear Wiki, n.d.) [8]
Answer 2
Going back to an answer from week 1, Hideo Kojima is my icon in this field. I think the games that he makes, even if they have questionable writing and sometimes not so good reception from critics and the general demographic alike, are beautifully crafted. Even a game like Metal Gear Survive that was panned by everyone, that game still looks good, plays good, sounds good, etc.; it had a lot of effort put into it.
I can think of two things right now that I would need to learn to be able to create a project that could even look up to the likes of Hideo Kojima's games, that being:
improvement on my game developing and designing ability; and most importantly
the ability to work with teams, big or small, and work with people that are from different disciplines such as audio, animation, design, etc.
The second point is the most important because something to note is that it is VERY hard to work on an ambitious game project all by yourself. To be able to do that, you would have to learn how to do every aspect of the disciplines that are involved in game-making projects such as the ones listed above, and that would take a VERY long time, not even including actually making the game. It's better to hire people who actually specialize in these specific field and split up the workload appropriately. That is how pretty much any game company that knows what they're doing handles game projects, and with what logic would say, and in the words of Todd Howard, "it just works."
Question 3
How can I expand my knowledge of _________ beyond what was taught in class. Give examples of what steps you could take?
(Capcom, 2017; Silent Hill Memories, 2014) [9, 10]
Answer 3
I think one thing I would definitely like to expand my knowledge upon is with the player controller. I would like to go beyond the simple moving and jumping and really make a player controller that I would be proud to call mine. Things such as sprinting, mantling, climbing, even things like headbob, gunplay, all that kind of stuff. I look at games like Resident Evil 7 and Silent Hills P.T. (I know I have mentioned those games A LOT already but those are my two top inspirational games) and see how they've made their player controllers feel smooth and realistic with the perfect polish, and it inspires me to do the same.
A way I could get to this is with experimentation. I did experimentation with my personal projects and made some progress, but there was only so far I could go before the forums and documentation could no longer help me. Now, however, I have the opportunity to seek help from someone who is an expert in this kind of stuff (Pete, self-proclaimed but I have good faith in his skill). Pete did actually help me with a sprint mechanic that I implemented into the advanced player controller script last trimester, and he got it working flawlessly in a method I didn't even think to use, so I think this opportunity is definitely there.
Question 4
What is the difference between what you are told to do versus what you choose to do on your work?
(Sergey Nivans, n.d.) [11]
Answer 4
Well there are two answers to this.
Firstly, and this one is pretty obvious, with being told what to do on my work, I have to follow the set of instructions I am given for that task, even if it's loosely. What I choose to do, however, is like building with LEGO without a manual—it's up to me what is to be done.
Secondly, creative freedom, of course! With being told what to do, there is only so much I can change to my will before it no longer fits what's been asked of me. With what I choose to do, however, I have a lot more freedom with what I can do. I can choose to add small or big details, modifications to something like a player controller that would ultimately make the experience feel more solid, whatever it is I want to do, as long as it is within my scope.
[1] Sebastian Lague (Producer). (2016, March 21). Introduction to Game Development (E01: variables and methods) [Video]. YouTube. https://youtu.be/9iCnjdXEfMA
[2] Sebastian Lague (Producer). (2016, March 23). Introduction to Game Development (E02: classes) [Video]. YouTube. https://youtu.be/XT_CtYN1OOU
[3] Sebastian Lague (Producer). (2016, March 25). Introduction to Game Development (E03: Unity overview) [Video]. YouTube. https://youtu.be/L9zlZjxmwXU
[4] W3Schools. (n.d.). C# Variables. Retrieved June 19, 2022 from https://www.w3schools.com/cs/cs_variables.php
[5] Khaled Alshaya. (2009). Should I use double or float? Retrieved June 19, 2022 from https://stackoverflow.com/questions/1074474/should-i-use-double-or-float
[6] Programiz. (n.d.). C# Operators. Retrieved June 19, 2022 from https://www.programiz.com/csharp-programming/operators
[7] Wikipedia. (Updated 2022). Conditional (computer programming). Retrieved June 19, 2022 from https://en.wikipedia.org/wiki/Conditional_(computer_programming)
[8] Metal Gear Wiki. (n.d.). Hideo Kojima [Image]. https://metalgear.fandom.com/wiki/Hideo_Kojima?file=HideoKojimaInfobox.jpg
[9] Capcom. (2017). Resident Evil 7 Official Web Manual > How to Play > Player Actions [Image]. http://game.capcom.com/manual/re7/img/page/22_1_1.png
[10] Silent Hill Memories. (2014). Gamescom 2014 P.T. Images [Image]. https://www.silenthillmemories.net/silent_hills/screens/pics/silent_hills_pt_screen_20140814_03.jpg
[11] Sergey Nivens. (n.d.). Creative thinking [Image]. Adobe Stock. https://t4.ftcdn.net/jpg/00/70/13/75/360_F_70137599_EwYKIGAPt9zhhteRvC3dOOFrxCdSd95i.jpg