Bachelor's Thesis
Total Page:16
File Type:pdf, Size:1020Kb
Sami Krouvi IMPLEMENTATION OF A VIDEO GAME COLLECTION Games for Educational Use Bachelor’s thesis Information Technology / Game Programming 2019 Author (authors) Degree Time Sami Krouvi Bachelor of October 2019 Engineering Thesis title 37 pages Implementation of a video game collection 2 pages of appendices Games for educational use Commissioned by South-Eastern Finland University of Applied Sciences Ltd Supervisor Niina Mässeli, Senior Lecturer Abstract The objective of this thesis was to design and implement a video game collection for educational use, to be used as an educational tool at GameLab, a learning environment of South-Eastern Finland University of Applied Sciences, in the education in game programming. The thesis was conducted focusing on the implementation. The primary tools used in implementing the video game collection were the Unity 3D game engine along with the Microsoft Visual Studio integrated development environment. This thesis details the design and implementation process of the video game collection as a whole. Instead of describing the development process of each individual game included in the collection, this thesis aims to describe the process of creating a video game collection and which factors need to be taken into consideration when making one, by providing a detailed description of the implementation process. The video game collection was developed as a result of this thesis. During its development, numerous changes occurred affecting the structure of the games included in the collection. The resulting video game collection should provide to be a capable educational tool and to be able to serve as a platform for future development. However, its capabilities are only known once it has been adapted into its intended use. Keywords game development, programming, modularity, Unity 3D CONTENTS ABBREVIATIONS & GLOSSARY ........................................................................................ 5 1 INTRODUCTION .......................................................................................................... 6 1.1 Purpose of this thesis ............................................................................................. 6 1.2 Approach to the subject .......................................................................................... 7 1.3 Commissioner ......................................................................................................... 8 2 DESIGN ........................................................................................................................ 8 2.1 Types of games ...................................................................................................... 9 2.2 Modularity & shared components ......................................................................... 11 2.3 Game design documents ...................................................................................... 14 3 IMPLEMENTATION .................................................................................................... 15 3.1 Tools & software used .......................................................................................... 15 3.1.1 Unity 3D .......................................................................................................... 15 3.1.2 Microsoft Visual Studio ................................................................................... 16 3.1.3 Doxygen .......................................................................................................... 17 3.1.4 Blender ........................................................................................................... 20 3.1.5 Graphical software .......................................................................................... 21 3.2 The games ............................................................................................................ 23 3.2.1 General structure ............................................................................................ 23 3.2.2 Common components ..................................................................................... 25 3.3 Code ..................................................................................................................... 28 3.3.1 Core classes ................................................................................................... 29 3.3.2 Commenting conventions ............................................................................... 30 4 CONCLUSIONS ......................................................................................................... 31 REFERENCES .................................................................................................................. 34 LIST OF FIGURES ............................................................................................................ 37 APPENDICES Appendix 1. Table of elements included in types of games Appendix 2. Code commenting guidelines 5 ABBREVIATIONS & GLOSSARY API Application programming interface, is an interface intended to simplify the building of software or extensions Class A class is an extensible program-code-template for creating objects in object-oriented programming CPU Central processing unit, is the electronic circuitry within a computer that carries out the instructions of a computer program Debugging The process of finding and resolving defects within a computer program Despawning The deletion of an entity from the game world Gameobject An entity within the game world in Unity 3D Inheritance The mechanism of basing an object or class upon another object or class Instance A copy or an occurrence of any object or class Instantiation The creation of an instance or instances Method A code block that provides functionality Prefab A template of an entity in Unity 3D Respawning The recreation of an entity after its death or destruction Rigging The preparation of a 3D model for skeletal animation Scene A level in Unity 3D Solution A project in Microsoft Visual Studio Spawning The creation of an entity into the game world UI User interface, enables user interaction UV map The surfaces of a 3D model projected as a 2D image UV mapping The act of creating a UV map or UV unwrapping Variable A storage location for storing a value in programming 6 1 INTRODUCTION Ever since video games became widespread in the 1980s, their usefulness in education has been studied, but only in the recent years have video games truly began seeing use as a serious educational tool rather than just being made for children alone. Video games used as such often focus on simulation, hence being called simulators, and enable training for various tasks in a safe way. What has not been studied, yet, is whether video games can be utilized in education in more ways than by just playing them, by examining their inner workings and through the process of re-creating them for instance. 1.1 Purpose of this thesis This thesis was commissioned as a part of a project of larger scale. The goal of the project was to design and develop a video game collection, consisting of various games of different types, using Unity 3D as the primary development environment and to produce extensive enough documentation, along with instructions for each game, in order to allow the games to be recreated with the help of the instructions and some premade assets. Additionally, the goal was to also experiment with using the Git version-control tool and to include instructions for its usage in addition to the instructions for recreating the games. The purpose this video game collection, and the rest of the documentation, was to be developed for was educational use, with the intention of the end product being utilized as an educational tool in the education of future bachelor of engineering students at Xamk GameLab, for this reason, all the documentation produced for the end users were to be written in Finnish. This thesis focuses on the implementation of the games included in the video game collection that was developed. Due to the scale of the project, theses of the same subject, though of different aspects of the project, with a different focus and approach, have been written, or are being written at the time of writing this thesis, by Juho Koponen (see Koponen 2019) and Jari Tervo, who made up the rest of the development team involved in the project. 7 The purpose of this thesis is to provide insight of the process of creating a video game collection, consisting of multiple relatively simple games, as opposed to just one, broader and more extensive game, by going through the design and implementation process of the video game collection that was developed step by step, providing a detailed description of what was done in each step. The aim of this thesis is not to serve as a guideline for making a video game collection but rather to demonstrate what needs to be considered when creating one and which kind of tools to use in addition to presenting some useful practices. 1.2 Approach to the subject The development team consisted of three individuals, who had prior experience in working closely together, as the team had cooperated on multiple projects in the past, including a prototype of a training simulator and several smaller video game projects. Even though developing video games was nothing new to the members of the development team, this was a project of completely different scale, presenting new challenges. The approach to implementing the video game collection involved all the members of the