Spent a few hours sculpting a skull. Came out ok, I think.
Finished off the low poly retopo of the skull and textured it in Substance Painter. Yup, that’ll do!
The skull’s going to be a pickup/throw item, as well as an NPC.
I started the pickup item first, and noticed that I’d never consolidated how these were done in the blueprint. There was a lot of block-copy-coding in evidence :D
Decided to make the existing throwable pot a base to inherit from and did some tidy-ups in code to make that work. To be honest, it should all be pushed back to the C++ class, but the BP works, and I’m lazy.
Once that was done, I was able to make pickup/throw and destructible versions of the skull, which also react to the sword. Needs audio, and I think I’ll do a little extra and allow you to hoik out their content with the fishing rod, as well… On the TODO list.
The rest of the day was spent in a branch, integration Fluid Ninja Live and playing about to see what it can do. Didn’t work for my initial idea, but I think it’ll do what I want for some of the stuff in an upcoming dungeon.
I’ll come back to that later…
Only had a couple of hours, today, but I put together the AI controller, and BP for the Skull NPC. Made a start on the first movement AIAction. I want the skull to ‘hop’ toward the player, but I’m not entirely sure how to do it. Or, how to make the character controller jump.
First pass is to lerp to position, pause for a bit, then lerp again.
Was teaching, so again, only had a little bit of time today… Used it to explore my movement options. On the plus side, making a character jump is as simple as calling the “Jump” function. [IKR?] But, getting it to jump and move to a precise position, using navigation, looks wank, so it turns out that my first idea, lerping, is going to be the best. Durations will always be constant, and I can use a timeline to control the vertical offset to get the sort of hop that I want.
So, after all that, back to where I started…
Made a few behavioural changes to the skull. Now it jumps toward the player if it has line of sight, otherwise it jumps around randomly. If it gets close enough to the player, it screams, spins about, and then explodes, which will result in an area effect. Well, it will whenever I get around to putting damage into the game.
I was dithering about how to handle playing audio and spawning VFX, when it dawned on me; I created a load of delegates for when AIActions change. By adding an additional one for entering an action, I can let the BP latch on, check what the gameplay tag is, and do something. So, if we’re exiting a jump, play the landing sfx/vfx. If we’re entering explode, begin the process off killing the NPC.
This addition meant the AIActions remain generic, which is good. Not that I think I’ll end up re-using this particular set, but as a point of principal…
I have one problem now, which is leaving the spawned particles in the world when I destroy the skull. I thought I’d be able to detach the Niagara component and let it play out, but apparently not, so I think I’ll put the flames on a follow actor… tomorrow.
My lazy hack of using follow actors worked. Flames now linger when skulls are smashed. Yup, but whatever.
I want another variation of the skull, that bounces around the room, but I don’t want it to use the existing static collision geometry. I want to confine it to spaces that might have doorways, or gaps.
To do this I’ve added a new physics trace channel, and a response profile. I can place a flat poly in the world that’s visible in the editor (invisible in-game) and set it up to use the new response profile. The movement AI [in the skull] throws out a sphere trace along the channel, detects the invisible poly, and then does its thing. In this case, reflects the movement trajectory.
That shouldn’t have taken all morning, but it did… There’s something about UE’s physics setup that means I always have to do everything at least 3 times. It’s like plugging in a USB stick.
Anyway, I still have a few audio bits-and-bobs to add, but the skulls are very nearly there.