Tim Barrett's profile

2D Platformer Prototype

I created this 2D Platformer prototype as a Design Test with a two hour limitation. Given the time limitation, I needed to keep my ideas and mechanics to down to a basic level that could be easily and quickly implemented and just as quickly debugged if necessary. 
I kept the level layout to a minimum because it wasn't intended to be the primary focus of the prototype. The intent was to create a small sample-size that could act as a stand-alone experience with a focus on the mechanics designed and developed. 
Level Layout: Overview of 2D Level including enemy and obstacle placement as well as interactable items.
After establishing a layout, I needed to begin implementing obstacles for the player to avoid in order to make the experience interactive and challenging to the player. I began by designing some basic pitfalls that would instantly eliminate the player on collision. They also needed to appear threatening to the player so as to deter them from colliding with them. I created and attached a simple emissive material to a cube to appear as a futuristic lava-like substance that fits with the theme of the level. In addition to designing the pitfall, I needed to develop the functionality to damage the player as well. I decided to implement an interface for this so that it would be easily reused for other obstacles later on and would save me time when doing so. 
Take Damage Interface Blueprint
The code for this call is set up within the player controller so that it may be called and cast to the player character as needed. The player's health is deducted from its current setting and set as the new value. A check is then initiated to see if the player should still be living or not (less than or equal to zero). If the check returns true, the ragdoll physics are set to the character mesh and player controller and the "OnDeath" function is called.
The "OnDeath" function was set up to quickly and easily call the death and respawn mechanic for the player to signify that they died due to their interaction with an environmental hazard and teach them that they incorrectly traversed the level. 
OnDeath Custom Event Blueprint
Take Damage Interface call from Lava Block Blueprint
The code will un possess the pawn from the player controller and institute a camera fade while calling a custom made widget to tell the player that they died. After a short delay, the code reloads the game mode and restarts the game, giving the player control back at the start of the level. For further development, this code could be adjusted to take into account respawn points that the player has reached and allow them to spawn there rather than losing all progress. This kind of mechanic would be better suited for longer levels to reduce player punishment. 
To diversify the level and its challenges, I added a simple AI that would use the same kill mechanic as the pitfalls. However, I added a perception component to detect the player and chase them down on sight. This would add some degree of difficulty to the level and create a sense of urgency for the player so they wouldn't be able to stand idle without the threat of other dangers.
AI Blueprint
Lastly, I needed to introduce some interactive mechanics to the environment to create some problem solving and possible environmental puzzle mechanics. First I added a door that would block the players path until its corresponding button was pressed to open it and allow the player to continue on their path. Top prompt the player for a button press, I added a widget that would toggle its visibility based on the player proximity to it. 
Command Prompt Blueprint
Door Blueprint and Timeline Call
With little time left in the test, I needed one more puzzle/door interaction to allow the player to solve it and finish the level. Using a similar timeline as the first door, I created a second door blueprint that would open after the player had triggered its pressure plate. My intention was to have the player use a block to hold the button down and keep the door open, however the code is reversed and toggles the door open and closed on its interaction. Unfortunately, I did not have enough time to trouble shoot this in order to fix it, however the mechanic still works for a tutorial level or prototype and can be reused later on to create other blueprints within the game that would then act as initially intended.
Floor Switch and Timeline Blueprint
2D Platformer Prototype
Published:

Owner

2D Platformer Prototype

Published: