Adventures with Lava
By Sergoth aka Trevor Smith
Soooo... Adventures with Lava!
So today, my task was to create a prototype hazard for movement challenges, and I went with one of the staples of the adventure genre, good ol' lava. Lets run through how we made it!
So first, I made a BP_Hazard_Template actor blueprint which just contained a static mesh as the root object. This is the class I'll use to call various hazard types during the procedural dungeon generation.
Next up, make my BP_Hazard_LavaPool, using the BP_Hazard_Template as the parent. So far so good. I've got a static mesh, but we need to give it that magmatic goodness.
Hopping over to the Unreal Marketplace, I grabbed the Infinity Blade: Firelands Project, free from epic games, and migrate a nice lava material from it. Opening it up in the editor, I see it is rather bare bones, so I expose some variables as params to be able to edit them within my blueprints, specifically a texture scalar for tiling, FlowSpeed scalars for both X and Y axes, and a scalar for the emissive brightness.
Next, time to make the lava damage the player! Woohoo, looks like Epic has already provided us with a tool for that, the aptly named 'Pain Causing Volume'. Aptly named, for little did I know just how much pain this volume was going to cause me.
Alright, slap it in as a child actor, spend time exposing it's variables to the main blueprint so I can set them during construction... Hmmmm... the viewport isn't showing the volume as being... well, a volume. Just looks like a point in space, unlike when you drop one into the world outliner. Whelp, I'll just try making it's relative transform equal to that of the static mesh. That should work, right? ....RIGHT?
Spoiler alert, it did not work. And neither did a few dozen other things I tried. No matter what I did, I could not seem to get this volume to actually have some sort of area. I finally resorted to asking ChatGPT, but it just accused me of being an idiot, and swore up and down it should work.
An hour of Google-fu later, I finally came across some posts bemoaning the fact that volumes weren't supported inside of other blueprints.
....What? That can't be right... surely Epic wouldn't make an easy-to-use damage over time zone and then make it so it couldn't be used within a blueprint...
Nope, that's exactly what they did back in UE4, and it still hasn't been updated in UE5.
Once I realized that, I wrote a simple logic gate loop utilizing the ActorBeginOverlap and ActorEndOverlap events. Took me about 3 minutes, and worked like a charm right off the bat.
The lesson learned? Sometimes shortcuts aren't so short, so practice your KISS coding principles.
Reign of the Necromancer
A fast-paced first-person dungeon crawler roguelike
Status | Prototype |
Author | Ante Up Studios |
Genre | Action |
Tags | Dungeon Crawler, Fantasy, First-Person, Roguelike |
More posts
- Adding the Upgrade PoolJun 18, 2024
- Debug logs on screenJun 15, 2024
- Problems with Packaging the GameMay 22, 2024
- Missing Nuget PackagesMay 22, 2024
- Problems with Player InputMay 21, 2024
- Game SynopsisMay 21, 2024
Leave a comment
Log in with itch.io to leave a comment.