Oregon State University|blogs.oregonstate.edu

Archives: February, 2024

Random YouTubers –> To the Rescue!

  February 29th, 2024

Over the course of working on this Capstone Project, I have been tasked with completing 3 puzzles within our Scooby Doo themed escape room.

Image Source: Our Progress Report #3 for the course

I had worked with Unreal Engine for work in a mostly static capacity.  Modifying and changing landscapes to resemble specific environments, or even to run preexisting code. 

Image Source: Screenshot of an Unreal Project taken from an Internal Work PPT Slide

However, the imposter syndrome was really setting in and getting started on implementing the first puzzle had me feeling paralyzed.  The excitement for the project suddenly wasn’t outweighing my ability to get my own code changes and implementations to do anything of… substance.

Image Source: https://skillstraining.medium.com/what-is-imposter-syndrome-and-how-can-you-overcome-it-a4ddb3a5886

My main breakthrough of the imposter syndrome barrier of this project was when I worked on (and eventually completed) the first puzzle for my floor.  This puzzle involved picking up multiple items that allow the “unlocking” of a door.  In our case it enabled the attic staircase to open.  For now, I decided to use these pages as the items I would use to unlock the stairs.

Image Source: Our Scooby Doo Themed Unreal Engine Capstone Project

Thankfully for various random YouTubers who are kind enough to share their wealth of knowledge, I was able to stumble my way through an adaptation of their code.  The lifesavers of that week were YouTubers: “Matt Aspland”, “Gorka Games”, and “hawaiifilmschool”.

YouTube Channel Links: “Matt Aspland” (https://www.youtube.com/@MattAspland), “Gorka Games” (https://www.youtube.com/@GorkaGames), and “hawaiifilmschool” (https://www.youtube.com/@hawaiifilmschool).

Image Source: https://www.youtube.com/watch?v=Im4lJRNCVZA

First, I found the Unreal Engine development series by “Matt Aspland”. In this particular video, he walked through how to implement a key & door system for doors in Unreal Engine. This helped me understand how to have a single particular item unlock a door.  While this wasn’t the end all be all for my puzzle, it helped me understand the simplicity of the problem, and helped me visualize the OOP aspects of these door and key “objects” within Unreal. 

Image & Video Source for Locked Door & Key System: https://www.youtube.com/watch?v=Bcle9sSS4Oo

Armed with slightly more confidence, it was in the series of recommended videos that led me to the “Gorka Games” walkthrough video.  This is the one that really got me excited about the puzzle, and allowed me to implement this type of code into our project.  It showed how to create invisible “trigger” objects that allow events to happen – whether that be coming into proximity of a pick up item, or blocking a path for the user.

Image & Video Source for Pickup Item Puzzle: https://www.youtube.com/watch?v=Im4lJRNCVZA

The ability to adapt this code into my project in a relatively straightforward manner, got me excited about other applications of these trigger box mechanisms within the game.  This led me to create the triggers for not only the staircase to the attic (necessary for my puzzle), but also the relocking mechanism once in the attic.  This is shown in the photo below, by a round ball that illustrates the center of a the transparent outlined box at the top of the stairs (as well as the 3 cake items behind it), representing the trigger box object in the viewport.

Image Source: Our Scooby Doo Themed Unreal Engine Capstone Project

After getting the stairs to intentionally open and close upon my coded triggers, I felt UNSTOPPABLE.  I ended up staying up for hours lost in the excitement of implementing stand in door triggers to help with overall game flow for all floors.  My overall goal was to create a user experience shown in the image below – in which informative text is displayed on the screen to the user to let them know why they couldn’t proceed through the game.  This felt like the last detail for this feature (current implementation seen below).

Image Source: Our Scooby Doo Themed Unreal Engine Capstone Project

With this in mind, I set out for YouTube once again, leading me down another rabbit hole of videos until I found the perfect one that would work with the content and code base we were already using.  The quick video by “hawaiifilmschool” quickly taught me how to create text widgets that would be displayable on screen. 

Image & Video Source for Displaying Text on Screen: https://www.youtube.com/watch?v=TqUTK5-XqYY

These collective features made the project start to feel like it might turn into something fun and playable.  This got me excited about the puzzles and how to refine and fine-tune them to be more fun (and less buggy).  I was able to place the items in different rooms within the level, making them more fun to find.  This also segwayed into a perfect opportunity to ensure that the user must complete all of the puzzles on the second floor before proceeding to the Attic. 

Image Source: Our Scooby Doo Themed Unreal Engine Capstone Project

Sometimes all it takes to get past the seemingly impossible barrier is the first step. Oftentimes, that first step is best taken with help from others.  I greatly credit the various YouTubers that provide the amazing wealth of Unreal Engine knowledge online for anyone to access, for free.  I will forever be grateful to them for the breakthrough on my project!

Image Source: ​​https://imgflip.com/i/7dzaww

Peace out coders!

-Kristy

Read the post...


Object Oriented Blueprinting

  February 8th, 2024

My group’s “Escape Room Challenge” has provided us an awesome opportunity to showcase some introductory capabilities of the Unreal Game Engine in a fun and interactive way.

(Image source: https://www.unrealengine.com/en-US/)

One of my favorite features of Unreal is the built-in “Blueprint” visual coding language.  While I enjoy writing code, I appreciate that Blueprint allows users that are both new to coding and seasoned professionals to jump into the development process within Unreal. 

(Image source: https://docs.unrealengine.com/5.2/en-US/blueprints-visual-scripting-in-unreal-engine/

Let’s take a look at a piece of sample code from the content pack we used as the base for our project: Modular Victorian House.  A pack that I was lucky enough to get for free during the Epic Games monthly sale. 

(Image source: https://www.unrealengine.com/marketplace/en-US/product/victorian-house

In the pack, among the provided content, is the “Blueprint” code for an interactive door.   Included functionality allows the door to be opened or closed (top) as well as to to alter the cursor to indicate the door can be opened (bottom).  

(Image source: Unreal Editor screenshot of content from https://www.unrealengine.com/marketplace/en-US/product/victorian-house

For this example, we will focus on just the top section → the “Open Door” code segment. 

(Image source: Unreal Editor screenshot of content from https://www.unrealengine.com/marketplace/en-US/product/victorian-house

First, on the left in red we see TWO separate event triggers: “Event On Interact” and “Event ActorBeginOverlap”. We look at the “Event On Interact” trigger that performs the open and close functionality.  From the trigger, it splits into a option for based on the door’s current status: closed (A) or open (B).  While it next feeds into a sequencing function that also triggers the sound effect, we are solely going to focus on the portion that feeds into the function “Door”.

(Image source: Unreal Editor Screenshot of content from https://www.unrealengine.com/marketplace/en-US/product/victorian-house

Look familiar? This event trigger resembles the Scratch block coding language that is intended to be a gateway to coding.  In the snipped below, we create an event that broadcasts a message called “open_door” that the door object would be listening to.  Once that code segment hears the message, it will then trigger the code segment that opens the door (not pictured).

(Image Source: https://scratch.mit.edu/projects/editor/?tutorial=home)

Back in Blueprint, once the “Door” function receives the cue “Play” (for opening the door) or “Reverse” (for closing the door), it completes two tasks: 1) it edits the “Yaw” of the door via the “Make Rotator” function, in order to rotate its physical look within the simulated space, and 2) it updates the “Relative Rotation” of the simulated door object by specifically referencing the “Mesh Door 02” object as the “Target” and the updated rotation from the “Make Rotator” function, to supply its final rotation.  

(Image source: Unreal Editor screenshot of content from https://www.unrealengine.com/marketplace/en-US/product/victorian-house

With the Blueprint code above in mind, what might this functionality look like in Python instead? Below I have coded up a VERY BASIC (essentially pseudocode) version of the functionality to see how it might compare. We see that it essentially works off the same principles: 1) it waits for a trigger, 2) it calls a function to check the current status of the door, and 3) it updates the rotation of the object to reflect the desired rotational status.

With these similarities in mind, I choose to think of Blueprint as somewhat of a blend of Scratch (block-style) coding, and more formal Object Oriented coding languages like Python or C++.  As it provides deep functionality for creating games (from the OOP languages) but also maintains the ease of use for the user – especially new users (similar to Scratch). 

Upon starting with Blueprint, I found the learning curve was a bit steep. After spending some time working with this visual coding language, I find myself better understanding the connections and workflow.

On first look at the functionality for a door alone, it is very intimidating. All the boxes and white lines connecting different things makes it confusing. While I cannot completely fault the language for this, I will say that sometimes the links (white lines) that connect the functions can make it hard to follow. Perhaps it would be improved by color-coding these links based on the data type being transmitted via these links.

(Image source: Unreal Editor screenshot of content from https://www.unrealengine.com/marketplace/en-US/product/victorian-house)

Despite the learning curve of the language, I find that the overall benefits and friendliness of the language outweigh the downsides. The content packs available in the marketplace (many for free) provide example functionality for many Blueprint functions and the seemingly endless wealth of online tutorials, forms, and courses, make this an amazing tool.

(Image source: Epic Games in-app Marketplace screenshot from https://marketplace-website-node-launcher-prod.ol.epicgames.com/ue/marketplace/en-US/assets?count=20&sortBy=effectiveDate&sortDir=DESC&start=0&tag=4910)

Unreal Engine’s Blueprint coding language is a great opportunity to utilize extensive capabilities in game development while still trying to understand the depth of coding applications, truly making it the “best of both worlds” (Hannah Montana would be so proud). 

Peace out coders!

-Kristy

Read the post...