Creating the perfect player controller takes time, but once done, creates an amazing experience for your players.
I originally set out to recreate the Celeste controller, but for a 3D world... That was not accomplished in this video. Not because of time, or patience, but because I created something which feels so magnificent to play it would just be a shame to not release it as it is so that other indie game devs can take it and run wild.
Play the game: https://tarodev.itch.io/player-controller
'Better Jumping' by Board and Bits:
[Music] i set out to recreate the incredible celeste controller now i know what you're thinking this has been done many times before but i plan on taking it one step further by turning it into a 3d controller my first task was to recreate the original controller as it is today working on a 2d plane so i began filming some reference material some basic running light jump full jump jump dash etc once done i drew the trajectory of madeline performing a jump dash and recreated a scene which matches the layout from the game or close enough this should provide consistency for my tests i spent some time getting the jump feeling similar at first i just added additional downward force when the player was descending but i found this still a little bit floaty at the top of the jump i ended up checking if the y velocity was less than my jump velocity falloff variable and then apply the additional gravity at that point it yields a snappier less floaty jump using this same artificial gravity line i also checked to see if the user has stopped holding down the jump button and apply it early to give the player control over the height of the jump i created a dash by adding velocity according to the player input and disabling additional input for a short time i also found disabling the player's gravity during the dash yielded better results wall sliding and grabbing was achieved by checking for a collider on either side of the player using overlap sphere and then detecting if the player was pushing in that direction i set these to global variables as they're used in multiple places through the flow if the player is pushing against a wall i simply slow their y velocity once i was happy with the movement i recorded the same move set as the trajectory line i drew earlier and then popped them into premiere to compare frame by frame close enough a member of my discord server suggested that i add coyote time which is basically a cute name for allowing the player to jump even if they've slightly missed the platform i did this by checking when the player stopped being grounded and if the jump is triggered within the delayed coyote time i still execute the jump it actually makes the game feel much better at this point i had a controller which was starting to feel pretty similar to celeste but still felt crap to play when i'm just controlling a boring white capsule so i got stuck in to making the game look sound and feel nice by adding a proper player model particle effects post-processing camera shakes and animation now at this stage i pretty much went into full derp mode and tunnel vision for about three hours without recording a damn thing but who wants to see that anyway so i'm afraid you won't see the journey but i will show you the destination ready by the way be sure to hit the like button if you're enjoying this video alright here we go [Music] shortly after the release of celeste the developer showed the world his player controller script and i remember staring at the ungodly line count and thinking wow this screams for some organization this was nothing against the developer after years of professional development i know all too well how things can spiral out of control and before you know it the refactor you always had in mind turns into a monumental task which is not even worth attempting even so there was a bit of harsh feedback regarding the giant file and its lack of modularity the developer responded to the feedback defending their move to us due to how much interaction there is between states and the nuance in how players move this would turn into a giant messy web of references between classes if we were to make a tactic scan then yes a more modular system makes sense and although one large file is generally considered bad design and the very definition of unmaintainable the developer said one reason we like having one big file with some huge methods is because we like to keep the code sequential for maintainability if the player behavior was split across several files needlessly or methods like update will split up into many smaller methods needlessly this will often just make it harder to pass the order of operations in a platformer like celeste the player behaviour code needs to be very tightly ordered and tuned and this style of code was a conscious choice to fit the project and team i wasn't entirely sure i agreed with this and there are certainly design patterns to help keep it organized and sequential across multiple files so my secondary goal was to enforce some code organization but it just didn't happen i began by using a more structured approach each character's state like walk jump dash wall climb etc were all in their own separate scripts but it simply made it a nightmare to work on each ability relies on other ability variables to operate correctly this is where the developer's first point shows its merits a messy web of references i felt like at this stage it was separation of concern for the sake of separation of concern it certainly didn't make it easier to work on or add maintainability as it was hard to keep track of the sequential order of things in the end i have no idea how similar my implementation was to the original but the end result feels pretty damn great it's responsive and you always feel in control of the character i also added a toggleable double jump because i feel like it made it even more fun it was a blast to work on and i'm sure with just a little bit of love the controller could be turned into something truly special i'm going to save turning this into a 3d controller for a later video so if you're keen to see that be sure to subscribe and hit that notification bell i've included this script in the description if you'd like to check it out if you just want to play around with the character i've also included a link to the built game files if any of you decide to use this player controller in one of your projects come into the discord server and show me what you've done it'd put a smile on this game developer's face