Game: Hapless Headless Harry
- tobitanatalie
- Jan 14, 2022
- 4 min read
A third person platformer created by Unreal Engine 4 for the final project of the Interactive Media and Game Development course.

Harry has lost his head! And he has no memory of it... well because his head is missing. Luckily, a hungry knight nearby seems to know where Harry's head is at. But nothing comes without a cost, and Harry must first complete the knight's meal request before embarking on a journey to reclaim his head.
Playthroughs
Quest playthrough:
Platformer playthrough:
Quest
In class, we had learned how to do a door-and-key game mechanic using blueprints. In my game, Harry cannot pass through a magic rock (door) unless they find food items (keys) that the hungry knight has requested. One of the items that the knight requests is an apple. I made a variable called HasApple for Harry and set it to False. Using a box collision, when Harry overlaps into the box, HasApple changes to True. In order to give the illusion that Harry has picked up the apple, the apple must disappear, which I used the function DestroyActor. I applied the same logic to the other two food items: pumpkin and fish. When Harry overlaps the box collision of the magic rock, it only disappears when HasApple, HasPumpkin, and HasFish are True.
But how would Harry know to find an apple, pumpkin, and fish? This is where I searched up how to create a NPC dialouge.

I made a box collision around the hungry knight, this is the area in which Harry can interact with the knight. If Harry is within the box, the Dialouge UI Widget will appear to the viewport, and if he isn't, then hide the dialouge in the game. Now when the dialouge occurs, I had to make an array of text entries for the knight. There were two types of dialouge that the knight could say. The first type is when he's giving out the quest to Harry, and the second type is when Harry finishes the quest and the knight gives another set of instructions to move Harry onto the next section of the game. Well, the second set of dialouge should only happen when HasApple, HasPumpkin, and HasFish are True. So in my dialouge loop, I made sure that the first set of dialogue texts should only loop up to the length of the first set, and only when the three aforementioned variables are True is when the second set of dialouge should happen.
I like talking to NPCs whenever I play a game, and until now, I never realized how many steps were needed to make it happen!
Platformer
I loved beating all the levels of New Super Mario Bros 2 and knew that I wanted to incorporate a platform game to my own. Those Mario games are side-scrollers, but mine is third person, so how would the player know where the "end" is? I indicated the end of the level with spotlights. Between the spotlights and the player is a path of rocks for him to jump through. But to make it more fun, I added damage spikes and sprinkled harder-to-reach health potions throughout the level. These would give the player new routes to choose from and create less of a "straightfoward" path.

I made a variable called PlayerHealth for Harry and set its default value to 100. Whenever Harry would touch the box collision of a spike or health pot, it would subtract or add 20 health points respectively. Then I thought about the edge cases: when Harry loses all his health and when Harry is at full health. If Harry's health is at 20, that means the hit he just took killed him. Upon his death, I triggered the death animation before respawning him to the beginning of the level. I would also need to reset his health back to 100 as well. On the other hand, if Harry's health is at 100, then health potions should not increase his health past 100, nothing would trigger. I even made it so that the health potions didn't disappear at full health after being overlapped. Since they were consumed when used, I felt it was punishing to the player if all the health potions were gone if they died and respawned again.

There will also be a scenario where Harry doesn't jump onto a rock and falls into the water. In that case, it was an instant kill. I made a box collision around the water, which I called the killzone. When Harry hits the killzone, it sets Harry's health to 0 and triggers the death animation and respawn.

At long last, Harry has finally arrived to his head! In order to end the game, I made a box collision around his head. Upon hit, the collision triggers a congratulatory note to the player. It then takes the player back to the main menu of the game, where they could quit the game.
Thoughts
And that's it! I find it fascinating that so much information can be relayed to the player through game design, and its really quite ingenious. It really reminds me of the "show don't tell" spiel that English teachers talk about in school. It was also really cool to learn and program game mechanics that I've experienced in games. Through playtesting, I've definitely found quite frustratingly, the holes in my logic. But I suppose that's part of the fun as well, because once you fix the issue and everything works the way it should, it feels so good. It was my first time working with Unreal Engine and I definitely have lots more to learn, but thanks for reading!
Comentários