Character Movement [Prismatica DevLog #01]

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
[Music] [Applause] [Music] [Applause] [Music] today we're going to talk about movement because movement is everything in a game [Music] movement that i hate call of duty you can completely shift your momentum 180 degrees in a single frame but on the other side i hate games where the movement sacrifices playability for the sake of looking good gears of war the movement in that has always kind of frustrated me but at the same time i don't want it to be like zippy it's all about finding that middle ground i guess this is what we have so far all right you ready look at that and then and then if i hold down shift he faces the the cursor i mean it's a bit laggy but i wanted it to be sort of laggy and then make the torso twist first so the torso moves and then the legs move which is kind of how humans move i guess you don't just like turn your whole body at once when you when you're thinking so this is it with the when the torso moves first i think that looks way better it doesn't look like he's looks like he's got [ __ ] heelies he's just just zooming around and then on top of that we add leaning so he he's leaning in the direction of acceleration or deceleration so when he stops he kind of leans back a bit that's what humans do you know that's how you impart momentum i guess you've still got [ __ ] healies bro i should make a maybe i should make a heely like tony hawk's pro [ __ ] heelies hey hey what's up and i've also got yeah like the uh i'm calling it combat mode i guess so when you hold down shift you walk slower but you can freely rotate and like strafe you know so now it looks like he's on a on a hoverboard or something so i've hooked in all of my animations that i lovingly crafted in blender which i've just been [ __ ] around with i used to use a pivot stick figure animator in high school this is one of the coolest things that i found about using this engine right so i mean i'm sure every engine has it i just didn't know it was a thing but they're called blend spaces and so i've got my idle pose and then as this little slider goes up it blends into the walk and then as that goes up further slowly blends into the run the cool thing is that it goes both ways so you can do you can blend it between your like sideways walking animations and stuff and then backwards when your capsule has like momentum and stuff and the turning rate is an instant like this uh if i go in slow motion you see that it sort of goes through the sideways ones into the forwards ones and goes from walking into running there's no point where you think okay that's the walk animation and then that's a run animation it's just the same it's it's [Music] cool very cool this is fun so another thing i've done is um when you jump it always uses the the the forward foot to um to jump from i used animation curve so i just went from one to negative one back up to one and then when you press jump it fires an event which says okay is it above or below zero if it's above zero play the left jump animation and if it's below zero play the right foot jump animation yeah looks good i've made this little i mean it looks really stupid so this is for when you land from jumping so the way additive animations work is that they have a reference pose which from this one is like this this pose and then you can add that on top of other things so it says at this point relative to the reference pose this bone is doing this so in the animation that it's on top of it says okay do that same thing rotate the bone so if i get one of my walk for okay that looks [Laughter] what have i done what have i done no okay that's a real that's a really bad example run loop okay yes okay so you can see that he's running [Music] and it's playing that landing compression animation over the top of it what i'm thinking of doing with it is if you hit the ground with 10 velocity then it'll just be like really subtle but then if you hit it with like maximum velocity it'll squish you down heaps so but um let's go ahead and add that so if i jump from here and and you see it squishes down but if i go from like here it doesn't go down as much or if i just jump it goes down a tiny bit so next up i wanted to do when you jump a little bit too far you're not dead but you've hurt yourself depending on how hard you fall when you fall fully and when you fall like at the start of this where this threshold plays it'll just it'll just you know play this sort of half falling animation versus this one and then it also blends the computer just [ __ ] just does because it's so smart so basically when you hit the ground it stores a variable of what was your velocity in the z axis at that point and stores that and that determines you know what this blend space plays i ran into a bug i was stuck on it for like 30 minutes i was like why is it always playing the shorter animation and then i realized that i had the axis values set into positive 800 and positive 1400 i realized that when you're falling you've actually got a negative z-axis velocity i've got smooth brain but uh i fixed it and so this is what it looks like in the game i've also added um if you fall too hard you just rag doll and you die oh [ __ ] no let's jump off [Music] hey nice so that was like a smallish landing i guess let's see if this kills us that was sweet that was amazing i love that i love that all right let's do it let's do it again let's do it again i also added in a um it's just a button you press k and you just die so oh all right enough enough enough when you press the space bar and you're not in the in the combat mode you will jump first it checks is there a wall to climb i'll give you a quick little rundown of how it works this took me a really long time to figure out because there's so much maths and geometry in game design and i wish that i did more complex maths in school i just did general maths i was good enough at maths that if i did general maths then i'd pass and i'd get a good mark and it would be so easy that you know i'd only have to come to half the classes and that's essentially what happened what we're doing first is a check to check if there's a roof above the player so you don't climb through a roof next to a wall just get the location of the actor add 300 do a line trace from that point the end of the line trace will be at like the torso so if that hits anything at all with this little return value then do nothing but if that's false then we go down here things get a bit hairier like spaghetti [ __ ] blueprint bolognese so this says is there a wall in front of the character get the actor location plus 30 so that's like it like chest height i think that's where it starts and it ends by getting the forward vector of the character i've times it by 80 which makes it go out in a direction if i draw it and go persistent then whenever i hit spacebar it'll shoot a little red dick out of him that's basically just checking is there a wall in front of you and i can do it while i'm jumping oh [ __ ] this still is a variable of where it hit the wall and what the normal was so the normal is if the wall looks like this and you hit it then what's like the right angle of the wall not not the reflected angle of the beam but what's the angle of the actual thing that it's hitting it uses that to basically get the wall shoot it move a little bit past it and up and then shoot the trace down from a certain point and that gives us the height of the wall and this one checks the depth of the wall because i want to have separate animations for when you climb onto a ledge versus when you're climbing over like a wall you just vault over a fence but you'd climb onto a little ledge basically and this just sends another trace down but further back and it says is this how different is this one to the the first one this is just a little logic spaghetti that determines okay is the wall short is it tall is it thick or is it small and this little section says set those [ __ ] variables so is wall tall is all thick can climb and just as a little check set is falling too false because i had a little issue where if you were falling and grabbed onto something then when you got up from the wall you'd still you'd go into the falling animation and you'd just be like floating around doing this it's like oh [ __ ] so let's see what that looks like i'm just using longmire's um animations yeah so there's two separate animations there's the the climb up with the two hands and there's the little little vault and i've rigged up a system that makes it so that your hand always is at the top of the ledge and you can do it while you're running looks good feels good and yeah the short one as well okay that was [ __ ] just just pretend that didn't happen there we go that was the the short the short climb you know what's better than uh this lamborghini knowledge i think i'm gonna leave it there for today i think i've rambled heaps and if you're still here thanks but basically the movement for the game is um it's essentially done and i'm just having a blast like just testing it out finding little bugs little hiccups that completely break the game it's just fun to just play around in this little you know bloody test level that i've made i've worked on some of the visuals like some of the style and stuff a few little prototypes and just testing out you know shaders and whatnot i'll get into that next video i think i think i think that's what we'll talk about next i think we'll talk about some materials and shaders and this post-processing that i've set up this sort of cell shader anyway it's been great and i hope to see you in the next video so with that goodbye [Applause] [Music] you
Info
Channel: PrismaticaDev
Views: 27,882
Rating: undefined out of 5
Keywords: unreal engine, indie development, indie game, solo dev, solodev, ue4, procedural animation, animation layers, stylized, character movement, game design, game controls, game dev, indie dev
Id: hb8z-V4nMto
Channel Id: undefined
Length: 14min 8sec (848 seconds)
Published: Thu Nov 12 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.