Monster shadow

VIDEO

Unity Player Controller - Based on Celeste

Description:
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 Script: https://github.com/Matthew-J-Spencer/player-controller 'Better Jumping' by Board and Bits: https://www.youtube.com/watch?v=acBCegN60kw
ADD A COMMENT

Filoret
for more pretty gameplay add jump buffering
Tarodev
Jump buffering... I was trying to find what that was called! Thank you! Yes, this controller would certainly benefit from jump buffering.
Arcanoid Streamsky
Hi. can you please share unity proj for this?
Tarodev
@Arcanoid Streamsky I've finished with this for now, but come into the discord and I can certainly help you accomplish it! Sounds fun
Arcanoid Streamsky
@Tarodev can you please make steep/slope/slide for this movement please ? :)
Tarodev
Hey, I can't share the whole project, but I've provided the source code in the description
Cauldron Revs
Hi! i love the change of gravity, it is anormal gameplay but it is good. https://www.youtube.com/watch?v=7715fpLelHI an old C64 game Hercules. It has got a good idea, make platform invisible until the player touch it, the effect is good, you can add it on your gameplay QueryTriggerInteraction possible act it. Thanks for the code, have a good day.
Tarodev
Invisible platforms, just like invisible blocks in Mario. I like it :)
TGS Nicholas
Not an Unity dev but I like your project, I'll stay to see your future progress, keep up the amazing work!
Tarodev
Thanks mate!
ladykickz
Here from reddit, thanks for sharing your process when recreating Celeste's player controls. This is really interesting, I'm in my first year of game dev at uni and this is so helpful
Makra
Came from Reddit!
Tarodev
You found it! Welcome ❤️
Jonathan Vanasco
This is fantastic! would this same controller work for 2D platformer?
Jonathan Vanasco
@Tarodev Thank you! I have been trying to figure out a player controller script with dash, etc. for weeks. I cannot wait to try this out when I get home. I have learned SO much from all of your videos, keep up the amazing work.
Tarodev
That's exactly what it is right now. This is just working on the x and y axis. The script is mainly plug and play. Grab it, chuck it on an object with a collider and rigid body, hook up the script references and it should work
Kevin Chen
Another awesome video. Really love your channel
Kail Soares
cool 👍
Gary Spencer
And that my friends is my SON
Bob
This channel needs way more subs/views. Great content and easy to understand even for beginner coders like myself. Keep up the good work!
Tarodev
Thanks mate!
Diru Diaz Rusiñol
Keep it up!
Mandy Lee
I really love this video, I think it’s your best one yet! I’ll be really sad if you don’t turn this into a game! 😊
Antoni Rogala
Cool! Thank you!
r8teful
Really liking your past videos, keep it up with the great content! The player controller feels really nice, great job with it!😀
r8teful
@Tarodev Yes, it worked without any problems 😊
Tarodev
Thank you! Did the game perform well in the browser for you?
Егор Франц
Cool! Thank you!
SEE ALL COMMENTS


Transcript:

[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