@@ijaydubb if i was a map maker, i would make a bounch of great ramps and places to slide and would give every one of them tiny bumps not noticable while walking , but always stopping trimping and rocket jumping >:DDD MUHAHAHAHAHA
One disadvantage about stair-stepping is that it can be jarring to have your camera snap up whenever you climb a step, and it can cause motion sickness - this is part of why I prefer ramp stairs.
Vintage story had this issue, it was most noticable when sprinting up stairs, especially if the particular stairs also was of a type with a built in speed bonus. Small steps were fine but if the height required a few seconds of travel time it got very jarring. Eventually someone came up with a solution which made stair travel not jarring, but that fast wall climbing exploit is still possible .
Thats a failure of the camera system, the camera is not climbing the stairs, the character is climbing the stairs. The camera shouldnt be constrained to the in game physics, but instead have its own set of rules for how it should behave.
Even if you smooth it over a few frames it's still unrealistic. To get the head bob you see in video games, you'd have to straighten your legs out at the top of each step before going to the next step -- something absolutely no one would ever do. Instead, your trailing leg only fully extends as you reach the top of the next step, and your leading leg remains bent at that point. This results in smooth diagonal upward motion of the head. Ramps are simply closer to reality.
For anyone curious, have 2 raycasts - 1 for the bottom of the collider and another slightly above that. Both casts should be pointing forward. The bottom raycast checks if a wall is encountered, the higher one checks if the player could/should be able to climb over it. If the bottom one hits but the higher one doesn't, apply negative gravity. This makes it look like the player is actually stepping up stairs in first-person. This setup requires some tweaking obviously.
Modern Warfare 2019 also has a very unique way of using viewmodel animations to make going up stairs more convincing than I've ever seen. Your character will sway their guns a lot faster to visualise them having to take more steps in quick succession, as well as slightly tilting their gun. It's extremely basic and simple yet adds so much to the immersion of just walking around the map and one I'm surprised not many FPS games prior has done. It's kinda hard to explain in words tho.
Years and years ago I played a 2D flash shooter that had a level editor. The game did stair stepping, but the stair step detection was taller than the smallest unit of measurement in the level editor. If you did it right, you could arrange a bunch of 1 unit tall platforms with a 1 unit gap completely vertical and just functionally teleport upward. Best part was the game had ragdolling, even (albeit much more rigid) while the characters were alive, so in the precious few visible frames while ascending thousands of units you'd see your guy folded like a lawnchair.
I instantly thought of Minecraft's cake staircases at 2:10 (although you have to ride a horse for them since horses can step up an entire block while players can only do half a block without jumping)
Stair smoothing is best done on the camera only, so it doesn't make stair stepping unnecessarily slow. id Tech 3 has a very good implementation of this that still stands the test of time today (much better than it was in the Quake 1 and 2 engines). The downside of applying it on the camera only is that it won't smooth out the player from a third person perspective, so you'd need to apply this offset on the player model as well (which can come with its own issues, such as being misaligned with its actual hitbox for a split second). It's also worth considering that using ramps instead of stair stepping makes it possible for projectiles to smoothly move up/down stairs, which is sometimes desired for gameplay purposes. For instance, if you have a grenade launcher, you may want grenades to roll up stairs even if it's not realistic to make the grenade launcher more usable at the bottom of a staircase. Otherwise, most grenades would end up bouncing back towards the player shooting them due to the "wall" of every step bouncing off grenades.
A combination of well designed weapon projectile only clip brushes helps provide bouncing while still retaining correct stair mechanics for the players. Collision layers are an amazing tool! Quake 3's stair stepping algo is still the gold standard, if you ask me. But that's an opinion :)
I'm my step step implementation, I keep the collider physics all the same, but apply smoothing to an internal "body" node. Useful for 3rd person / multiplayer!
@@sinewavey Grenade clips are the solution used in CS2, and they make a lot of sense for walls/ceilings, but that game has always used clipping ramps for stairs as well for player collision. It's a solution that works but involves a lot of manual labor at a large scale.
@@Calinou Yeah, it was always an oddity to me that TF used so many clip ramps for stairs despite it having the ability to. But I guess if you need weapon clips you might as well use the player clip and make some things feel smoother as ramps don't affect you in the same way as in say Quake.
The "magic carpet" strategy is my favorite, which I use in my game: The character is just always floating above the terrain at knee height, like a boat. A downward scan gathers the distance to the terrain as you pass over it, causing you to gently rise or sink by applying a force proportional to the error. It handles all irregular terrain as well as stairs and always feels smooth.
Usually when people suggest ramps is when they're not really seeing the full scope of the problem: stairs are not just staircases: stairs can be everywhere. The same code that can climb a staircase is what will climb a sidewalk, or a small box, or any kind of small prop model, or a stepped rock, or any kind of steps you might have in your geometry. Ramps can only be feasibly used in very simplistic levels, if steps are few enough that mappers can be relied to not forget any.
but i'd still rather the map maker clip steps so my camera isnt moving up and down constantly. if there is so much shit on the ground that clipping would be a problem, then stair stepping would be a problem too.
Camera movement that jumps is the worst possible scenario, camera movement that moves forward, stops, moves up, stops, moves forward, ect... is still *really* bad. Solve other objects with any strategy you want, but the intended path shouldn't contain jarring camera movement, so you either use a ramp or otherwise allow the controller to have smooth movement
Something interesting about Doom stairs is that the marine can climb any sector that is 24 units or lower, so a bunch of time you can Go up places you don't look like It would, modders uses this + the thin stairs exploit to make ladders with out the fancy scripting some sourceports (like GZdoom) gives you
Duke 3D does a similar thing but IIRC it fixes that exploit checking the difference between Duke's position and the destination point instead of just checking the height of adjacent sectors. This also adds some kind of "Coyote Time" making jumps a bit easier.
And yet one of the things we see commonly done in CS for the last 10 years has been adding clip brushes over stairs so they all act like ramps. Heck, I even do this in my HL2 maps.
It's interesting that you mentioned CS:GO, where developers deliberately turn most stairs into ramps, specifically to give that smooth feel and avoid throwing off your aim
Yep, stair stepping is incredibly hard to appear genuine and needs a ton of smoothing and animation trickery to look good, but there will always be something off about it and so many things can go wrong or bug out, especially with differing sized steps. Ramp allows the animation to stay natural and flexible in size whilst limiting any problems, the player never sees the ramp so the brain fills in the gaps of assumption, like any good animation will do.
I am talking within the context of Unity specifically but this can work in anything, my favorite(underrated) solution for games with a physics player: shorten the players collider to be about their height without legs, then hover the player to the intended height by applying a continuous force (ray cast down player height meters from head, add an upwards force to the character that’s JUST enough to hover them to their intended height, then add some damping) and then your character moves nice and buttery smooth, over small objects and stairs with ease. The only downside is the character has accelerated motion and would take a lil bit to get to it’s intended walking speed which isn’t always good for instant reflex games, as well as needing to separate the camera from the player body transform in order to prevent camera jitter. You can adjust the bounciness, the height, the friction, etc. it’s a very nice system and makes jumping and crouching very easy to implement
I use godots physics server to test if the body of the player can sit on the stair then teleport up. This covers a lot of edge cases. I also have the camera lerp to the new position to smooth out the transition as you can get some jittering on un-even surfaces. You also have to be aware of ramps, had a bug where the player began accelerating up the ramp as the character controller was handling the ramp and the stair step was handling the ramp.
Unreal Engine already has a "Character Movement Component" that handles these use cases. You can define the Max Step height as well as max walkable slope angle.
That's still using stair stepping behind the scenes though, surely? Even if you don't have to implement it yourself it still pays to be aware of how your game engine is doing things so you can troubleshoot edge cases
Funny how you used CS as an example of stair stepping. Yes, it supports it because of how old roots of Source are but over the many years of development of CS series and TF2 as well, both Valve and even community worked on smoothing out the stairs with simple or complex ramps because a series of stairs where you just keep bouncing is neither realistic or fun. It's just jarring to look at. But hey, Valve can do whatever, what do they know about good design and what players prefer? Well turns out most players agree. The very same 3Kliksphilip whose video you used has another video about the curved staircase on Dust II. How many times it changed, how for the longest time it was bumpy, how players developed a pattern of invisible colliders that could work with the shape and within Source engine and how finally Valve used a very similar solution to the one provided by the community. The best solution for many seems to be a ramp starting after first step so you get a single bump to know you walked onto the stairs and the rest goes smoothly. Just a bumpy staircase? Big nono.
There's a larger issue with having steps _anywhere_ that games need to account for. If you jump while moving and slightly graze your collider on one, you'll instantly come to a stop which is dreadful especially during combat. Source does nothing to accommodate this which is another reason Source mappers are obligated to coat everything in clip ramps.
I've recently started working on my first 3D game, and hadn't looked into how others handle stairs, but only gave them a little bit of thought. I hadn't considered doing a hitbox near the feet, but had thought of just casting a couple of rays in the direction of motion, one at the feet and one just above the max step height. I figured if the bottom one hits an obstacle but the top one doesn't, it means you ran into a step you can climb.. That way the length of the top ray can also determine how steep the stairs can be and still allow the player to climb, because if it's too steep the ray will hit the next step up. But now that I'm thinking about it, that may not work well when going up a sloped floor because only the bottom ray would hit the floor so it would be treated as a stair. Thinking out loud, though, if the bottom ray angles upward at the angle of the steepest slope that I want the player to be able to walk up, it won't hit the slope, and that might work for my purposes.. or if I don't change the angle of the bottom ray, but instead check the normal of whatever it collided with, I could tell whether it's a slope I could walk up or something I'd have to step up.. hmmm.. I'll need to look more at this. Thanks for this video, it's made me think about things that I had been putting off
You could go with your original solution and interpret the result based on how far the upper ray traveled past where the lower one hit. This distance could be based on, say, the minimum step depth, maximum floor steepness you can travel up, minimum distance you're allowed to be from a wall, or some other criteria. Something to think about.
I've been working on an FPS in Godot, and I spent a while trying to figure out this issue. Eventually, I decided to just use ramps- due to the way momentum works in my game, snapping up stairs would fling the player into the air at a very high speed. The player is able to skate at up to mach 0.3 currently, so the plan is for collision and visuals to not match 1:1- if they did, a cable could send the player flying a hundred feet in the air, which would feel wrong in power armor. Although, a cable would be more likely to stop the player dead, or deflect them 45 degrees, as I'm having the player and all enemies use cylindrical hitboxes.
It's a little weird to me that most games of the 21st century opt for the ramp approach, considering that Doom had smooth stair-stepping all the way back in 1993, albeit with the exploit seen here (most famously seen in MAP19 of TNT: Evilution).
@@Bananenbauer123 Except it does exist, just not for everything. Cacodemons can float through "windows" and right over other enemies at whatever height they please, for instance. Id made a 3D engine and then yanked some of the math required to make the axis actually work properly for the sake of speed, but people overexaggerate how drastic it is.
An approach I've seen some folks use is to use separate "climbing" collision for the player which is in the form of a sphere or an ellipsoid, so pushing forward lifts them up through the lateral force of the step's corner on the climbing volume. This also happens to give you a few other nice benefits for free, like an inherent limit to how high you can climb on a single step, and slows you down during climbing and gives a much more graceful height transition.
For an example, look for Paul Nettle's whitepaper entitled "Generic Collision Detection for Games Using Ellipsoids" which is I think where I first saw this technique.
Then there's GTA IV. The character actually stepped on every single step and had to slow down to run up a staircase. Even NPC's did so too. A funny thing to do in the game was to find the longest staircase and walk up to an NPC and bump them so they stumbled. If they couldn't catch themselves they would trip and actually tumble down the stairs in an extremely realistic fashion. That game was so ahead of its time.
the downside of stair stepping is that it can be visually jarring. at least to me, a lot of games that implement stair stepping can make my eyes hurt. of course, this all depends on the game and its implementation of stair stepping, if it uses it.
I do really love how Sucker Punch handled stairs in the Sly Cooper series (and I guess inFAMOUS as well as they implemented the same system there but it blew my mind as a 5 year old in 2002) where they had a hybrid system of the slope method but the stairs were still coded in a way where whether the player were walking or just stopped, the inverse kinematics of the legs would still reference the stair step and place the foot on it even altering the idle animations foot and leg placement and movement in the process. It was always so funny to get Sly somewhere where the ground was flat but there was a sudden slope transition and watch him go into his idle animation where he crouches and watch one of his feet and the leg it was attached to just pop up higher than the rest of his body in such an unnatural way.
stair stepping has the drawback of being unrealistic in terms of head movement. in real life your head goes smoothly up almost in a diagonal line (can be if you try but normally there will be some amount of deviation). ramps are actually more realistic in this way.
I think for most competetive shooters (but depending on the type/ style) it is better to have some kind of slope, the jitteriness can be annoying, both for the player on the stairs as well as for the second player trying to kill the player on the stairs (the head youre aiming at jumping up & down). Even if you have the gradual steps, I think this is most effective if you have really good animation that makes the player model move realistic, which isnt always so easy (I think). But even if you have really good animations, it can still be abruptive to the flow/ speed of moving around. For CS, I think it was the right decision to go for slopes with the rotating stairs in "lower" on the dust2 map, even when it meant they had to make the stairs more narrow.
I like to reframe it as a "curb" or "step" problem. Since its something you'll probably want a general solution for. Imagine what you would have to do for a curb step that can move around if were using the ramp method. My trick is to make the hitbox not cover the legs and use a raycast to determine what height it needs to adjust too. This way you dont even notice the little things you step over and you go smoothly up stairs.
Yeah the way the camera just jerks up all of a sudden when you come do a step unlike how it would be in real life if the camera was equal to your eyeballs is kind of interesting.
Stair stepping is so jarring tho. Maybe it’s just tf2 trauma but I absolutely hate it. also, in real life, waking up stairs isn’t actually that bumpy, so the ramp solution is more intuitive.
Or you use a pillbox collision and let the force push the object up the stairs purely in physics. As long as you are locked on X/Z rotation, if you push hard enough your character will 'slide' up the stair via the slope of the bottom sphere of the pill collision. Not only is it essentially code-less (if you're using a physics engine), it also gives stairs some heft. You can change how the sliding feels by adjusting the friction of the stairs or player collision object.
Another solution is 'Inverse Kinematics' where you partially separate the legs and the rest of the body so the body is more stable while the legs move move to adjust to the terrain. This is often used for animations but it is also sometimes used for physics.
this is such a huge deal. im happy more people are talking about this and its awesome to see youve made a video on it. trying to create this in godot was one of the hardest things i tried to solve as a beginner gamedev
talks about stairs uses footage from gamma gamma, the game where the staircases are known to get you stuck/ not smooth ascention of the staircase just run up the stairs from the bar in rostov, im bunnyhopping up to avoid the steps xd
I added stalagmites to MineTest, built out of nodes atop one another at decreasing widths and depths... Starting from 2-8 decreasing until 1 or not-an-air-node. The character shot up the side when testing it's collision. Now I understand why, thanks to this video. Minetest is using approach B (stepheight). I'm not changing it, however... because I find it fun. I will find a 'world physics excuse' and make it consistent, the same way gravity only affects particulate or detached nodes like dirt or sticks (otherwise a collapsing world happens which collapses your hardware too!) Fun.
The MOST frustrating things about staircases in games is that they are rarely follow the rules of designing a fucking staircase 2h+b=S(63±3см) and almost always have 45 degree or another fine angle or nonsense proportions because artists cannot figure out how to make them fit in modules (thing that was figured out by fucking ancient Greeks)
There are few things more jarring in a video game than having to jump up reasonably-sized (ie, an able-bodied person could step up them without assistance) stairs.
@@ananthukrishna5259 Oh, sorry I misread that, I thought you meant literally using the collider of the players capsule to “bump” you up the stairs, lol
@@Dr_mafario lol. but thats the first character controller you learn to make tho... what I meant was the other one. where you make the capsule float by raycasting downwards to check the distance and applying appropriate movement upwards to keep it in set height.
Moving the camera along jagged stair collision, even with interpolation, is terrible for people worried about motion sickness btw, especially at faster movement speeds.
Another solution is to also measure the depth of the stair so the player can only take a step up if there is enough room for the player to stand on top
The way I handled steep stairs is by reducing the player's horizontal speed based on the stairs angle (horizontal/vertical distance). This way the height increase is capped. I even used this to make ladders that are effectively near vertical stairs.
My favorite method of this is Payday 2, where everything is smooth, and there are no different surface types for walking collision and you instead just don't climb slopes angled too high. What this does is let you "climb" up steep slopes by repeatedly jumping, since you're technically colliding with a surface from above while climbing anything that's not vertical or backwards-sloping. This would obviously be terrible for many many games, but it opens up a ton of freedom of movement, without making things overly complicated (no dedicated "mantle" button), while creating synchronization between the act of climbing a sheer surface and the inputs needed to do it.
Walking up stairs slow you down as well, which is something I don't see implimented a lot. However, I think it is in GTA V and other "photo-realistic" like games do have this realism with stairs.
I actually really like Honkai Stair Rail's approach to stairs. They have the stairs as a ramp, but if you pause on stairs, the characters gets ever so gently pushed up in order to actulaly match the visual appearance of the stairs. At least, this is what I think they do. I noticed the phenomenon on some relatively low incline stairs, so I may have simply been mistaken.
Our real vision is stabilized by our brain, that even “cuts out” some of the frames in between larger eye movements. That’s steps translate badly into gaming, where camera view is not that stabilized.
I remember the Stalker games having some weird stairs. They felt like they weren't always working as typical video game stairs, but I can't remember what they actually did.
Extremely steep stairs can be an interesting way to make slightly leaning ladders which is kinda cool I suppose technically you could push it to the absolute limit to make mostly vertical ones too
My favorite "exploit" is the crouch jumping feature in the goldsource engine. The feet come up to meet the player's butt and then the model falls down when you crouch, so if you are holding forward you can "jump" over small ledges just by holding forward and crouching. This is easy to do in Day of Defeat and I assume it works the same way in HL, TFC, CS 1.6 etc...
>the simplest solution The simplest solution, used in quake and doom etc is to have a 'stair height' and the player simply goes up the stair. The downside is this is jerky af. Coming down can be interesting too, in quake the player seemingly sticks to the floor and zippers down the stairs. In other older titles the player speed makes them just.. walk off into the air and essentially fall. The stuttering effect was exacerbated by the collision being a box instead of a capsule (at least in UE the rounded bottom smooths out the stairs to a degree). edit: ah, you prefer this. it is the OG method. Also the super narrow steps is how ladders were done in really old fps that did not support ladders. Make a the super steep staircase out of clip brushes and chuck it on a ladder that has no collision. Didn't work for really long ladders, and you couldn't "climb" down it but who would want to climb down a ladder in quakeworld.
The larger downside is that if you jump while going up stairs or any slight lip steeper than 45 degrees and bump your collider on the edge, you instantly lose horizontal speed which is dreadful especially during combat.
2:40 - Or you can keep track of how fast you're going up vertically and then stop stair stepping for a set time frame, or until you return to the level before the "rapid stepping" happened.
2:45 i was so certain you were going to say "add upwards force to the player character" and then give examples of using steep slopes to get insane vertical momentum
I like the floating capsule solution that the devs from "very very vallet" came up with, since is less prone to exploits and it is easier for level design.
In my modded minecraft world I have a pair of boots that lets me auto step up an entire block, so I made a "staircase" using progressively thinner slices of blocks to get up to part of my base
In the 3D game I'm making (Seas of Reverence), my early implementation just uses ramps. Since the player always knows what kind of object it's standing on, it will be a simple matter of the stair block specifying the step dimensions. Then the player can behave differently depending on those dimensions and where it is within a step.
In tactical games like Counter Strike most of the stairs are smooth ramps so the sudden bump up or down doesn't throw off people's aim when they are trying to move up and down.
You reminded me of my fascination with interaction between the character model and environment in GTA4. It may be a bit much to call it realistic, but it was certainly more realistic than not in so many miniscule ways that I don't think I've seen in any other games (even GTA5)
Now the ultimate challenge of making 3rd perso character's walking up stairs animation accurate with their legs while it not being scripted or jarring or slow or annoying. Has anyone examples of games that do this well?
How to fix stair steppin when using the built in godot level editor. Put the stairs in a group, when colliding with an object, instead of calculating height, check if its in the "stairs" group.