Horror Game Mechanics - Basics - Blueprints in Unreal Engine 4
Joakim "Chef" Lundström GameDev DK30 Quarantine 2020 13 12
Description
So my idea for the 30 day challenge is a continuation from the last DK30, I want to go into a more technical view of the project rather than the conceptional one. I do know there is A LOT I need to go through when it comes to mechanics, but I want to start slow and just set up a base for my horror game. This means learning to use UE4s Blueprints for things like, camera, movement, interactions and the likes. Because I have no clue how hard anything will be, I don’t have a defined goal more than: Play around and see how it goes!
Recent Updates
Day 30 - The final update!
Great success!
So we’re finally here, 30 days went past so quickly! And I honstly think that I was able to do much more than I thought I was gonna be able to do within 30 days. With that said, I also didn’t manage to fix the inventory system on time. It’s ok tho, because I found someone who was willing to help me out getting the mechanic up and running like I want it to! Instead, I focused this week on smaller details to build a final video showing off all the mechanics I’ve managed to make within these 3 weeks!
What I learned
I started out this DK30 with going in with a vague goal: To learn UE4s Blueprint system. And while there is still a mountain to climb to learn everything, I can without a doubt say that I have learned the basics and that I will be able to continue making this game moving forward! It feels REALLY great! Here’s a list of mechanics I learned along the way:
- Movement (walking, crouching, jumping, running)
- Interactions (switches, lift objects, inspect objects, read notes, widgets, flashlight)
- Widgets (Creating UI elements for above interactions, computer screen)
I’m so proud of what I’ve managed to make within just a month of work. And on top of that: during the final week I also worked a little bit on 3D, specifically on creating materials and textures for them. I also worked on UI images that can be seen in the video! (Check out the previous videos if you want to see how they looked before, yuck!)
I’ve learned so much, and this have been such an amazing journey for me. Now I just need to get motivated to keep working on this game! I feel like it’s no longer an impossible dream to chase.
The final results
Alright… I’m gonna stop my writing here! Below is a video I made that will showcase all the mechanics I learned. Sit back, turn off your lights and (hopefully) enjoy…!
Feedback
If you have any questions or comments regarding this project, just send me a message on Discord! I’m online almost 24 hours a day and I’m always up for a chat. It doesn’t have to be about the project either, I’m a talkative guy :)
Again, I would like to thank all of you who have taken your time to support me, followed my project and those who were at all interested. Post a green heart in the DK30 chat if you read through this entire post. It means more than you think!
Cya next DK30!!!
Day 22 - Footsteps!
Finally an update with video!
So I managed to figure out how to play footsteps for my character! I gotta say, it was harder than I thought it would be because most of the tutorials online are for people who have animations for their character. But because my character is just a floating blob, I had to figure out how to get the same effect without an animation.
Basically I had to keep track at the distance my character have traveled each tick. After a certain distance had been traveled, I check what kind of physical material the character is standing on top and play a sound accordingly!
I also had to look into how to have some variation with the footstep sounds, so I did a trick like most did back in UDK (UE3), change the pitch of one or two step sounds in a random fashion! It’s surprisingly similar and that made me happy. So it’s going to be super easy to import even more variation to the footsteps!
Here is todays video showing off both the footsteps AND the flashlight damage mechanics I have made from last time I recorded a video!
Sound management
Ok so… yesterday I spent the entire day going through over thousands of sounds in all various shapes and forms. I got these sounds from the free GDC sound libraries they give out each year, and they are of AMAZING quality! It’s over 100GB of sound! And the majority of them are in their raw format, which is why it’s so big. Hit me up on Discord if you’re interested in getting them yourself! :)
Anyways, after going through all of them I ended up with about 750 sound files that I felt would be relevant for my horror game. I then had to organize them so that it’ll be easier for me to find them later on… I ended up sorting them into 90 different folders.
It feels good tho! A lot of work done that I most likely otherwise wouldn’t care about.
Thank you so much
I want to take this time to thank you, the individual, who took your time reading through this entire post, as well as watching the video. It means so much to me knowing that there are people who are interested in my project… Some days it’s extra hard for me to keep motivated, but I know there are a few of you who do care :)
As a test… why don’t you post a little green heart in the DK30 channel when you’ve finished reading, huh? < 3 Again, thank you so much!
Day 20 - An update
Getting help with getting an inventory working
So the last couple of days I’ve been trying really hard to find tutorials and the likes that would help me make an inventory system that works kind of like the Resident Evil 4 inventory. I got to a certain point with my inventory and then it was just filled with bugs that I know I wouldn’t be able to fix with the current setup… so I looked for solutions elsewhere.
I found an ARPG inventory system that was free and the guy who created it looked very active in the UE4 forums. So I tossed him a message and asked if he could possibly help me perhaps scale down the project so that it is just the basics of the inventory. He said that it wouldnt be any problems! I’m currently waiting for him to do his magic and see what he comes up with. I told him from the start that I can’t really pay him for his work other than giving him credits for his work and perhaps help him back with game design, level design, graphic design or the likes. He doesn’t seem to care about payment right now haha.
I’m extremely thankful for the help he’s doing.
Light damage mechanics
So today I figured… well… while I’m waiting for this guy to finish his stuff, I might as well work on other mechanics I might have a use for in my game. So I played around with the idea of decaying objects while flashing your flashlight at them.
I had no problems at all making it work, however it’s very basic! Right now I just change a certain amount of alpha in the material when you shine your light at it. You can control it’s sensitivity as well. Which is pretty neat!
I will record a video perhaps tomorrows if I get more things I can show! The effect is very boring to record so hopefully there will be more to come!
Day 17 - Inventory
Resident Evil 4 inventory system
This is by far the hardest thing I’ve ever tried to make so-far in my blueprint adventure… and honestly, I don’t know if I’ll be able to make it the way I wanted… I’m happy to have been able to make something that looks and SOMEWHAT works like it. But I know there are so many issues right now that you wont see in the video. For example:
- Dragging an item outside of the inventory will make it disappear completely.
- Dragging an item on top of another item will end with the same result.
- Having two items in the inventory and then put one of them at the edge (not being able to place it there) will result in it moving to the last known origin on ANY item.
There are so many things that I have no idea how to fix at this point… and it feels really bad to be honest.
But I am happy non the less…
It took me the entire day to get this far and that is mainly because the tutorial that I watched wasn’t complete. It didn’t let me know how to fix a lot of the above problems. However, I managed to figure out how to place the items back to a “origin” spot if you tried to place a too big item at the very edges of the inventory. The fact that I managed to do this made me so happy!
I just dont know what to do
I have no idea how to fix these problems… my knowledge in this field is too basic and it feels like in order to fix it I have to make something completely new and that makes me a bit sad… :P
I’m gonna leave it as it is tho. This was meant to be started at week 4 and even then I wasn’t even sure I was gonna be able to make any inventory at all! So… I guess I’m doing ok in that sense.
I apologize for such a long post. Here’s the video showing off how far I’ve gotten today:
Day 13 - Grab & Inspect Objects
Grabbing Objects
Ok so… I started yesterday trying to implement some sort of grabbing mechanic for my game. It worked out fine but I have no idea how to actually manage the physics so that the player can’t just throw and push items around as if they got no mass (while holding onto the object). So Right now I don’t even know if I’m gonna use it. It’s all good and fun and I might be able to implement it in an interesting way later.
Inspect Objects
So this one I’m a little bit more sure that it will find its place in the project! In the video you’ll see that the UI elements of it is a bit bugged, but that’s an easy fix. You can hide some cool information behind objects etc! I’m very pleased with how it works and how I made it more dynamic than the tutorial showed me.
As always: Here’s the results of the last two days of work:
Day 11 - Dynamic Note System
Holy balls, Batman…!
Today I really wanted to look into how to make a dynamic note system, the youtube tutorials I managed to find was garbage and didn’t really do what I wanted it to do. I wanted a quick and easy way for me to make a whole bunch of new notes in a the level.
So… today I worked, without any tutorials… and I can’t believe how well everything went!!! I’m just gonna let the video speak for itself this time. I’m so happy! I can make it a whole lot more dynamic as well (like changing the font style for each page side if I wanted to).
The next step would be to save these notes in some sort of journal or something… I’m not sure how I’m gonna manage the data for the player just yet. So I’m gonna leave this as it is!
HELL YE!
Day 10 - Interactable Screens
Widget -> Actor interactions
It’s been another two days since I updated. I took a day off this weekend to just relax and I also worked on two things regarding widgets this time around. The first thing I worked on, that took the most time, was to implement buttons in the widget that would then display a text depending on what button you pressed. For example: You press a button that says “DATA” and the screen updates it’s main area with information regarding DATA. I also wanted a header for each button so that it’s easy for the player to navigate. It took some time but I got it eventually!
I also figured I really wanted to learn how to use the widgets to communicate with actors in the level. Basically: I wanted the computer screen to have a button that would open a door in the level when pressed. This was a bit problematic to figure out but it didn’t take long to get it to work. This opens up so many things and I can’t wait to come up with some cool interactions for the game in the future!
As always: Here’s a video showing my progress!
Day 8 - Interactions, Part 4
Widget Animations
Oh my god… I have tried to get this thing to work for two days now!
Yesterday I sat for hours and hours trying to figure out why my widget animation just wouldn’t work. I asked on forums, looked at tutorials and NOBODY taught me how to make it work. I eventually got some tips from a guy who knows about UE4s Blueprint a lot and he kind of pointed to me where the issue MIGHT lie.
Then today, I finally got it to work…! And oh my GOD was a relief!!! Check out what I managed to do below!
Day 6 - Interactions, Part 3
I took a day off yesterday because I had little to no encouragement or inspiration to do anything… I just felt empty. So today when I woke up I had no idea what to actually work on, it took me a while but I decided I wanted to play around with more interactivity. Especially something that I could use for interacting with a computer screen for example.
So today I wanted to keep working on the buttons as a base, and then play around with the player camera. I wanted a camera animation, sort of like they have in Fallout 3 and forward, that when you interact with a computer, your characters camera zooms in on the screen.
And I must say… I managed to make something like that! Check out the video below for a very short video showing my progress today!
I had to look into how to disable the players movement while being active in this state, that way you can’t accidentally run away from the place you where in when you started the interaction! I also had to look into how I would disable and enable the visibility of the UI elements once you activate this state as well. It took me longer than I realized until I figured out a SUPER EASY fix… I’m happy with todays result tho!
Again, thanks for taking your time reading all of this. I know there are a few of you who do and it really is part of why I keep working on this. Some days it’s hard to keep positive with the work, ya know? And as always: Let me know if you have any cool ideas or “stereotypical” horror game mechanics I can play around with in the future :) I’m open for many ideas!
Day 4 - Interactions, Part 2
Today I kept going a bit to learn how to connect the buttons I’ve made to events in the game levels. I played around with attaching lights and their properties and learned a bunch about UE4s Sequencer. Coming from UDK and being used to Matinee, they are similar, but it’s confusing when in earlier versions of UE4 they still called it Matinee… so I had to go off-track from my tutorial and managed to work things out anyways!
I also played around with meshes and their movement and it seems to work fine. I think tomorrow I will look into more things regarding universal variables and how to play around that! Especially now that I got buttons it will be fun to play around with triggers!
As always, here’s todays video so that you can enjoy the progress JUST AS MUCH AS ME! :D
IF YOU HAVE ANY COOL IDEAS let me know! I’m completely new to blueprints in UE4 and doing the technical part of developing a game in general. So I’m happy with ideas and tips from all of you. Thanks for reading my boring updates :)
Day 3 - Interactions, Part 1
So today I decided to work on “simple” interactions for my game. It took many hours before I could find a tutorial that would teach me a FLEXIBLE way of creating such a system. But I eventually found something that feels right and would work in my game!
There isn’t too much to say today, so I’m just gonna leave a preview image of my interaction level as well as a video! Enjoy!
Day 2 - Adding a flashlight
So today I took about an hour to look around for tutorials on how to make a flash light. It’s amazing how much I’m learning of Blueprint just by doing these basic things! I feel a bit comfortable now with variables and how to use them properly, as well as toggle booleans etc. The only thing I don’t know about are all the different functions that are pre-built in UE4, but hey, the more I spend on this the better, right?
This is how it turned out!
Video example below!
So what I wanted to do with the flashlight is to have a slight semi-realistic feel to it. So I have a sliiiiiight delay in how the flashlight follows the camera movement.
I also added a material to the light so that it got those pattern that flashlights do. There is no flashlight out there that is perfectly shaped as a circle! So I made one in photoshop and I’m ok with the results of how it looks, but I might want to tweak it later.
Third thing I did was to lower the flashlights position on the character so that it is lower down, giving anything it shines on shadows that are visible for the player. I think this is one of the best parts that makes it feel a little bit more realistic. In real life you always see shadows from your flash light.
Last thing I did to make it more realistic was to play around with the temperature of the light, not the color, the temperature. They are different. This gives the light a slightly more warmer tone, I might change it later on! I just don’t want a perfectly white light.
So that’s it for today! I apologize for a longer post and I hope it’s interesting enough to keep following :P
Day 1 - Creating some basic movement
So today I wanted to make my own movement mechanics from scratch using the Blueprint feature in UE4. It was a lot easier than I thought it would be, but on the other hand, customize it might be tricky. However, I got movement working and I’m really happy with the results!
Right now you can: Walk, Sprint, Crouch and Jump! The tricky thing to do was to make sure that you can’t stand up if you’re underneath something while crouching… so I was able to do that! A bit tricky math using Blueprints, but hey, it works! The second thing I played around with was the strength of your jump while crouching. So now the jump is not as high if you’re crouching as if you’re standing up.
This project I also want to try and record a video of my progress every time I do make an update! So here is todays video, it’s not too long but it shows all the features that I did (and some environment stuff that I’ve worked on).
YouTube link here that shows the movement mechanics so far
Let me know what you think! :)
Estimated Timeframe
Apr 24th - May 24th
Week 1 Goal
No real milestone other than play around with Blueprint and learn a lot of it’s basics. Most likely this week I will implement the player camera and movement. The game is going to be played in first person, so hopefully this won’t be too hard to work on!
Week 2 Goal
More advanced movement like crouch, crawl, jumping? Look into more camera effects perhaps?
Week 3 Goal
Interactivity with the environment, lift items, open doors etc.
Week 4 Goal
If by some miracle by this point I’ve learned a lot, I want to delve deep and start looking into my inventory mechanics that will be one of the USP’s of the game. I know this might be incredibly hard due to my lack of knowledge in blueprint and scripting in general… but we’ll see!