33
DISTRIBUTION A: Approved for public release; distribution unlimited. Approval given by 88 ABW/PA, 88ABW-2018-4671, 20 Sep 2018. Developed by: Aaron Brumbaugh [email protected] Summer, 2017 Virtual Escape Room Challenge Problems and Resources

Virtual Escape Room › ... · Gaming Research Integration for Learning Laboratory® (GRILL®). The solution that follows was created within a five week timeframe. It is important

  • Upload
    others

  • View
    1

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Virtual Escape Room › ... · Gaming Research Integration for Learning Laboratory® (GRILL®). The solution that follows was created within a five week timeframe. It is important

DISTRIBUTION A: Approved for public release; distribution unlimited. Approval given by 88 ABW/PA, 88ABW-2018-4671, 20 Sep 2018.

Developed by:

Aaron Brumbaugh

[email protected]

Summer, 2017

Virtual Escape Room

Challenge Problems and Resources

Page 2: Virtual Escape Room › ... · Gaming Research Integration for Learning Laboratory® (GRILL®). The solution that follows was created within a five week timeframe. It is important

Virtual Escape Room

Distribution A

TABLE OF CONTENTS

Table of Contents................................................................................................................................................... 2

1. The Challenge ................................................................................................................................................ 3

1.1. Key Questions ........................................................................................................................................ 3

1.2. Background and Application .................................................................................................................. 3

1.3. Potential Tools ....................................................................................................................................... 4

2. Aspects of a Solution ..................................................................................................................................... 4

2.1. Technology Resources ........................................................................................................................... 4

2.1.1. Hardware ...................................................................................................................................... 4

2.1.2. Software ....................................................................................................................................... 4

2.2. Potential Issues...................................................................................................................................... 5

2.2.1. Interacting with keypad ................................................................................................................. 5

2.2.2. Changing widgets .......................................................................................................................... 8

3. Example Game ............................................................................................................................................ 10

3.1. Door Bluebrints ................................................................................................................................... 11

3.2. Keypad Asset Blueprints....................................................................................................................... 13

3.3. Widget Blueprints ................................................................................................................................ 16

3.4. 3D Modeling and Game Assets ............................................................................................................. 19

3.5. Importing Video Textures..................................................................................................................... 22

3.6. Modifying 1st Person Template............................................................................................................. 29

3.7. Lighting ............................................................................................................................................... 32

Page 3: Virtual Escape Room › ... · Gaming Research Integration for Learning Laboratory® (GRILL®). The solution that follows was created within a five week timeframe. It is important

Virtual Escape Room

Distribution A

1. THE CHALLENGE

We live in a world where video games have evolved into rich, interactive experiences that are

enjoyed by people of all ages. Video games have the capability of placing players in unique

situations, and presenting players with problems that require careful and creative thought to

overcome. This medium has the potential to create an engaging and powerful experience for

students in the classroom. During this challenge, students will utilize a variety of computer

software in order to develop a Breakout/Escape Room-style puzzle-adventure game that

teaches players academic material and concepts as they progress through the game.

1.1. KEY QUESTIONS

How can students create a non-violent video game that teaches specific academic

content standards in an engaging way?

What video games exist that teach specific content (e.g., mathematics, science, social

studies) standards?

How are video games created?

What software is best suited for game development?

How can the game determine if a player’s answer is correct? How can the game allow

multiple “correct” answers to a question?

How will information/clues/teaching be incorporated into the game so that players who

are unfamiliar with the content can learn and progress through the game?

What gameplay elements can be incorporated to make the game more fun and/or

competitive?

How can 3D models be imported into a game engine?

How do video games impact the learning of specific content material?

How can students make their games accessible to a wider audience?

1.2. BACKGROUND AND APPLICATION

Video games and their development house great potential for teaching, learning, and the

acquisition of 21st century skills. In several studies, video games have shown to increase

students’ engagement and retention of key academic concepts. There have been seemingly few

studies, however, that focus on the creation of a game by high school students and how this

development task impacts student learning.

Page 4: Virtual Escape Room › ... · Gaming Research Integration for Learning Laboratory® (GRILL®). The solution that follows was created within a five week timeframe. It is important

Virtual Escape Room

Distribution A

1.3. POTENTIAL TOOLS

3D modeling tools such as SketchUp, 3DS Max, Blender, etc.

3D game engine software such as Unity3D, Unreal Engine 4, Source Engine, etc.

Programming can be introduced through software and online applications such as

Scratch, FreeMAT, Python, etc.

2. ASPECTS OF A SOLUTION

A solution was created during the summer of 2017 by this educator in collaboration with the

Gaming Research Integration for Learning Laboratory® (GRILL®). The solution that follows was

created within a five week timeframe. It is important to note that this is not the only solution to

the problem, nor is it intended to be the best method to solve the problem. The purpose of this

solution is to provide guidance for future use. This section details the software used to attain

the solution as well as some of the issues that were encountered along the way.

2.1. TECHNOLOGY RESOURCES

The following list identifies the software that this educator used to complete this Challenge

Problem during the summer of 2017 at the GRILL®. It is worth noting that newer versions of the

software or other free, open source technology may be available for students to solve the

problem. Students should not be limited solely to the software mentioned in this document.

Furthermore, students should be encouraged to look for and research a variety of technology

and resources that allow them to progress toward their solution.

2.1.1. HARDWARE

PC

- The solution used Windows 10.

- 8 GB of RAM

- Intel® Core™ i5-2400 CPU @ 3.10GHz

- NVIDIA GTX 750 TI Graphics Card

2.1.2. SOFTWARE

3D modeling software

- The 3D models in the solution utilized SketchUp Pro 2017, 3ds Max, and Unreal

Engine 4.

Game engine

- Unreal Engine 4

Page 5: Virtual Escape Room › ... · Gaming Research Integration for Learning Laboratory® (GRILL®). The solution that follows was created within a five week timeframe. It is important

Virtual Escape Room

Distribution A

2.2. POTENTIAL ISSUES

While working on the solution for this Challenge Problem at the GRILL® summer 2017 program,

a number of different challenges were encountered along the way. The following sections cover

some of the likely issues teachers or students may encounter when they attempt to create a

solution to this Challenge Problem. Based on how a teacher or student approaches the

Challenge Problem, as well as what tools they use, these highlighted issues may not arise.

2.2.1. INTERACTING WITH KEYPAD

When developing the video game for this Challenge Problem, there were difficulties in getting

the player character to interact and communicate with the keypad asset. This interaction was

necessary as it would allow the player to see the problem that needed to be solved to exit the

room, as well as provide the player a way to respond to the problem. The initial approach taken

to program this mechanic was to use a linetrace (as was recommended by a few resources

found on the Internet) that determined when the player was communicating with the keypad;

however, this method was unsuccessful.

2.2.1.1. RESEARCH

The issue was researched utilizing Google searches for “Unreal Engine 4 Keypad”, “Unreal

Engine 4 blueprint interaction”, and ultimately, “Unreal 4 Door Animation.” These searches led

to a variety of video and text resources, many of which proved beneficial in some capacity. A

resolution was found after borrowing selections of information from the resources found.

2.2.1.2. RESOURCES

Unreal Engine 4 Tutorial – Security Keypad Panel (video and forum comments)

- https://www.youtube.com/watch?v=ZB4wHlp3kYY

Unreal Engine 4 – Blueprints Keypad Tutorial (video and forum comments)

- https://www.youtube.com/watch?v=9GHY17PtOBQ&t=1147s

How to make a normal door in Unreal 4 Very Easy (video and comments)

- https://www.youtube.com/watch?v=PJ7VbGhMDMo

Blueprint Communication Usage

- https://docs.unrealengine.com/latest/INT/Engine/Blueprints/UserGuide/Bluepri

ntCommsUsage/

Page 6: Virtual Escape Room › ... · Gaming Research Integration for Learning Laboratory® (GRILL®). The solution that follows was created within a five week timeframe. It is important

Virtual Escape Room

Distribution A

2.2.1.3. RESOLUTION

To reiterate, a linetrace was initially used to determine when a player character was within

range to interact and communicate with the keypad asset in the game. While the linetrace

could be seen physically intersecting with the keypad, it was not communicating with the user

interface (i.e., problem widgets and editable textbox for player answers.) After researching

ways for blueprints to interact with one another (e.g., 1st Person Character blueprint with

Keypad blueprint), it was apparent that there might be another way to resolve the issue

without using a linetrace. In a video on how to animate a door in Unreal Engine 4, the presenter

explains how to open the door by pressing the E key on the keyboard. In order for this to work,

the player character must be in close proximity to the door. This proximity is determined by a

box trigger that must be placed on the door. Once the player character is within the box trigger,

he/she is allowed to interact with the door (i.e., call the animation of the door). The box trigger

represents a “gate” and the gate can be opened or closed with the press of the E key. By

pressing the E key, the door animation plays. By using this line of thinking, a workaround for the

linetrace problem was found.

After removing the code using linetrace, code similar to the door animation was created. First, a

box (trigger) component was added to the mesh of the keypad blueprint, ensuring that all

instances of the keypad would contain a box trigger associated with them (see Figure 1: Box

Trigger on Keypad blueprint).

Figure 1: Box Trigger on Keypad blueprint

Page 7: Virtual Escape Room › ... · Gaming Research Integration for Learning Laboratory® (GRILL®). The solution that follows was created within a five week timeframe. It is important

Virtual Escape Room

Distribution A

Using the box trigger, it was then possible to use the “On Component Begin Overlap” and “On

Component End Overlap” events to determine when the player character could interact with

the keypad. By entering the box trigger (i.e., get close to the keypad), the player character can

press E on the keyboard and it will call the question widget to the screen and allow the user to

view the question and enter the answer. During the timeframe when this issue was solved, the

code was the same as Figure 2. This method seemed to work well with all of the keypads within

the game.

2.2.1.4. REFLECTION

It is apparent that there are many different viable solutions to the issue that arose here. For

one, a better understanding of how blueprints interact with one another and how linetracing

functions on a deeper level could have led to a solution requiring minor changes to the original

code. This issue also illustrates that there can be useful information that can be used to solve

problems by looking at seemingly unrelated issues (e.g., door tutorial).

Figure 2: Initial Keypad Code for Widget Creation

Page 8: Virtual Escape Room › ... · Gaming Research Integration for Learning Laboratory® (GRILL®). The solution that follows was created within a five week timeframe. It is important

Virtual Escape Room

Distribution A

2.2.2. CHANGING WIDGETS

Another issue experienced during the completion of this project revolved around widgets (i.e.,

the component of the project that displays images of the problems that are to be solved to

advance through the game). Specifically, every keypad within the game would display the same

problem when interacted with despite each keypad containing a different password or answer.

When applying a new picture to a particular keypad, the end result was that all pictures on all

keypads changed to the new one.

2.2.2.1. RESEARCH

The issue led to Google searches of “Changing widgets”, “Widget blueprints”, and “Creating

instances of widgets.” The searches provided some information on how to create widgets and

how they work within an Unreal 4 project. While useful, the information did not lead to a direct

solution to the issue. Contact was made with a software engineer to help fix the issue.

2.2.2.2. RESOURCES

Making an Instance of a Class Object

- https://answers.unrealengine.com/questions/174401/making-an-instance-of-a-

class-object.html

How to Change Text of a Widget From Another Blueprint

- https://answers.unrealengine.com/questions/561135/how-to-change-text-in-a-

widget-from-another-bluepr.html

Using Images Within Widgets Unreal 4

- https://forums.unrealengine.com/showthread.php?58079-Import-a-picture-

texture-in-an-UI-Widget-Blueprint

2.2.2.3. RESOLUTION

After consulting a software engineer, a resolution to the issue was found. The issue occurred

due to editing the original widget, which caused a change in all instances of the widget. To fix

this, new variables that store the various images needed to be created. In the widget blueprint,

a public variable of the Texture 2D type was created to handle the different problem images

posed to the player throughout the game (see Figure 3: Texture 2D Variable). Furthermore, a

function needed to be created that would handle the setting of the images for each keypad.

Unreal Engine 4 had a built-in function called Set Brush from Texture that could be used to set

the images (see Figure 4).

Page 9: Virtual Escape Room › ... · Gaming Research Integration for Learning Laboratory® (GRILL®). The solution that follows was created within a five week timeframe. It is important

Virtual Escape Room

Distribution A

The Set Brush from Texture function required two different inputs. The first input, Target,

determines where the picture is applied. The area of the widget that could display pictures was

named DoorQuestion1. The second input of the function was Texture, which is the image that

would be displayed in the area of the Target. The newly created Image variable was used for

this as it would allow the pictures in the widget to change based on the keypad being accessed

within the game. The Event Construct event executes the Set Brush from Texture function

whenever the widget is created, which happens anytime a user interacts with a keypad.

Next, the Keypad blueprint needed to be able to communicate with the widget blueprint. To do

this, another variable was created in the Keypad blueprint called ImageNumber (Figure 5) of

type Texture 2D, which is the same type as the Image variable in the widget blueprint. The new

variable appears in the Details panel of the Keypad blueprint when it is placed into the game

level (Figure 6). With this variable, it was possible to easily apply a unique image to each keypad

by simply dragging and dropping the 2D image that represented the problem to be solved onto

the ImageNumber variable in the Details panel.

Figure 3: Texture 2D Variable Figure 4: Function for Setting Problem Image

Figure 5: ImageNumber Variable for Keypad Blueprint

Figure 6: Keypad Blueprint with ImageNumber Variable

Page 10: Virtual Escape Room › ... · Gaming Research Integration for Learning Laboratory® (GRILL®). The solution that follows was created within a five week timeframe. It is important

Virtual Escape Room

Distribution A

Figure 7 illustrates where these new variables were crucial in overcoming this issue. Within the

Keypad blueprint, this section of code causes a new widget to be created when a user interacts

with a keypad. In order for the new widget to be created, it must set the widget blueprint and

image. To determine the image to be used, the program receives the ImageNumber variable’s

value and returns the associated picture for the keypad.

2.2.2.4. REFLECTION

The work for fixing this issue required more time and effort than was expected. A better

understanding of variable types, and also brush textures and their associated functions would

have proved useful at the beginning of the project. The problem helped this educator gain a

deeper knowledge of getting and setting variables within the Unreal Engine 4 framework, as

well as how two blueprints can work together.

3. EXAMPLE GAME

Developing a video game can be a challenging, yet very rewarding, task for students. The

development process allows students to work with a variety of software, collaborate with their

peers, engage with non-routine problems that require research to overcome, and display their

creativity. With this Challenge Problem in particular, students must also demonstrate their

knowledge of specific content standards.

The following sections illustrate a sample game (Figure 8, Figure 9, and Figure 10) created for

this Challenge Problem along with its associated code. The example presented here is not the

only way to create the game, nor is it necessarily the best or most efficient way. These sections

are provided merely for guidance in solving the problem.

Figure 7: Code for Creating Widget on Screen

Page 11: Virtual Escape Room › ... · Gaming Research Integration for Learning Laboratory® (GRILL®). The solution that follows was created within a five week timeframe. It is important

Virtual Escape Room

Distribution A

Figure 8: Sample Game Starting Location

Figure 9: Sample Game Basic Room

Figure 10: Sample Game Final Room with Video Playing

3.1. DOOR BLUEBRINTS

Page 12: Virtual Escape Room › ... · Gaming Research Integration for Learning Laboratory® (GRILL®). The solution that follows was created within a five week timeframe. It is important

Virtual Escape Room

Distribution A

One of the main mechanics in the game is to get each door to open so that the player can

progress through the level. The following screenshots highlight how this educator set up the

blueprints for the door animation. There are several ways to animate a door; however, by using

a blueprint, the work becomes less tedious. With blueprints, only one door needs to be coded

and it can be reused over and over again. It is not necessary to go through the level and

tediously program each and every door.

Figure 11: Door Mesh

Figure 11 illustrates the initial setup of the blueprint and door mesh. Starter Content was

enabled when this Unreal Engine 4 project was created. The SM_DoorFrame from the Props

folder (under the Starter Content folder) was used to create the blueprint. The SM_Door was

then added as a Mesh Component to the blueprint and parented to the SM_DoorFrame.

Page 13: Virtual Escape Room › ... · Gaming Research Integration for Learning Laboratory® (GRILL®). The solution that follows was created within a five week timeframe. It is important

Virtual Escape Room

Distribution A

Figure 12: Custom Event for Opening Door

Figure 12 shows the nodes and connections necessary within the Event Graph of the blueprint

needed to make the door move properly.

A custom event, named OpenDoor, was created so that the blueprint could be accessed by

other code in the game. In this script, a timeline named DoorRotation, was used to create the

animation for the door (Figure 13).

Figure 13: DoorRotation Timeline

3.2. KEYPAD ASSET BLUEPRINTS

Another main gameplay mechanic is that players will interact with an environmental object that

presents them with a problem and provides the player a way to state their answer. Part of that

mechanic is handled by the Keypad asset blueprints in the sample game. Specifically, the

Keypad blueprint determines when a question is displayed, takes the player’s answer, and

communicates with the DoorBP blueprint when a player enters a correct answer.

Page 14: Virtual Escape Room › ... · Gaming Research Integration for Learning Laboratory® (GRILL®). The solution that follows was created within a five week timeframe. It is important

Virtual Escape Room

Distribution A

Figure 14: Keypad Mesh and Blueprint Setup

Figure 14 shows the initial setup of the Keypad blueprint. The model used for the keypad was

created using a 3ds Max, an external 3D modeling program. A box component was added to the

blueprint to determine when a player is close enough to interact with the keypad. Several

variables were also created that were necessary for reference in different parts of the code.

Figure 15: Determining if Players is Close Enough to the Keypad

In Figure 15, the code that determines when a player can interact with a keypad can be seen.

The player has the ability to use the keypad when he/she is within the box component, and is

unable to use the keypad when they are outside the box component.

Page 15: Virtual Escape Room › ... · Gaming Research Integration for Learning Laboratory® (GRILL®). The solution that follows was created within a five week timeframe. It is important

Virtual Escape Room

Distribution A

Figure 16: Creating Widget on Screen

Figure 16 shows the code used for creating the widget after a player presses the E key when

within range of the keypad. When the widget is created, a specific problem must be set within

the widget, thus the need for the Set Image node and the Image Number variable. Lastly, when

a player interacts with the widget on screen, the input mode is changed to UI Only so that the

player cannot move their character while they are entering their answer to the question. Many

of the nodes are references to other blueprints within the project (e.g., Create Password Panel

1 Widget, Set PasswordPanelBP). These references will be set up in the next section.

Figure 17: CorrectPassword Custom Event

The last section of the code for the Keypad blueprint is a custom event (Figure 17) named

CorrectPassword that calls the OpenDoor event when the player types the correct answer into

the keypad.

Page 16: Virtual Escape Room › ... · Gaming Research Integration for Learning Laboratory® (GRILL®). The solution that follows was created within a five week timeframe. It is important

Virtual Escape Room

Distribution A

3.3. WIDGET BLUEPRINTS

Figure 18: Widget Design Setup

The widget used for the sample game is comprised of several components that were dragged

and dropped into the design area from the Palette tab. The widget consists of a gray

background, an editable text box with instructions on how to submit answer, an Image box that

displays the question for the keypad, and a button. The widget with an example problem image

can be seen in Figure 18.

Next, some code needs to be applied to the widget in order for it to behave properly within the

game. The first section of code (see Figure 19 below), determines what happens when a player

clicks the Enter button on the widget interface. The event causes a sequence of actions to play

out. First, all widgets (i.e., picture of problem) will disappear from the screen. Next, the input

mode will be set back to Game Mode Only so that the player can control the movement of their

character. The mouse cursor will also be removed from the screen so that it does not interefere

with the player as he/she navigates through the level. Lastly, the IsCorrect function is called

when the Enter button is clicked.

Page 17: Virtual Escape Room › ... · Gaming Research Integration for Learning Laboratory® (GRILL®). The solution that follows was created within a five week timeframe. It is important

Virtual Escape Room

Distribution A

Figure 19: OnClicked Event

Error! Reference source not found. shows the remainder of the section of code in Error!

Reference source not found.. The IsCorrect function takes the “Password” contained within the

instance of the Keypad and the “Password” supplied by the player and compares them. If the

two values match, then the code follows the “True” path at the branch, which will call the

CorrectPassword event (recall that the CorrectPassword custom event communicates with the

Door blueprint and tells a door to open). If the passwords do not match, then the code follows

the “False” path at the branch, and the message “Incorrect. Try again” is displayed on the

screen.

Figure 20: Calling of IsCorrect Function

Page 18: Virtual Escape Room › ... · Gaming Research Integration for Learning Laboratory® (GRILL®). The solution that follows was created within a five week timeframe. It is important

Virtual Escape Room

Distribution A

Figure 21: IsCorrect Function

The IsCorrect function (Figure 21) is not necessary to create a working game, but adds some

versatility to the way a player may answer. For instance, if a door password is set as 2, 4, then a

player would be able to type 2, 4 or 4, 2 or even 2, 4 with several extra spaces.

The IsCorrect function works by taking both a keypad’s and player’s passwords, trimming any

spaces between, before, or after any characters, converting all letters to capitals, and then

creating an array for each password. Another function, RemoveWhiteSpace (Figure 22), is also

called within the IsCorrect function for an extra layer of trimming to player answers. The

elements in each array are then compared to one another. Each time two elements match, the

value of the CorrectCount variable is incremented by 1. After comparing all elements between

the two arrays, if the value of CorrectCount is the same as the length (number of elements) of

the correct password array, then players have correctly answered the question.

Page 19: Virtual Escape Room › ... · Gaming Research Integration for Learning Laboratory® (GRILL®). The solution that follows was created within a five week timeframe. It is important

Virtual Escape Room

Distribution A

Figure 22: RemoveWhiteSpace Function

The last section of code in the widget blueprint handles the changing of questions for each

keypad in the game (Error! Reference source not found.). The Set Brush from Texture function

was used to apply a new picture to the DoorQuestion1 area based on the value of Image. For

more information on this code, see Section 2.2.2 of this document.

Figure 23: Event for Changing Questions

3.4. 3D MODELING AND GAME ASSETS

A minimal number of 3D models were created for this sample game; however, a solution may

contain more to make the game more immersive. Both SketchUp Pro and 3ds Max were used to

create the game models. After building a model, it then had to be exported as an .FBX file

before it could be imported into Unreal Engine 4. See Figure 24, Figure 25, Figure 26, and Figure

27 for pictures of the models used within the game.

Page 20: Virtual Escape Room › ... · Gaming Research Integration for Learning Laboratory® (GRILL®). The solution that follows was created within a five week timeframe. It is important

Virtual Escape Room

Distribution A

Figure 24: SketchUp House

Figure 25: How to Play Sign

Page 21: Virtual Escape Room › ... · Gaming Research Integration for Learning Laboratory® (GRILL®). The solution that follows was created within a five week timeframe. It is important

Virtual Escape Room

Distribution A

Figure 26: Keypad Model

Figure 27: TV Model

Page 22: Virtual Escape Room › ... · Gaming Research Integration for Learning Laboratory® (GRILL®). The solution that follows was created within a five week timeframe. It is important

Virtual Escape Room

Distribution A

3.5. IMPORTING VIDEO TEXTURES

The primary method for presenting clues to players in the sample game was through videos.

The videos in the sample game were .mp4 files that were downloaded from the Internet.

Despite this, it is this educator’s opinion that it would be most beneficial for students to create

their own videos to teach the player about the content. Students can use cellphones, tablets,

and computers to record and save their videos in the .mp4 format.

The following steps were used to create video textures in the sample game:

1) Ensure that a video file is stored on the computer and is saved as an .mp4 file.

2) With Unreal Engine 4 project open:

a. Right click in the blank space of the Content Browser.

b. Choose “Add New Folder.”

c. Rename the folder to Movies (see Figure 28).

3) Right click on the Movies folder and select “Show in Explorer.” This will open up

the Movies folder in a new window. Find the .mp4 file that is located on the

computer. Copy and paste the file into the Movies folder (Figure 29). Close the

Movies folder window.

Figure 29: Video in Movies Folder

Figure 28: Movies Folder in Content Browser

Page 23: Virtual Escape Room › ... · Gaming Research Integration for Learning Laboratory® (GRILL®). The solution that follows was created within a five week timeframe. It is important

Virtual Escape Room

Distribution A

4) Return to Unreal Engine 4 and open up the Movies folder in the Content Browser

by double clicking the folder. Within the Movies folder:

a. Right click in the blank space of the folder.

b. In the menu, select “Media,” followed by “File Media Source.”

c. Rename the File Media Source asset if necessary (Figure 30).

Figure 30: Creating a File Media Source Asset

5) Double click the File Media Source asset icon to open it. Set the file path for the

video by clicking the ellipsis (…) next to the words “File Path.” Navigate to where

the video for the game is located, which should be in the Movies folder. Select

the video and click “Open.” The file path should now be set (Figure 31). Click

“Save” at the top of the window and the File Media Source tab can be closed.

Figure 31: Setting File Path for Video

Page 24: Virtual Escape Room › ... · Gaming Research Integration for Learning Laboratory® (GRILL®). The solution that follows was created within a five week timeframe. It is important

Virtual Escape Room

Distribution A

6) With the File Media Source tab closed:

a. Right click in the empty space of the Movies folder.

b. In the menu that appears, select “Media” followed by “Media Player”

(Figure 32).

c. The Create Media Player window should appear. Make sure that “Audio

Output Soundwave Asset” and “Video Output Media Texture Asset” are

both selected, and click OK.

d. Rename the media player if necessary.

Figure 32: Setting Up Media Player

7) Double click the Media Player asset to open the media player and the video.

Ensure that the option “Play on Open,” located underneath the details panel, is

checked. Close the media player window.

8) Open the Content folder in the Content Browser. Open the “Starter Content”

followed by the “Shapes” folder. In this folder, left click and hold on the

Shape_Cube. Drag this shape out into the viewport. Place, resize, and/or rotate

the cube so that it looks like a monitor or TV. A model created in an external 3D

modeling program can be imported too.

9) With the cube placed, go to the Content folder and open the Movies folder. Hold

Ctrl key and left click both the audio and video files in the Movies folder (Figure

33). Drag both of these files onto the TV model placed in the viewport (Figure

34).

Page 25: Virtual Escape Room › ... · Gaming Research Integration for Learning Laboratory® (GRILL®). The solution that follows was created within a five week timeframe. It is important

Virtual Escape Room

Distribution A

Figure 33: Selecting Sound and Video Files

Figure 34: Sound and Video Texture Initial Application

10) Open the Level Blueprint (Figure 35).

Figure 35: Level Blueprint

11) On the left hand side of the level blueprint, click the “+” icon in the Variables

section. This will create a new variable. Call the variable “MediaPlayer”. Now go

to the right hand side of the screen and change the variable type. Select the drop

down menu and in the search bar type “media player”. This will bring up the

Page 26: Virtual Escape Room › ... · Gaming Research Integration for Learning Laboratory® (GRILL®). The solution that follows was created within a five week timeframe. It is important

Virtual Escape Room

Distribution A

Media Player variable type. Select “MediaPlayer” followed by “Reference” (see

Figure 36). Compile and save the code (buttons in the upper left hand corner.)

Figure 36: Media Player Variable

12) After compiling and saving, a default value for the variable can be given. On the

right hand side of the Level Blueprint, under the Default Value tab, click the drop

down menu and select the media player created earlier (Figure 37).

Figure 37: Setting Media Player

13) Left click and drag the MediaPlayer variable into the Level Blueprint area. Choose

Get when prompted (Figure 38).

Page 27: Virtual Escape Room › ... · Gaming Research Integration for Learning Laboratory® (GRILL®). The solution that follows was created within a five week timeframe. It is important

Virtual Escape Room

Distribution A

Figure 38: Getting Media Player Variable

14) Drag out from the pin on the MediaPlayer variable into space. When the search

window appears, type in “Open Source.” Select the Open Source node. On the

Open Source node, click the drop down menu underneath the Media Source

header, and select the imported video to be played (Figure 39).

Figure 39: Open Source Node

15) Right click in the empty space of the Level Blueprint, and search for

“EventBeginPlay” and select it. From the EventBeginPlay node, drag off from the

execution pin to the execution pin of the Open Source node (Figure 40). Compile

and Save.

Figure 40: Adding EventBeginPlay Node

16) Press the Play button to begin the game. If the previous steps have been

followed correctly, the video texture and sound should play (Figure 41).

Page 28: Virtual Escape Room › ... · Gaming Research Integration for Learning Laboratory® (GRILL®). The solution that follows was created within a five week timeframe. It is important

Virtual Escape Room

Distribution A

Figure 41: Finished Video Texture

It is worth noting that the above steps are for setting up a single video texture that plays when

the game is started. Some modification to the Level Blueprint code was used for the sample

game (see Figure 42). This method accommodated multiple videos within a single game and

allowed players to turn videos on and off by pressing the E key near a TV’s wall switch.

Figure 42: Stopping and Starting Video Texture with Switch

Page 29: Virtual Escape Room › ... · Gaming Research Integration for Learning Laboratory® (GRILL®). The solution that follows was created within a five week timeframe. It is important

Virtual Escape Room

Distribution A

3.6. MODIFYING 1S T PERSON TEMPLATE

After creating a game project in Unreal Engine 4, the user will be prompted to choose a

template to serve as a foundation for his/her game. There are several templates to choose from

(Figure 43). For the sample game, the First Person template was used.

Figure 43: Unreal Engine 4 Project Browser

By default the First Person template’s character is carrying a gun. To make the project

appropriate for a school setting, the character mesh and code had to be slightly modified. The

modifications can be seen in the following pictures (Figure 44, Figure 45, Figure 46, Figure 47,

and Figure 48). These changes made it possible to play the game in the first person perspective

without having a gun in hand.

Page 30: Virtual Escape Room › ... · Gaming Research Integration for Learning Laboratory® (GRILL®). The solution that follows was created within a five week timeframe. It is important

Virtual Escape Room

Distribution A

Figure 44: First Person Mesh with Gun

Figure 45: First Person Character with Mesh Removed

Page 31: Virtual Escape Room › ... · Gaming Research Integration for Learning Laboratory® (GRILL®). The solution that follows was created within a five week timeframe. It is important

Virtual Escape Room

Distribution A

Figure 46: First Person Character Event Graph

Figure 47: Modified First Person Character Event Graph

Figure 48: First Person Modified Construction Script

Page 32: Virtual Escape Room › ... · Gaming Research Integration for Learning Laboratory® (GRILL®). The solution that follows was created within a five week timeframe. It is important

Virtual Escape Room

Distribution A

3.7. LIGHTING

Whenever an object is imported into Unreal Engine 4, the lighting will need to be built. During

this procedure, the game engine will determine what space the mesh objects occupy, calculate

the angles created between light sources and the mesh objects, and construct the appropriate

shadows cast by the mesh objects, among other things.

When a building is imported into to Unreal Engine 4 and the lighting is built, the interior of the

building will be completely dark and need lights to create a playable environment. For this

project, point lights were used to illuminate the space within the building. An issue occurred

when placing point lights in close proximity with one another (see Figure 49 and Figure 50). A

few methods were tried to remedy this such as relocating light sources, resizing light sources,

and changing each light’s intensity. This often resulted in inconsistent lighting in each room.

Figure 49: Improper Lighting

Figure 50: Lighting Error Message

Page 33: Virtual Escape Room › ... · Gaming Research Integration for Learning Laboratory® (GRILL®). The solution that follows was created within a five week timeframe. It is important

Virtual Escape Room

Distribution A

To fix the lighting issue, the mobility of each light had to be changed. By default, when a point

light is imported into a project, the mobility of the light is set to Station. This setting is the

source of the error. The problem was remedied by changing the mobility of each light from

Station to Static (Figure 51).

Figure 51: Proper Lighting with Static Mobility