Explaining The Physics Behind Character Controllers - OpenKCC

Diving into how physics is designed for games for creating character controller
Check out the demo here nickmaltbie.com/OpenKCC
Open Kinematic Character Controller github project github.com/nicholas-maltbie/O...
OpenKCC Series Playlist - • Open-Source Kinematic ...
This is the second video in the OpenKCC learning series discussing how physics objects work with character controllers in a virtual space. What is the difference between a kinematic, dynamic, and static object and what makes a kinematic character controller useful anyway?
Previous video in series for overview of designing character controllers: • Designing Character Co...
Chapters:
0:00 Intro
0:27 Physics In Games
1:03 Physics Objects
1:31 Let’s Play Some Pool
3:05 Character Controller Options
5:06 So Many to Choose From
6:00 Beyond Physics
6:38 Outro
Games used in video in the order in which they first appear:
* Getting Over It with Bennet Foddy
* Tricky Towers
* Celeste
* Fall Guys: Ultimate Knockout
* Mario Kart 8
* Minecraft
* Portal 2
* Rocket League
* Rock of Ages 2
* A Dark Room
* Sid Meier’s Civilization VI
* Bubble Shooter ( nickmaltbie.com/bubble )
#madewithunity #gamedev

Пікірлер: 11

  • @kamigamesofficial
    @kamigamesofficial2 жыл бұрын

    Personally my go-to for player controllers (We primarily make fast-paced skill-based games) is a dynamic rigidbody controller, writing code around it to keep full control over what the Unity physics engine is allowed to do to our player at what time. With a bit of work you can make an extremely precise and responsive player controller with this approach, while still having the option of going crazy with dynamic physics related features. Great video, keep it up!

  • @NickMaltbie

    @NickMaltbie

    2 жыл бұрын

    That sounds like a great design. Is that what you're using for the bullet runner game? I found managing physics objects every physics update to be quite difficult to get them to work properly with other objects in the scene. I found network sync issues with getting physics to line up over the network with dynamic rigid bodies but kinematic didn't run into those issues.

  • @kamigamesofficial

    @kamigamesofficial

    2 жыл бұрын

    @@NickMaltbie Yes that's how we've set up Bullet Runner :) The approach we take is to add a state machine to the player (e.g. move state, airborne state, receiving knockback state). For movement, instead of using add force we set the x and z velocity directly (with some lerp magic on top), and keep the y velocity the same to keep gravity functional. That way our player can not be pushed around by other objects. When we want to implement e.g. knockback, we either disable the movement code for a short while, and perform an add force, or we add a vector3 force to the movement velocity calculation, that we lerp back to vector3.zero over time. This way you keep a lot of agency over the physics, and the player is snappy, predictable and works well with networking

  • @NickMaltbie

    @NickMaltbie

    2 жыл бұрын

    That’s a great way to manage the movement and still allow for physics based interactions. I found that kinematic objects felt the most “snappy” but most of my use cases don’t require physics interactions so it would work the same regardless. I still have to switch my project over to a FSM design. I’ll make sure to check out some of your videos in the future, the project looks interesting! I was always frustrated by unity’s non deterministic physics but this seems like a good enough way to get around it. Does that kind of interaction work for other objects pushing the character around as well since you set the player velocity?

  • @kamigamesofficial

    @kamigamesofficial

    2 жыл бұрын

    @@NickMaltbie Thanks! I appreciate that

  • @NickMaltbie

    @NickMaltbie

    2 жыл бұрын

    @@kamigamesofficial haha, that’s why I decided to go kinematic character controller because that’s the whole idea of a KCC object. But sometimes you want to be pushed by other objects so it’s hard to say sometimes. Good luck with your project. I’ll make sure to checkout any other videos or updates you post on your channel.

  • @zabba7461
    @zabba74612 жыл бұрын

    The game footage really helped drive home what you're talking about. Very clearly explained 😭

  • @MrHumanforlife
    @MrHumanforlife2 жыл бұрын

    Subbed man, I really feel a good controller makes or breaks a game. I really hope you go deeper into this subject

  • @NickMaltbie

    @NickMaltbie

    2 жыл бұрын

    Thanks, I’ll keep making more videos about how character controllers work and about the Open KCC project. I’m working on a video about camera controls now.

  • @SaadTheGlad
    @SaadTheGlad2 жыл бұрын

    Subbed

  • @NickMaltbie

    @NickMaltbie

    2 жыл бұрын

    Thanks, I’m happy you like the video :)