Tuesday, February 28, 2017

Monthly Post #1 - February in Review

What I Learned This Month

-The basic navigation controls of the Unity engine: moving the camera; the inspector, hierarchy, and project settings; adding and transforming objects; and the Profiler.







-How to create and edit terrain.

-How to start a game and colour objects.

-How to add scripts to customize an object's behavior.

-How to troubleshoot some annoying problems.

-How to use physics in a game.

-How to use tags.

-How to use UI text.

-How to build the game once it's done.

-How to use lighting.

-And finally, how to use Unity's pathfinding AI.

What I've Accomplished

So far I've made a simple game called "Roll-A-Ball", which can be found here (download the zip file containing the two items and export the contents to another folder, then run the .exe file from inside the folder).

I've also started making a second game. It will be a "click-to-move" RPG style game. It can be found here (same thing as the other game).


Over the next month I plan to continue the RPG game. When I finish it I will go back to my Roll-a-Ball project and make it into an actual game with different levels.


Monday, February 27, 2017

Day 17: Troubleshooting

First of all, I had to fix the errors. I looked back through the tutorial and found a simple mistake I made. I needed two "=" signs right here:

The second error I had more trouble fixing. I decided to try one of the fixes suggested by the program to see if that worked:
 It seemed to fix the problem. It wasn't coming up as an error, at any rate. Now to see if it worked...

And it did!

I can finally continue onto the next tutorial video: "Interactable Items and NPCs"

I started off by making an "NPC" that the player will be able to interact with, and an "item" that the player can pick up and put in their inventory.

I got a bit of the script dome before the class ended.

My next post will be me continuing with the tutorial, and another post to reflect on what I've done this month so far.















Day 16: Player Movement

First, I need a player. I'm just going to use a simple cube; nothing too fancy. I called it "Player_Model", and made it a blueish colour.


Now for the fun stuff: scripting the world interaction. The WorldInteraction script will allow the game to detect what is being clicked and react accordingly.

I started with a script that detects whether or not the mouse button is clicked, and if what it's clicking has a specific tag.

I then went back to my scene, and selected everything in the "environment" tab and made all of it "static". This means that the game expects them to not move, and won't  have to recalculate it every frame.

I then selected everything that I didn't want the player to be able to walk on, like the trees, rocks, barrels and mountains, and set them to "not walkable".
Next, I "baked" the scene to apply the walkable area to the scene. Everything in blue can be walked on by the player.

I then added, to the player, a "NavMeshAgent". This defines the collision dimensions, speed, acceleration, and how far the object stops from its destination.

Here's the script I added.

Unfortunately, there's an issue with the "NavMeshAgent" lines for some reason. Next class, I will try to fix that.


Wednesday, February 22, 2017

Day 15: Starting a New Game - RPG

Yesterday I decided to jump right in to making a simple RPG. I will probably be deviating a bit from the tutorials, but for the most part, it will be the same.

In the first tutorial video (which might take two or three days) I will be setting up the scene and player movement. Now, the player movement in the tutorial is "click to move". I don't like that much, so I will attempt to make an option to switch to third-person locked view, probably by pressing the "V" key.

First off, I need to get an asset pack called "Low Poly Free Pack". This allows me to set up the scene without having to make everything from scratch.

In the Hierarchy I made an empty object. This is where I will put everything so I can move it all around at once if need be.

Next, I made a cube, and scaled it up to 15x15x1. This will be the ground.

Coloured it and scaled it up a bit more.

I then used a bunch of assets from the asset pack to create a scene/

That done, I added another light source, turned shadows for it off, and made it purple. This will help give the scene a "night" feeling later on. I also added fog.

After a while, I finally found some lighting settings that I liked/

I then added light sources in the lantern and the crystals.

The biggest thing I learned today in the tutorial is how to customize lighting. Next class I will finish up creating the scene (the first half of the video), and move on to player movement control (the second half).




Tuesday, February 21, 2017

Day 14: Building the Game

When a game is "Built", it can be built for many different platforms: PC, mobile, console, etc. I decided to build it for PC to start with (console and mobile are more complicated). To start, I needed to open the Build Settings window.

I then selected the scene(s) I wanted in the game (there was only one), clicked "build", and saved it in a "Builds" folder as "Roll-a-Ball Built".

Now to test the game itself.

And it works! A few things I would like to do (and I might, at a later date) is add a menu with a restart button and sensitivity options, more "levels", mobile support, and sounds. For now though, I am officially done with this project.

Here's what I learned throughout the Roll-a-Ball tutorials:

  • How to create new game objects and:
    • position them in the scene
    • add components
    • how to add custom behaviours using scripting
  • Lights
  • Camera
  • RigidBody physics component
  • Triggers
Next class, I plan to do another tutorial, this time on making a simple RPG game.



To test the game, download the folder here, unzip the folder, and run the executable file inside.

Monday, February 20, 2017

Day 13: Displaying Score and Text

To make the game 'count' how many objects have been picked up, I needed to add another variable to the Player Controller script. The script I added has a green description next to each part of it.

Now, to display text, I needed to create a new text object.

The script that I then added creates a variable called "CountText", and it is set equal to the Count variable every time a object is picked up.

Now, to connect the text object to the script, I simply dragged it into the  "Count Text" slot in the inspector.

It works.

To make the "You win!" text at the end, I first created a new text element, same as last time. I named in "Win Text" (not shown).

Now, to display the text, I added a new variable...
And added some code to display the text "You Win!".
And it works!

Next class I will "Build the game and deploy it using a standalone player". In other words, it will be an independent game from the Unity game engine.