In Depth Blog Post 2

In the past few weeks I have been hard at work mastering the many facets of the Unity game development engine. In the past week I have been tinkering around with the Ruby’s Adventure Unity tutorial to help me familiarize myself with the mechanics of Unity.

I chose this tutorial because it perfectly fit the description of the game I hoped to create, and taught all the necessary game mechanics I would need. This is what I learned:

Firstly, I learned some basic scripting, which also ties into the implementation of several game mechanics. With these scripting techniques I can now:

  • Add a character that can be controlled with player inputs.
  • Add collisions to my game with the use of the rigidbody2D and boxcollider2D components.
  • Script a hit point system, with static and moving damage areas.
  • Create extremely basic enemy characters that move in a set pattern and cannot detect the environment around them.
  • Create projectiles that move in a straight line in one direction. This projectile are destroyed on collision with another object, and can trigger effect on collision with specific objects (e.g. the enemy characters)

Secondly, I have learned the basics of designing the world your characters reside in. I learned how to create textures and how to split up large textures into a set of smaller ones. I also learned how to convert them into tiles, which can be painted onto the world to some texture to an otherwise blank world. Additionally, I also learned how to animate the character sprites, adding another dimension of liveliness into the fray.

Thirdly, I learned a variety of useful skills like troubleshooting scripts, which caused me no end of frustration. A lack of a single semicolon can render an entire script of over a hundred impeccable lines of code dysfunctional. Poring through lines and lines of code, stretching to the proverbial horizon and beyond is a soul-crushing task, especially if you lack the coding experience to identify where such a problem might lie. Fortunately, I had my wonderful mentor to aid me in my daunting digital grievances, and helped me find bugs and fix them. He also taught me an extremely efficient way of writing code, which is to code in little chunks, and test the code each time something is added. This is much more efficient than say, writing all of your code at once, then realizing that something went wrong and having to check through a hundred lines of code, like I originally did. This goes without saying, but having a habit of saving your work frequently is an extremely useful skill to have. One computer crash is all it takes to waste hours of your time. In addition, everything built from this Unity tutorial can serve as a useful reference for my game, in case I forget how to script or design a certain aspect of my game.

Not to mention all of the Unity mechanics I learned, like how to manipulate the object hierarchy, create new files, turn objects into prefabs, add components, and how to manipulate those components to my needs (specifically the rigidbody2D and boxcollider2D components). I was surprised with how beginner-friendly Unity is to those without coding experience. Unity has several components that can add aspects to your game that would take advanced coding experience to implement yourself, allowing a beginner like me to add a multitude of game mechanics to my game with little skill required.

 

With the help of this Unity tutorial and my mentor, I now have all the necessary knowledge to begin the creation of my own game.

During this period, at my mentor’s request, I created a basic plan for my game:

My game will be a 2D top-down roguelike, with a randomly generated world. The world will consist of multiple pre-fabricated room presets, all connected together in a random way, similar to the hit game, Hades (Supergiant Games). It’s goal will be to clear as many rooms as possible, powering yourself up all the while. You will have to face multiple types of enemies of varying design and difficulty, using a multiple different weapon types.

The game will most likely feature a very minimalistic design, as I am not much of an artist. However, minimalism is increasing in popularity, so perhaps my shortcomings will propel my game to even loftier heights!

 

Here is the link to the product of these two weeks, so you can experience my learning yourself:

https://drive.google.com/drive/folders/1-uv5Rhn_3YsbTyC1hWTPCY4gFq_CK1Vw?usp=sharing

Controls:

C – Fire projectile
WASD – movement

To start: press the little play button at the top of your screen, directly above the window displaying the characters and objects on screen.

In this game, you will notice that objects cannot move through each other. This is because of the rigidbody2D and boxcollider2D components. The rigidbody2D component adds physics to that object, while the boxcollider2D component adds a defined hitbox to entities, which tells other objects when they collide with the hitbox. At this point, two things can happen: the object will stop, as if it hit a wall, or it will trigger an effect if it has been scripted to do so (as in the case of the projectiles, spikes or strawberry healing items).

The spikes will damage the character if it moves into its area, and the lost health can be regained by touching the strawberries. If you fire a projectile at an object, it will disappear on contact. This is another case of the boxcollider2D and rigidbody2D’s effects.

For my progress I must thank my dad, who is a wonderful mentor, and who turned many hard-learned lessons into easy tips and tricks, and my friends, passionate freelance game designers themselves, who helped me troubleshoot during the hardest times when I found myself unable to locate that tricky, elusive bug.

This will not be my final game, but it is a good start, and has served to teach me everything I need to know to begin the 5 month long adventure of creating my very own game!