Você está na página 1de 43

Page 0

Joseph Cortez

Scalar:
An Unreal Engine
Game Prototype
CST 499 – Directed Capstone

Cortez
6-12-2018
Cortez Page 1

Executive Summary

The main goal of the project is to highlight the use of object-oriented programming within the
Unreal Engine to create a unique game prototype which may be added upon later. The objectives
for the project are as follows:
Project Objectives
• Title screen will give the player the option to start game and choose controls
• Player can play in both first person and switch to third person
• Player can move throughout a 3D rendered environment
• Player can shrink in size and upon shrinking can fly and move more quickly
• When player shrinks, the perspective will change to third person but can be switched
back to first person
• Player can manipulate objects and store certain objects in an inventory
• Player can only shrink for a certain time but can collect items to increase time shrunken
• When player is shrunk they are undetectable
• Player will have a life bar to indicate life left and a shield bar to do the same
• The player can use various weapons acquired in the game
• Non-playable characters may try to harm the player
• The player will have to solve a puzzle to exit the level
• The player will have to utilize their shrunken ability to solve the puzzle
Contributor Objectives
• Contributor will gain experience with Unreal Engine and C++
• Contributor will gain experience with Git
• Contributor will get to integrate the software with the hardware to have it run efficiently
• Contributor will learn basic modeling with Blender
• Contributor will expand knowledge in gameplay and user interface programming
The population affected by the project will be game designers interested in building upon a game
prototype, individuals older than 10 years old who may enjoy new experiences in gaming, my
family, and the cohort I am involved with or any others who may play and review the game. The
outcome for the project is that a game prototype was made that is both fun and unique enough to
be taken by a design team to build upon and create a complete game.
Cortez Page 2

Table of Contents

I. Introduction

II. Project Goals and Objectives

a. Project Objectives

b. Contributor Objectives

III. Stakeholders and Community

IV. Feasibility

V. Functional Decomposition

VI. Selection of Design Criterion

VII. Final Deliverables

VIII. Approach / Methodology

IX. Legal Considerations

X. Ethical Considerations

XI. Timeline/ Budget

XII. Usability Testing/ Evaluation

XIII. Final Implementation

XIV. Conclusion

XV. References

XVI. Appendix – Item A

XVII. Appendix – Item B

XVIII. Appendix – Item C

XIX. Appendix – Item D

XX. Appendix – Item E


Cortez Page 3

XXI. Appendix – Item F

XXII. Appendix – Item G

XXIII. Appendix – Item H


Cortez Page 4

Introduction

Videogames have been around since the early 1970’s and have recently even surpassed

the motion picture industry in annual revenue. They range from simple entertainment to

interactive stories to problem solving tools that can test the mind. The video game industry is

ever evolving industry that captivates the imagination and creates social interaction. Gamers like

variety and new ways to play their game. To keep them engaged, game developers are always

looking for new ways to keep their audience coming back for more.

For the capstone project, I tackled the problem of creating a unique game prototype that

is both fun, thought provoking, and new to gamers. I studied the use of object-oriented

programming in the Unreal Game Engine by implementing the programming language of C++.

The solution was to create a unique first person/ 3rd person interchangeable game

prototype for the PC focused on the players ability to shrink and grow. The game was to have

several features such as item storage, life meter, and different custom physics to solve custom

puzzles. Given that this was a prototype the game consists of one level and allow for future

levels to be created if time permits.

Developers as well as players in the gaming community will be impacted by the project.

A major group of stakeholders are artistic/ design teams to come in and lend their artistic talents

to the game. Other stakeholders are myself and my mentor, Dominic Camargo.

The video game industry is constantly evolving due to the amalgamation of innovation in

new technology and consumer desires. The proposed project is needed as evidenced by a recent

survey in the industry. The trends in the industry today are occurring in Personal Computer (PC)

game development. According to Wesstar and Andrei-Gedja (2016), 75% of 2928 surveyed

respondents felt the PC was very important for future growth; compared to only fifty-seven
Cortez Page 5

percent of the surveyed respondents reported console development as important for future

growth and an average of forty-seven percent reported Android and IOS development as

important for future growth.

The project of creating a first-person game prototype has been done before but not the

exact detail with which I wish to accomplish. One such project is a project called Inua, a

capstone project from SMU Guildhall. Another such endeavor was a project called Crystalline

from the Rochester Institute of Technology. Although these projects share basic similarities such

as first-person perspective, item use, and weapon use, they are different in many ways. The

major way they are different is that they lack the ability for the player to shrink and grow at will.

In my game, it is my intention for this ability to also change gameplay with the abilities to be

undetected, fly, access unreachable places, and quantum teleportation. The only instances of a

video game where the player shrinks in real time that I could find were Morphies Law and

LEGO Marvel Super Heroes

Project Goals and Objectives

The goal of the project is to highlight proper use of object-oriented program in Unreal

Engine and for other designers to build on the custom physics and unique gameplay.

Project Objectives

• Title screen will give the player the option to start game and choose controls

• Player can play in both first person and switch to third person

• Player can move throughout a 3D rendered environment

• Player can shrink in size and upon shrinking can fly and move more quickly

• When player shrinks, the perspective will change to third person but can be switched

back to first person


Cortez Page 6

• Player can manipulate objects and store certain objects in an inventory

• Player can only shrink for a certain time but can collect items to increase time shrunken

• Player will have a life bar to indicate life left and a shield bar to do the same

• The player can use various weapons acquired in the game

• Various level aspects may try to harm the player

• The player will have to solve a puzzle to exit the level

• The player will have to utilize their shrunken ability to solve the puzzle

Contributor Objectives

• Contributor will gain experience with Unreal Engine and C++

• Contributor will gain experience with Git

• Contributor will get to integrate the software with the hardware to have it run efficiently

• Contributor will learn basic modeling with Blender

• Contributor will expand knowledge in gameplay and user interface programming

Stakeholders and Community

Artistic/ design teams are a major stakeholder the game prototype. Given that I am a

software engineer and games are made by hundreds of people of different backgrounds, it is

understood that this prototype is meant for designers and artists to lend their creative abilities to

it. These teams can implement their design on a game prototype that has never been done before.

Time, money, and effort may be lost if the right design is not merged with the game prototype.

Another major stakeholder is myself. Upon graduation with a B.S. in Computer Science,

I hope to enter the video game industry as a software engineer. Object oriented languages and

scripting languages are the primary coding languages necessary for obtaining a position as a

video game software developer. C++ is the most popular object-oriented language used in the
Cortez Page 7

industry (Endsley, 2015). Outside reading on the industry, creating a gaming portfolio, attending

gaming convention events to gain internal contacts, and researching internships are part of an

extracurricular plan to increase the likelihood of entering the industry. According to Endsley

(2015), utilizing a game engine to develop games will be essential in creating a gaming portfolio.

An example of this is Unreal, a game engine run on C++ with its own integrated development

environment (Endsley, 2015). An integrated development environment is “a programming

module that’s packaged as an application program, usually with a code editor, a compiler, a

debugger, and an interface builder” (Endsley, 2015, p 82).

Dominic Camargo, my mentor, is another stakeholder. I met Mr. Camargo at the Game

Developers Conference this year in San Francisco. Dominic is an Engineering Manager with

Blind Squirrel Games. He has been developing games since 2013 and worked on titles such as

Bioshock: The Collection as well as the Disney Infinity games. Mr. Camargo has a B.S. in

Computer Science from Cal Polytechnic State University as well as Masters in Interactive

Technology from Southern Methodist University. Mr. Camargo will have access to the GitHub

site to be able to conduct weekly analysis of the project and offer any feedback he may have. He

will also be able to provide final testing of the product. Mr. Camargo may find a sense of

achievement in helping mentor me into a software engineer within the game development

community. Mr. Camargo will lose time in helping provide feedback on my project.

Developers as well as players in the gaming community will be impacted by the project.

When done correctly, this game prototype could be the spark that leads to a successful game that

gets shipped. Joy can be attained through playing my game and building a game on top of it. On

the contrary, there are always critics and there may be some who disdain the gameplay of the

game.
Cortez Page 8

Feasibility

Game projects done from a first-person perspective is not a new concept. The challenge

is in creating a fun and engaging platform with unique gameplay ideas to differentiate the game

from others. Inua, a game from students at SMU Guildhall, was a first-person 3D single-player

action puzzler where the player uses ice and fire in various ways throughout the game. This

project was much larger in scope to my current project as it was created over 18 weeks with a

team of 14 developers; however, its core mechanics are somewhat similar. It is a game done in a

first-person perspective that utilizes abilities to solve puzzles. The team consisted of 5

programmers who had never worked in Unreal Engine 4 before just as I have not. The team goes

on to say that the engine was easy to pick up. The engineers focused on fully immersing their

player by subtle changes in the camera such as dipping downward when landing from a jump.

This was done using Unreal Engine 4’s timeline feature. They also focused on optimizing

performance so that the game would not suffer from steep drops in framerate. The game makes

use of A.I. in the form of a Golem who may attack the player and roam the level.

Another game project like mine is Crystalline from Rochester Institute of Technology.

The similarity is in the creation of a first-person perspective game. This game project focused on

multiplayer rather than single player. The game focuses on the ability for the player to modify

their weapons. Modeling was done through the modeling program Maya. I planned to use

Blender for my modeling. The game was conceived from prior prototyping of two previous

games. The team ended up taking what they liked from the two previous games and made them

into their own. This goes to show that what you originally intend for your project is dynamic and

you must decide throughout what to keep and what to toss out. The team initially used Git and

SourceTree as a repository but ended up switching to Perforce late in the development cycle for
Cortez Page 9

storage capacity reasons and its easy integration with Unreal Engine. As I would like

implemented, the game utilizes both a health meter and shield meter. The game also makes use

of a user interface to start it.

Upon research in looking for a game that makes use of a player seamlessly shrinking and

growing back to original size, it was discovered that there are very few cases of this. This makes

my prototype significant as on offering to other game developers to utilize. A couple of cases

where it is show that a player shrinks is the use of Ant-Man in the game LEGO Marvel Super

Heroes. In the game, the player can shrink with the press of a button and grow to original size

with the press of a button. My prototype is different in that the player can shrink to different

levels of size.

Another inherently necessary function of the game is the ability of the player to move

freely throughout the 3D space. Some character options are to move, strafe, sprint, grow, and fly.

The player can manipulate objects such as flipping a switch or taking an item and keeping in

inventory to use later. Every game must consist of at least one camera; otherwise, it would be a

game of only sound. I gave the player the choice to use a 1st person or 3rd person perspective.

The perspective will change to 3rd person when a player decides to shrink but they will be given

a chance to go back to a 1st person view. According to Pluralsight (2014), the first things to be

judged by a player are the character, controls, and camera. Therefore, I spent a lot of time on

perfecting these functions.

For the game to feel fun, a sense of danger was implemented. This is in the form of the

player losing their life when confronted with dangerous objects. A life meter is visible to show

the player how much life they have. Challenging the mind is an important feature in games. The

game may be won by solving a puzzle at the end of it.


Cortez Page 10

Unreal Engine has a framework that it is built upon that closely resembles the Model,

View, Controller design pattern. The Model consists of the Player State, Game State, HUD, and

Camera objects, the View consists of the Pawn and other Actors in the game, and the Controller

consists of the Player Controller and AI Controller (Epic Games, Inc., 2018). In designing my

game, I studied Epic’s source code for Unreal Engine 4 and implementing a similar design patter

for my own code. This ensured a cohesive structure throughout the project.

Functional Decomposition

The project consisted of three phases to completions as outlined in the chart below.

Phase Description Timeline

Concretize textual
requirements into basic
prototype requirements and
Phase I implement the requirements
in Unreal Engine. This will 5 Weeks
involve developing the core
mechanics such as game
goals, player challenges,
actors in the game and actor’s
actions.
Communicating the core
mechanics in the game by
Phase II designing a level around
them. Design the level and 2 Weeks
user interface for the game.
Construct game mechanics in
the level, create lighting
scheme, and essential content.
Polish the game. This will be
Phase III implemented if time allows.
Create textures for the game 1 Weeks
and polish the overall look.
Conduct game testing.

I also created a project timeline which was shared with Dominic Camargo. (See Appendix Item
Cortez Page 11

A). A controls list was also necessary to convey the controls of the game. (See Appendix Item B).

There was no charge to the software being used for this project. Unreal Engine 4, Microsoft

Visual Studio, and Blender allow developers to work on them free of charge. As mentioned

before, Epic Games only charges should you sell your product built in Unreal Engine 4. The only

cost I accrued was purchasing an animation template for flight animations for $30. The resources

used include:

• Personal Computer

• Computer Monitor

• Internet Access

• Unreal Engine 4

• Microsoft Visual Studio 2017

• Keyboard

• Mouse

• Microsoft XBOX One Wireless Controller

The major milestones for the project coincided with the completion of the 3 phases of the

project. The first milestone was at the end of Phase I. At the end of this phase, the core

mechanics of the game/character were in place and fully functioning. The next major milestone

coincided with the completion of Phase II. At the end of this phase, a user interface and level

were in place to showcase the core game/character mechanics of Phase I. The last milestone was

the completion of the game prototype. To follow suit, this coincided with the completion of

Phase III. At the end of this phase, a fully functional game prototype was in place for designers

to build upon.

Selection of Design Criterion


Cortez Page 12

As is with any project there were risks and dependencies. A risk was that this was the

first time that I had built a game in Unreal Engine 4. Although much had been studied regarding

the process of building in Unreal Engine, it had not been done before. An analysis of other

projects with similar knowledge of Unreal showed that it could be done. Because file sizes for a

3D video game are huge, I had to do research in how to add this to Github. It was discovered that

Git LFS (Large File Storage) could be used for just this use. This was found at https://git-

lfs.github.com/. My knowledge of object-oriented programming and C++ formed a backbone in

beginning the project. The project was highly dependent on access to both my personal computer

and to the internet. Should either have been compromised then it would have been difficult to do

any work on the project. To alleviate this, version control was implemented in Github. Should

my computer fail, I would then have access to the source code and download to a new computer.

Another major dependency was that of access to both the internet and electricity. Should a major

disaster occur, then such access would have been hard if not impossible to come by. The project

at that point may have been postponed until another semester.

Final Deliverables

The outcome for the project is that a game prototype was made that is both fun and

unique enough to be taken by a design team to build upon and create a complete game. The game

has both fun and unique gameplay with puzzle solving focused on the player’s ability to both

shrink and grow. The game is downloadable and can be installed by anyone to use on a PC with

the necessary specifications to run the program. A webpage detailing the capstone project is

hosted on my website www.jcortezilp.weebly.com. As mentioned before, final approval of the

project was given by Software Manager, Dominic Camargo, with Blind Squirrel Games.

Approach/ Methodology
Cortez Page 13

To plan and design the project, I utilized the extensive tutorials given from

unrealengine.com as well as other resources such as YouTube videos and discussion forums for

Unreal Engine. Knowledge of object-oriented programming as well as problem solving was

called upon. The timeline of the project was 8 weeks. The project is submitted on GitHub to be

shared with others. I kept a calendar of time to work on the game to not get off track with it. At

least 14 hours a week were spent of planning and developing the game prototype. Tasks were

created with Pivotal Tracker to make sure I was on track to completion of a prototype. If an item

was too cumbersome or I found it too difficult to implement in the allotted time, it was scrapped

for later use. Every week feedback was asked from the mentor Dominic Camargo.

Legal Considerations

As I developed the game prototype it was important to analyze the legal considerations

associated with creating the game. The prototype will be shared with others, and it should not be

assumed that my work will automatically be protected when discussing with professors and

mentors alike. The prototype may be useful in selling at a future time or creating a full game.

One way to get around this would have been to have people who view my code to sign a non-

disclosure agreement. This could have done as a sole proprietorship since I was the only one

working on the game. Time did not a lot for me to get this done. Once the prototype is complete

and it may be good enough to sell, then copyrighting or patenting the prototype may be the next

step. In my attendance at the Game Developers Conference, I have made friends with a lawyer

who specializes in indie game development who may be able to help me with the process of

patenting.

Another thing that may have to be considered is that there will be licensing fees should

the product be sold for revenue. “Epic Games charges a 5% royalty based on gross revenue for
Cortez Page 14

the use of Unreal Engine 4 under the free license agreement” (Custom License). Care was taken

with any artwork or sound used as there may be a need to obtain licensing. To avoid this, I used

assets that are license free or created by myself.

Given that the game will have a small level of violence in it, a disclaimer was placed with

the game that it should not be used by children under 6 years old. This is a formality and more of

an ethical concern as the state of Texas does not have any state statute regarding violence and

video games that I am away of according to Standler, Ronald B.

Game designers must consider many ethical and legal concerns when designing their

game and I hoped I was able to adhere to an ethical set of principals when creating my game and

followed the law to the best of my ability.

Ethical Considerations

A major ethical concern during the project was that of considering my audience. I had to

decide if the game should be considered for all to play or was meant for a more mature audience.

To mitigate this, I strived to create a game that can be appreciated by a wider audience. Care was

taken in considering the violence and mature content in the game. Being a first-person shooter

with weapons, it is inherent that the game will have some violence in it. This means that the

game would not be suitable for young children. Being a game that will not be sold or mass

produced, a disclaimer at the beginning of the game was placed to specify an age range.

Research on similar games was done on how the mainstream rating system rates such games.

Another major ethical concern is the game may have the potential to be addicting to

some. An individual may become obsessed with the game and play it for long hours at a time.

Although such an issue cannot be prevented entirely, period warnings of taking a break during

gameplay can be incorporated into the game to help alleviate addictive play. I think doing this in
Cortez Page 15

a humorous manner can help grab the players attention.

As mentioned before, given that the game has some sort of level of violence in it, I feel

that young children under 10 years old will be negatively impacted by playing such a game. The

appropriate warnings are in place in the game but ultimately it us up to the child’s guardian to

make sure young children do not play the game. This is a long-term impact as once the game

becomes available on the internet over open distribution it may eventually get in the hands of a

child who may be susceptible to violence at a young age and show violence on the playground

because of what they saw in a game. To try and mitigate this, I am password protecting the game

so that my professor and anyone with the password may be the only ones to play it.

The project had a potential short-term impact in my relationship with my family. During

the project, I dedicated long hours to the game and spent less time with my family. This

happened as working on the project gave light to new problems and challenges and forced me to

work even more during the end of the project. I helped to mitigate this by creating a calendar of

work time and abiding by that schedule to not fall too far behind on the project.

Timeline/ Budget

Most milestones were met for the completion of the project. As I strove to solve the

numerous problems, I found that I would uncover new problems. As a result, the scope of the

project grew, making it harder to accomplish all tasks. As shown in Appendix – Item 1, the

ability for the player to be able to be in an altered scaled state was not accomplished. It was more

important to have a playable game from start to finish that adding such feature with the

constrained time. The other milestone that will have to be looked at after capstone, is for the

player to have the ability to use and acquire weapons. This is a larger undertaking than originally

thought, and I have a larger respect for the amount of work that goes into creating a 3D game.
Cortez Page 16

Also, as of this writing, I was not able to get a title screen in the game, but I hope to easily have

this up for the Final Capstone Presentation Video. In my original proposal, I stated that I would

be operating on a budget of $0. While this might have been great to achieve, I found it necessary

to pay for some pre-rendered animation with regards to my character’s flying ability. Before

introducing the purchased animation, flight for the character was clunky and unappealing. I was

able to purchase a set of animations to use for flight from Epic Games Marketplace for $29.99.

This was a necessary expense that was worth the cost as it helped me explore how to work with

animations in both C++ and Unreal Blueprints Visual Scripting.

Usability Testing/Evaluation

Usability Testing was done throughout the entire process of building the game. I invoked

the playtest method in which testers play the game to test (Davis). In the playtest method surveys

are given with playable versions of the game. According to Davis, the best way to playtest is to

focus on the initial experience of the game. Another way to test would be to implement different

control schemes after Phase II, so that players can give feedback as to the controls they most

like. Mr. Camargo and other play testers I found acted as the primary contact for usability

testing. To do this a survey given on Survey Monkey asked questions at the end of each phase as

to the progress of the game. I have included a sample survey (Appendix Item 3). The code itself

was also be evaluated on a weekly basis by Mr. Camargo to give any relevant pointers on how

the project was coming along. This was done with a sharable Github link to Mr. Camargo. I

received helpful feedback from Mr. Camargo. After the first 2 weeks of submitting to Github,

Mr. Camargo gave some helpful feedback as he was having trouble loading on his computer. He

said:

“A good way to double check that you’ve uploaded everything is by downloading your
Cortez Page 17

depot from GitHub and try and open it as a separate project in unreal (you might have to

rename the base project folder). If it’s any consolation, this type of problem is a very real-

world issue. Consistently, devs will fix a bug and submit it to the depot, but then the bug

shows up on someone else’s machine. The classic “Well it works on my machine” tends

to be heard a lot. But it’s important that engineers consistently double check they didn’t

forget to submit anything necessary, so it can work for everyone. So you’re not alone

here by any means. In fact – you’re definitely getting real world experience!”

Mr. Camargo also gave me some great insight in project planning. He said:

“Thanks for the fix! It looks like I can load the map now, however, some of the assets are

still missing. Can you please remove the “*_BuiltData.uasset” from your .gitignore file. I

believe we need this to properly load everything in the map. In regards to your timeline, I

think you made some great priority decisions with your tasks. However, I think you have

a lot challenging tasks due at the same time for your 5/29 date. Maybe consider swapping

tasks 9 and 10 (since they are related) with 11 and 12, as 11 and 12 are more design

oriented and not entirely reliant on new functionality. Also, because 7 and 8 are kind of

larger tasks, I’d like to see you break them down into smaller tasks (e.g., 7.1, 7.2, etc.).

For instance, with the inventory, you will have to create UI along with the functionality

of picking objects and how all your inventory will be stored. This a bunch of different

work in which some elements would need to be completed before others. The same can

be said for #8. I imagine you’ll have to implement a timer system that currently isn’t

there? Additionally, pickups/interactable objects will have to be added to the game as

well it seems. If this is the case, this is a lot to do for just one task and should be broken

up into a few smaller tasks. The general train of thought here is that anything relatively
Cortez Page 18

trivial is fine to be left as one line (e.g., task #5). But any task that requires maybe a

couple of steps to complete should be listed as separate child tasks, each with their own

estimate of how long they should take.”

About halfway through the development cycle, Mr. Camargo gave some great feedback with

regards to the code structure. He said:

“First off, thank you for updating your task list! I like the breakdown that you’ve given

for the larger tasks. The granularity looks perfect. I’m a little concerned about your

inventory task (task #7) mainly because of the amount of time it will take to implement

all those systems. I’m not sure that you should remove anything from your schedule yet,

but I would potentially stretch out the due date and evaluate how that change impacts

your schedule. Again, this happens in the real world all the time, so definitely don’t fret.

Pay attention to how you resolve the issue though. I’d also like to give a couple notes

about your coding style: Major note: NO MAGIC NUMBERS! Haha. For instance, in

Capstone_CortezCharacter.cpp: if (currentScale.GetMax() > NormalSize + .01f) Always

make sure that any magic numbers like this are declared as constants or something

similar. Particularly since you use this value in multiple lines, you wouldn’t have to

change all the lines that use this value if there was a variable here instead. You would

merely have to change the value of the variable. Minor note: Try not to leave in code that

is commented out. One of the advantages of using source control is that you can always

see a history of what you were doing before. So if you’re scared of losing code, you’d

always be able to find it later on. Further, code is much more readable when you take out

commented code. This definitely helps other team members. That’s all I got for now.

Your progress looks great so far! I hope the inventory comes along well!”
Cortez Page 19

At the end of week 6, Mr. Camargo was able to test what I had at the time. The client was able to

load some assets from past iterations but could not load current iteration from git. Mr. Camargo

shared on thoughts of what they could access at the time. Many assets added through blueprints

and on the game map could not be loaded. The client was able to move the player, toggle camera

without bugs, use grow/shrink functions. It seems that abilities that were also handled by

blueprints or the editor map could not properly load. Mr. Camargo could not see items placed in

level for pickup or access the inventory. The client could not properly use the jetpack. All these

functions worked flawlessly on my computer, so this had to do with proper transfer/

downloading of assets. Mr. Camargo said that it’s good that I spent a lot of time on the camera

and movement functions. The client suggested adding aspects to harm player, add a few level

textures to see how memory management works with that, and adding the timer function for the

character’s grow/ shrink ability. Mr. Camargo also suggested I learn to package the build, so

someone may just download the game and play. My suspicion was that the client may not have

used Git LFS to pull the file. Git LFS is used for large file storage on GitHub and it is necessary

for both parties to have to upload/ download files.

Final Implementation

Development of a 3D game in Unreal Engine is a massive undertaking. I have just

scratched the surface on building a full-fledged game. For this reason, I purposefully built a

prototype on which to build upon. As of this writing, there were 50 commits to Github that were

submitted over the course of 7 weeks. There have been 5078 lines of code added to and 778 lines

of code deleted from the Github repository. As can be seen in Appendix Item D and Appendix

Item E, the development cycle mirrored an Agile focus in which sprints were done where large

amounts of data was developed in cycles. Commits gained in momentum after receiving
Cortez Page 20

feedback from Mr. Camargo regarding providing commits more often. The entirety of coding

was done in Microsoft Visual Studio in C++. The main project consists 16 main classes and the

numerous UE4 classes that are included in the project. The main class is Capstone_Cortez.cpp. It

was learned that the header class needed to be changed to #include Engine.h instead of

EngineMinimal.h so that I could access all Unreal’s source code. The build class is a .cs file and

needed to include the private dependencies of “Slate” and “SlateCore” for use of text editing

within the game. Capstone_CortezCharacter.cpp is the main logic function for the game and

includes all the methods and logic surrounding my character. This file consists of 54 methods

and over 1000 lines of code. The build of the character and associated camera are done within

the Capstone_CortezCharacter() function. The BeginPlay() function starts the game and the

Tick(float Deltatime) function is an important function that is called every frame. This function

conducts many checks every frame to implement various functions as needed. The functions that

enable the character to seamlessly grow and shrink are called within the Tick() function so that

the growth/ shrinking appears seamless throughout each frame. Here is an example of the growth

algorithm:

// Ability to have seamless growth


if (bPressedGrow && IsThirdPersonMode() && currentScale.Size() < GrowMaxSize -
superMinorIncrement && IsWalkMode())
{
GrowthFactor = 1.0f;

SetActorScale3D(currentScale + (GrowthFactor*minorIncrement));
CurrentBoomLength3P = CurrentBoomLength3P + (GrowthFactor*doubleIncrement);
//Needed to adjust 3rd person camera boom
CameraBoom->TargetArmLength = CurrentBoomLength3P;

if (currentScale.GetMax() > MaxScale.GetMax() - minorIncrement)


{
SetCharacterScaleMode((CharacterScaleMode::Type)
CharacterScaleMode::MaxScale);
}

// Increase movement speed when larger than normal


if (currentScale.GetMax() > NormalSize + minorIncrement)
{
Cortez Page 21

GetCharacterMovement()->UCharacterMovementComponent::MaxWalkSpeed =
GetCharacterMovement()->UCharacterMovementComponent::MaxWalkSpeed +
(GrowthFactor*quadIncrement);
GetCharacterMovement()->UCharacterMovementComponent::Mass =
GetCharacterMovement()->UCharacterMovementComponent::Mass +
(GrowthFactor*doubleIncrement);
GetCharacterMovement()->UCharacterMovementComponent::JumpZVelocity =
GetCharacterMovement()->UCharacterMovementComponent::JumpZVelocity +
(GrowthFactor*quadIncrement);
GetCharacterMovement()-
>UCharacterMovementComponent::JumpOffJumpZFactor = GetCharacterMovement()-
>UCharacterMovementComponent::JumpOffJumpZFactor + (GrowthFactor*quadIncrement);
GetCharacterMovement()->UCharacterMovementComponent::MaxStepHeight =
GetCharacterMovement()->UCharacterMovementComponent::MaxStepHeight +
(GrowthFactor*doubleIncrement);
GetCharacterMovement()->UCharacterMovementComponent::GravityScale =
GetCharacterMovement()->UCharacterMovementComponent::GravityScale +
(GrowthFactor*minorIncrement);

}
// Reset Movement Stats when within normal size range
else if (currentScale.GetMax() < NormalSize + minorIncrement &&
currentScale.GetMax() > NormalSize)
{
GetCharacterMovement()->UCharacterMovementComponent::MaxWalkSpeed =
600.0f;
GetCharacterMovement()->UCharacterMovementComponent::Mass = 1.0f;
GetCharacterMovement()->UCharacterMovementComponent::JumpZVelocity =
500.0f;
GetCharacterMovement()-
>UCharacterMovementComponent::JumpOffJumpZFactor = 0.5f;
GetCharacterMovement()->UCharacterMovementComponent::MaxStepHeight =
45.0f;
GetCharacterMovement()->UCharacterMovementComponent::GravityScale =
1.0f;

SetCharacterScaleMode((CharacterScaleMode::Type)
CharacterScaleMode::NormalScale);
}

// Makes it possible for character to initiate jetpack when half size


else if (currentScale.GetMax() > (NormalSize / doubleIncrement))
SetCharacterScaleMode((CharacterScaleMode::Type)
CharacterScaleMode::NormalScale);
}
else if(bPressedGrow && IsFirstPersonMode() && currentScale.Size() < GrowMaxSize -
minorIncrement && IsWalkMode())
{
GrowthFactor = 1.0f;
SetActorScale3D(currentScale + (GrowthFactor*minorIncrement));
CurrentBoomLength3P = CurrentBoomLength3P + (GrowthFactor*doubleIncrement);
//Needed to adjust 3rd person camera boom

if (currentScale.GetMax() > MaxScale.GetMax() - minorIncrement)


{
SetCharacterScaleMode((CharacterScaleMode::Type)
CharacterScaleMode::MaxScale);
}
Cortez Page 22

// Increase movement speed when larger than normal


if (currentScale.GetMax() > NormalSize + minorIncrement)
{
GetCharacterMovement()->UCharacterMovementComponent::MaxWalkSpeed =
GetCharacterMovement()->UCharacterMovementComponent::MaxWalkSpeed +
(GrowthFactor*quadIncrement);
GetCharacterMovement()->UCharacterMovementComponent::Mass =
GetCharacterMovement()->UCharacterMovementComponent::Mass + (GrowthFactor
*minorIncrement);
GetCharacterMovement()->UCharacterMovementComponent::JumpZVelocity =
GetCharacterMovement()->UCharacterMovementComponent::JumpZVelocity +
(GrowthFactor*quadIncrement);
GetCharacterMovement()-
>UCharacterMovementComponent::JumpOffJumpZFactor = GetCharacterMovement()-
>UCharacterMovementComponent::JumpOffJumpZFactor + (GrowthFactor*quadIncrement);
GetCharacterMovement()->UCharacterMovementComponent::MaxStepHeight =
GetCharacterMovement()->UCharacterMovementComponent::MaxStepHeight +
(GrowthFactor*doubleIncrement);
GetCharacterMovement()->UCharacterMovementComponent::GravityScale =
GetCharacterMovement()->UCharacterMovementComponent::GravityScale +
(GrowthFactor*minorIncrement);
}
// Reset Movement Stats when within normal size range
else if (currentScale.GetMax() < NormalSize + minorIncrement &&
currentScale.GetMax() > NormalSize)
{
GetCharacterMovement()->UCharacterMovementComponent::MaxWalkSpeed =
600.0f;
GetCharacterMovement()->UCharacterMovementComponent::Mass = 1.0f;
GetCharacterMovement()->UCharacterMovementComponent::JumpZVelocity =
500.0f;
GetCharacterMovement()-
>UCharacterMovementComponent::JumpOffJumpZFactor = 0.5f;
GetCharacterMovement()->UCharacterMovementComponent::MaxStepHeight =
45.0f;
GetCharacterMovement()->UCharacterMovementComponent::GravityScale =
1.0f;
SetCharacterScaleMode((CharacterScaleMode::Type)
CharacterScaleMode::NormalScale);
}

// Makes it possible for character to initiate jetpack when half size


else if (currentScale.GetMax() > (NormalSize / doubleIncrement))
SetCharacterScaleMode((CharacterScaleMode::Type)
CharacterScaleMode::NormalScale);
}

As can be seen from this code, the ability to have seamless growth created many other challenges

that must have been dealt with such as adjustment of the camera distance from the character and

character physics. The ability to check if the game is won or lost is also checked every frame to

instantly notify the player of such an event.


Cortez Page 23

To read input from a controller, the SetPlayerInputComponent() method was created. All

the movement functions of the character appear in Capstone_CortezCharacter. Cpp as well. The

character has 2 camera modes, one for first person view and one for third person view; 3 scale

modes, MaxScale, MinScale, NormalScale; and 2 movement modes, Walking and Flying. The

design of these modes involved enums where switch statements were called to determine the

different modes. Extensive use of object-oriented programming was used here and throughout

the development process. It took many hours to get the logic right for this. Here is an example of

such logic:

void ACapstone_CortezCharacter::IncrementalGrow()
{
if (IsWalkMode() && IsThirdPersonMode())
{
int newCharacterScaleMode = (int)CharacterScaleModeEnum + 1;

if (newCharacterScaleMode == 3) newCharacterScaleMode =
CharacterScaleMode::MaxScale;
SetCharacterScaleMode((CharacterScaleMode::Type) newCharacterScaleMode);
}

// Cycle Shrink States


void ACapstone_CortezCharacter::IncrementalShrink()
{
if (IsWalkMode() && IsThirdPersonMode())
{
int newCharacterScaleMode = (int)CharacterScaleModeEnum - 1;

if (newCharacterScaleMode == -1) newCharacterScaleMode =


CharacterScaleMode::MinScale;
SetCharacterScaleMode((CharacterScaleMode::Type) newCharacterScaleMode);
}

// Set the scale mode


void ACapstone_CortezCharacter::SetCharacterScaleMode(CharacterScaleMode::Type
newScaleMode)
{
CharacterScaleModeEnum = newScaleMode;
UpdateForCharacterScaleMode();

// Determines character scale values


Cortez Page 24

void ACapstone_CortezCharacter::UpdateForCharacterScaleMode()
{
// Offset Z location so character won't go through floor when growing
FVector GrowLocationOffset = FVector(0.0f, 0.0f, 350.0f);

// Offset Z locaton so character won't fall when shrinking


FVector ShrinkLocationOffset = FVector(0.0f, 0.0f, 50.0f);

// Changes visibility of first and third person meshes


switch (CharacterScaleModeEnum)
{
case CharacterScaleMode::MinScale:
if (!bPressedGrow && !bPressedShrink)
{
SetActorScale3D(MinScale);
CurrentBoomLength3P = 130.0f; //Needed to adjust
3rd person camera boom
CameraBoom->TargetArmLength = CurrentBoomLength3P;
}
// Make sure we don't readjust Z location if already min size
if (!IsAlreadyMinScaleMode && (!bPressedGrow && !bPressedShrink))
SetActorRelativeLocation(GetActorLocation() - ShrinkLocationOffset);
IsAlreadyMinScaleMode = true;
IsAlreadyMaxScaleMode = false;
IsAlreadyNormalScaleMode = false;
break;
case CharacterScaleMode::NormalScale:
if (!bPressedGrow && !bPressedShrink)
{
SetActorScale3D(NormalScale);
CurrentBoomLength3P = 300.0f; //Needed to adjust
3rd person camera boom
CameraBoom->TargetArmLength = CurrentBoomLength3P;
GetCharacterMovement()->UCharacterMovementComponent::MaxWalkSpeed =
600.0f;
GetCharacterMovement()->UCharacterMovementComponent::Mass = 1.0f;
GetCharacterMovement()->UCharacterMovementComponent::JumpZVelocity =
500.0f;
GetCharacterMovement()-
>UCharacterMovementComponent::JumpOffJumpZFactor = 0.5f;
GetCharacterMovement()->UCharacterMovementComponent::MaxStepHeight =
45.0f;
GetCharacterMovement()->UCharacterMovementComponent::GravityScale =
1.0f;
}
if (IsAlreadyMaxScaleMode && (!bPressedGrow && !bPressedShrink))
SetActorRelativeLocation(GetActorLocation() - GrowLocationOffset);
else if (IsAlreadyMinScaleMode && (!bPressedGrow && !bPressedShrink))
SetActorRelativeLocation(GetActorLocation() + ShrinkLocationOffset);
IsAlreadyNormalScaleMode = true;
IsAlreadyMinScaleMode = false;
IsAlreadyMaxScaleMode = false;
break;
case CharacterScaleMode::MaxScale:
if (!bPressedGrow && !bPressedShrink)
{
SetActorScale3D(MaxScale);
Cortez Page 25

CurrentBoomLength3P = 1256.0f; //Needed to adjust


3rd person camera boom
CameraBoom->TargetArmLength = CurrentBoomLength3P;
GetCharacterMovement()->UCharacterMovementComponent::MaxWalkSpeed =
1800.0f;
GetCharacterMovement()->UCharacterMovementComponent::Mass = 6.0f;
GetCharacterMovement()->UCharacterMovementComponent::JumpZVelocity =
3000.0f;
GetCharacterMovement()-
>UCharacterMovementComponent::JumpOffJumpZFactor = 3.0f;
GetCharacterMovement()->UCharacterMovementComponent::MaxStepHeight =
270.0f;
GetCharacterMovement()->UCharacterMovementComponent::GravityScale =
6.0f;
}

// Make sure we don't readjust Z location if already max size


if (!IsAlreadyMaxScaleMode && (!bPressedGrow && !bPressedShrink))
SetActorRelativeLocation(GetActorLocation() + GrowLocationOffset);
IsAlreadyMaxScaleMode = true;
IsAlreadyMinScaleMode = false;
IsAlreadyNormalScaleMode = false;
break;

default:
break;
}
}

The ability for the character to change from viewing their inventory is also within the

Capstone_CortezCharacter.cpp file.

Another major challenge was figuring out how to make the transition from the walking

mode to flying mode appear seamless and natural. Originally the character would continually

slide across the ground while the change mode animation was playing. This of course did not

look right as the player’s feet were stationary but sliding across the floor while pressing a button

on their wrist to activate their jetpack. It was discovered that asynchronous operations may be

used to create a delay and in implementing the next function. This was handled through the

FLatentActionInfo class from Unreal. An example of the logic can be seen here:

void ACapstone_CortezCharacter::SetMovementMode(CharacterMovementMode::Type
newMovementMode)
{
// Set up a latent action timer so movement is not allowed during animation
FLatentActionInfo LatentActionInfo;
Cortez Page 26

LatentActionInfo.CallbackTarget = this;
LatentActionInfo.ExecutionFunction = "ReinitializeMovement";
LatentActionInfo.UUID = 123;
LatentActionInfo.Linkage = 0;

MovementModeEnum = newMovementMode;
UpdateForMovementMode();
if (newMovementMode == 1)
UKismetSystemLibrary::Delay(this, 2, LatentActionInfo); // Set
delay for changing to flight mode
else
UKismetSystemLibrary::Delay(this, 1.5, LatentActionInfo); // Set
delay for changing to walking mode

This same logic is used to create a delay when restarting the game after it is won or lost.

Capstone_CortezGameMode.cpp handles the logic behind determining the heads-up display to

show on screen and the state of the player, i.e. Whether they are Playing, GameOver, or

GameWon.

In designing the ability for the character to pickup objects, a mentality of expandability

was used. A base class of Interaction.cpp was created to handle the various types of interactions

whether it’s pickup or use an item. This allows for expandability by building upon for other

interactions of the player, i.e. Engage in dialog or push a switch. Several other classes inherit

down the class hierarchy, i.e. Interaction.h > Pickup.h > Pickup_Health.h. InventoryHUD.cpp

handles the logic behind drawing the various HUDs on the player’s screen at the appropriate

time.

In the interest of time some functions were implemented through Unreal’s Visual

Scripting Language, Blueprints. Examples of this can be seen at Appendix – Item F. It was also

necessary to use Unreal Engine to work with the animations and build the level, examples of this

use can be seen at Appendix -Item G. The project is available to download the source code from

Github so that a development team may expand upon it. I have also created a package file so,
Cortez Page 27

anyone can play the game by running the executable file on their computer. The creation of this

Game Prototype has been a great experience in insight to development within the industry of

Game development. Please enjoy these in game screenshots. (See Appendix H)

Conclusion

The problem of creating a unique game prototype that is both fun, thought provoking, and

new to gamers has been achieved. I have heard many times from individuals that games are

never complete, management just had to choose a stopping point. This is so true with regards to

my project. I feel that I have just scratched the surface of game development. The main goal of

highlighting proper use of object-oriented program in Unreal Engine and for other designers to

build on the custom physics and unique gameplay was achieved. As stated before, few games

have implemented the ability for a character to shrink and grow on demand. The model, view,

controller design pattern was implemented throughout the game with several aspects of object-

oriented programming being used such as Encapsulation, Data Abstraction, Polymorphism, and

Inheritance. Many hours of research were dedicated to game design principles and practices.

Being an individual project, I now understand why most AAA games are created with teams of

100’s of individuals. So much more can be accomplished with several people working on a

project. Given the time I had to work on my Unreal Project prototype, I was satisfied with my

product. This is not the end of Scalar, I plan to continue building on the prototype and use it as

leverage for gaining access to show what I can do within the industry. I am thankful for the

guidance of Mr. Camargo with Blind Squirrel games, and the entire faculty at California State

University – Monterey Bay who have helped me in my endeavor to pursue my passion. My

passion is to enter the game industry as a developer as I hope that my work may bring a bit of joy

to people’s lives and take stress away from the crazy world we live in now.
Cortez Page 28

References

Davis, John P. (2005, October). A survey method for assessing perceptions of a game: The

consumer playtest in game design. The International Journal of Computer Game

Research. Volume 5, Issue 1. Retrieved from

http://www.gamestudies.org/0501/davis_steury_pagulayan/

Endsley, K. (2015). Video game design. New York, NY: Cavendish Square Publishing, LLC

Epic Games, Inc. (2018). Gameplay Framework Quick Reference. Retrieved from

https://docs.unrealengine.com/en-us/Gameplay/Framework/QuickReference

Pluralsight. (2014, September 22). Character, Controls, Camera: The 3 C’s of Game

Development. Retrieved from https://www.pluralsight.com/blog/film-games/character-

controls-camera-3cs-game-development

Standler, Ronald B. (2006, December 31). State Statutes Regulating Video Games in the USA.

Retrieved from http://www.rbs2.com/ssrvg.pdf

Weststar, J., Andrei-Gedja, M. (2016, January 22). Developer Satisfaction Survey 2015 Industry

Trends and Future Outlook Report. International Game Developers Association.

Retrieved from

https://c.ymcdn.com/sites/www.igda.org/resource/resmgr/Files__2015_DSS/IGDA_2015

_DSS_Industry_Trend.pdf
Cortez Page 29

Appendix – Item A

1. Player can play in both first person and switch to third person DONE

2. Player can move throughout a 3D rendered environment DONE

3. Player can shrink and grow in size DONE

4. Shrink and grow is seamless and with limit bounds - Due by 5/22/18

1. Adjust camera boom when shrink and grow - DONE

2. Adjust movement speed when larger than normal - DONE

3. Adjust Jump and Fall Velocity when larger than normal - DONE

4. Create function to grow to full/ min size instantly or implement incremental grow/shrink? -

DONE

5. upon full shrinking size can fly and move more quickly – Due by 5/22/18 - DONE

6. When player shrinks, the perspective will change to third person but can be switched back

to first person – Due by 5/22/18

7. Player can manipulate objects and store certain objects in an inventory – Due by 6/1/18

1. Create storage array for items - DONE

2. Create objects for player to interact with and disperse in level

3. Create function for player to interact with items - DONE

4. Create function for player to take item - DONE

5. Create UI to view items to choose which to use - DONE

6. Create function for player to use items - DONE

8. Player can only shrink for a certain time but can collect items to increase time shrunken –

Due by 6/5/18

1. Create timing system that shows player is not in normal state that keeps track of time for

player not in normal state

2. Create function to revert to normal size when timing system is out

3. Create HUD element to show amount of grow/ shrink time


Cortez Page 30

9. The player will have to solve a puzzle to exit the level – Due by 6/6/18 - DONE

10. The player will have to utilize their shrunken ability to solve the puzzle – Due by 6/6/18 -

DONE

11. Player will have a life bar to indicate life left and a shield bar to do the same – Due by

6/6/18 - DONE, life text

12. Various level aspects may try to harm the player– Due by 6/9/18 - DONE

13. Title screen will give the player the option to start game and choose controls – Due by

6/10/18

14. The player can use various weapons acquired in the game – Due by 6/12/18

15. Add textures and make game look nice – Due by 6/12/18 - DONE
Cortez Page 31

Appendix – Item B

Controls

W, A, S, D - Move forward, left, right, back

Mouse - Look around

Spacebar - Jump

C- Toggle 1st/ 3rd person Camera

R- Smooth Grow

F- Smooth Shrink

E- Take item / Interact with object

V- Open inventory

Q- Grow to largest size or incremental growth

X- Grow to smallest size or incremental shrink

Z- Turn on jetpack, can only be done when half size or smaller

Right Mouse Click - JetPack Up

Left Mouse Click - JetPack Down

Esc - End the game


Cortez Page 32

Appendix – Item C

Sample Survey

1. What did you think of the game overall in terms of playability?

a. I couldn’t figure out what to do

b. I made it through without problems

c. I made it through with problems

2. What parts of the game did you like?

3. What parts of the game did you dislike?

4. How would you change the game?

5. List any problems you ran into


Cortez Page 33

Appendix – Item D
Cortez Page 34

Appendix – Item E
Cortez Page 35

Appendix – Item F
Cortez Page 36
Cortez Page 37
Cortez Page 38

Appendix Item – G
Cortez Page 39
Cortez Page 40
Cortez Page 41

Appendix – Item H
Cortez Page 42

Você também pode gostar