Math for Game Programmers: Building a Better Jump

แชร์
ฝัง
  • เผยแพร่เมื่อ 5 มิ.ย. 2024
  • In this 2016 GDC talk, Minor Key Games' Kyle Pittman shows how to construct natural-feeling jump trajectories from designer-friendly input like desired height and distance, modeled programmatically using one of a few available integration methods.
    GDC talks cover a range of developmental topics including game design, programming, audio, visual arts, business management, production, online games, and much more. We post a fresh GDC video every weekday. Subscribe to the channel to stay on top of regular updates, and check out GDC Vault for thousands of more in-depth talks from our archives.
    Follow us on Twitter
    / official_gdc
    Check out our Facebook page for GDC exclusives
    / gamedevelopersconference
    Visit our site: ubm.io/2ctNvqZ

ความคิดเห็น • 542

  • @Table53
    @Table53 4 ปีที่แล้ว +222

    Clicked on this to watch a GDC talk about video game mechanics, ended up essentially watching a refresher lecture that I remember taking during first year Physics

    • @zombie_pigdragon
      @zombie_pigdragon 2 ปีที่แล้ว +20

      Watched this while procrastinating first year physics homework, am not all too thrilled to learn that people do use this stuff, even if I already knew it.

    • @LOLWHATBRO
      @LOLWHATBRO 2 ปีที่แล้ว +11

      @Kalicrowa it doesn't seem at all that this video is directed toward someone who just wants the math numbers and how to implement it. Its not a tutorial. As someone who didn't take any physics classes in my life, it's a good thing that it's explained in detail instead of assuming the viewer is a literal college graduate in the field of the subject. The whole point is to explain it, otherwise why would he go up there and talk? 🤔

  • @NeoAF10
    @NeoAF10 5 ปีที่แล้ว +884

    25:13 Kind of uncool forcing him out the podium.

    • @BloodyOrchidDC
      @BloodyOrchidDC 5 ปีที่แล้ว +75

      Yeah, Kyle didnt finish his talking yet.

    • @MarkusSeidl
      @MarkusSeidl 5 ปีที่แล้ว +93

      I think they are on a tight schedule and the next presentee has to setup things...

    • @SerpongeDash
      @SerpongeDash 5 ปีที่แล้ว +163

      Yeah they're definitely on a tight schedule but that didn't look super well handled
      "one more question" proceeds to basically throw him a way after saying this "we can thanks kyle" ???

    • @MaxskiSynths
      @MaxskiSynths 5 ปีที่แล้ว +297

      If you're on a tight schedule then you duck down, keep a low profile and quietly apologise and maybe explain about the tight schedule. This guy just comes on and grabs the fucking laptop.

    • @RealRushinRussian
      @RealRushinRussian 4 ปีที่แล้ว +155

      Yeah, he closes the dude's laptop down and hands it over to him. Like, really?

  • @konstantinkh
    @konstantinkh 2 ปีที่แล้ว +247

    Worth noting that Mario switches to heavy gravity on jump release even if peak hasn't been reached yet, giving you jump height control. That was the original reason for it to be coded that way. But in general, yeah, having acceleration change on up and down movement and with jump key held/released tends to give the nice responsive jumps you see in the platformers we tend to remember. And the specifics of what gravity should be on each segment and whether pressing the jump key again after releasing it makes a difference is up to specific game implementation.

    • @konstantinkh
      @konstantinkh 2 ปีที่แล้ว +7

      @@alanx4121 Yeah, but that's technically a reskin of an entirely unrelated game. So the fact that SMB2's controls were different is no surprise. More nuanced air control certainly added to the flexibility of movement for sure. And yeah, I should have specified that I was talking about original SMB Mario in the opening sentence. 👍

    • @casperdewith
      @casperdewith 2 ปีที่แล้ว

      I feel like Mario’s jump the way the lecturer described it, is as if you stop holding right (or dash, or jump) as Mario hits the peak of his jump. As far as I know, the parabolas are perfect if you do full jumps and hold right and dash.

    • @valletas
      @valletas 2 ปีที่แล้ว +8

      I havent even watched this video but the instant i read your comment i imediately though "so thats how its done" and i opened up my game to try this out
      It isntantely felt a lot better

    • @SurajSharma-uu8tx
      @SurajSharma-uu8tx 2 ปีที่แล้ว +1

  • @Ermude10
    @Ermude10 7 ปีที่แล้ว +201

    Short note on the integration methods:
    Euler integration doesn't conserve energy, so what happens is that when we try to approximate a continuous jump curve, in each discrete time step we will travel in a straight line in the same direction as (tangent to) the curve. Over many time steps, the error from choosing a straight line will accumulate and deviate from the "real" curve. Depending on how you do your update function and how it depends on each frame, a frame rate drop might make this error more noticeable.
    Runge-Kutta 4 is very accurate but also doesn't conserve energy, but the error grows very slow and won't be noticeable during a single jump. However, it is a bit expensive to calculate.
    And then comes Verlet, which is cheaper than RK4 and conserves energy. The accuracy depends on the timestep though, so it probably won't be as accurate as RK4, but it generally works better in games.

    • @BackflipBeaver
      @BackflipBeaver 7 ปีที่แล้ว +12

      I'm no programmer, but this does seem like a valid summary :) Might I also add that the reason why the Verlet integration method is so stable, despite it's limited accuracy for a given time step, is that it fulfills the "symplectic condition" in classical mechanics. Basically, the all important energy conservation criterion associated with this "frictionless" jumping shown in the video is nicely approximated if your integrator is symplectic.
      Cheers!

    • @MLPvipiao
      @MLPvipiao 7 ปีที่แล้ว +6

      I actually ran into that problem recently, I'm making a physics engine, but energy just kept increasing or decreasing depending on whether my game loop updated the properties of the objects like this: "acceleration, velocity, position". Or like this: "acceleration, position, velocity". The way I solved it was to go "acceleration/2, velocity, acceleration/2, position".

    • @BackflipBeaver
      @BackflipBeaver 7 ปีที่แล้ว +5

      Interesting! And yeah it's perhaps not the most intuitive approach seen from the beginner's perspective, myself included. I'm actually going to use Verlet extensively for the first time in the upcoming weeks. It's in relation to a Molecular Dynamics (MD) simulation of liquid nitrogen, where friction is (thankfully) absent ;)

    • @Ermude10
      @Ermude10 7 ปีที่แล้ว +1

      +BackflipBeaver Physics student? What is your goal with the simulation? I'm curious, since I'm (also?) doing physics :)

    • @BackflipBeaver
      @BackflipBeaver 7 ปีที่แล้ว +3

      Engineering Physics, so yeah! In summary, I am to model a predetermined set of nitrogen atoms in the microcanonical ensemble, where the pair interactions are described by Lennard-Jones potentials and Periodic Boundary Conditions (PBCs) apply. I implement the rigid-rotator approximation for each N_2 molecule by way of a holonomic constraint. The first goal is to check whether the equipartition theorem holds up (I fix the temperature "indirectly" by rescaling the velocities regularly in-between some predetermined number of Verlet integration steps). Secondly, I want to determine the pressure of the gas from fixed temperatures and densities and hopefully identify some phase transition if I manage to get that far :)

  • @jayxofficial5126
    @jayxofficial5126 3 ปีที่แล้ว +273

    Bro, that guy was so rude to the guy speaking. Watch till the end to see who deserves the 2016 douche award.

    • @nightwintertooth9502
      @nightwintertooth9502 2 ปีที่แล้ว +2

      Guy being a douche never wrote a line of game code in his life! Respect physics and respect math its at the core of what we do!

    • @kuretaxyz
      @kuretaxyz 6 หลายเดือนก่อน +1

      What a colossal douche. Unbelievable.

  • @mrslake7096
    @mrslake7096 7 ปีที่แล้ว +50

    if you are using unity, Sebastian lague have a great tutorial & source code available that does this
    just search for
    " [Unity] Creating a 2D Platformer (E03. jump physics) "

  • @viniciusqueiroz2713
    @viniciusqueiroz2713 6 ปีที่แล้ว +14

    I guess sometimes we keep up with the advanced stuff and forget about the basics... I really needed all that Physics Introduction review. Thank you, Kyle!!

  • @echelon2k8
    @echelon2k8 7 ปีที่แล้ว +576

    4:25, 9:48, 12:58, 16:25, 19:58, 22:37, 25:18

    • @asonael3205
      @asonael3205 7 ปีที่แล้ว +20

      echelon2k8 Calm down, Satan. but no really I wanted rage quit this video every time.

    • @AustinBabineau
      @AustinBabineau 7 ปีที่แล้ว +7

      thank you

    • @WymanandBrad
      @WymanandBrad 7 ปีที่แล้ว +2

      echelon2k8 why is that a thing?

    • @gafeht
      @gafeht 7 ปีที่แล้ว +58

      It's so good. I feel like he's swallowing me.

    • @diggoran
      @diggoran 7 ปีที่แล้ว +13

      so much about this audio bothers me, but these are the particular parts I hate the most. I just imagine the entire live audience being blasted by gulps out of loudspeakers every 4 minutes

  • @Estigy
    @Estigy 2 ปีที่แล้ว +10

    Nice to see Leonard Hofstadter doing science talks again.

  • @sirgouki6207
    @sirgouki6207 7 ปีที่แล้ว +24

    I wish I had known GDC had their own youtube channel sooner. This is great. Getting passed the crappy audio, I sat through this entire lecture and both facepalmed at how close I actually got to something similar to this on my own, and learned a great deal at the same time.

  • @harborned
    @harborned 7 ปีที่แล้ว +39

    Really liked the talk, many thanks! Also, downloaded the game, liked it too :) Jumping felt great - clearly know what you're talking about :)

  • @nightwintertooth9502
    @nightwintertooth9502 2 ปีที่แล้ว +3

    Parabolics completely smoothed out my moving platform code. I was looking for good parabolic integration over the Euler method I was using and found it! Thank you.

  • @manwithbrisk3418
    @manwithbrisk3418 2 ปีที่แล้ว +12

    Just happened on this video. As someone who tried to fix the, "floatyness" of UE4's standard jump back in school it was a really interesting talk.

    • @sdrawkcab_emanresu
      @sdrawkcab_emanresu 2 ปีที่แล้ว +2

      Did you managed to do it? Would you say its "easy" to make a good jump and run in unreal or should i learn unity?

  • @nucleartide
    @nucleartide 3 ปีที่แล้ว +10

    This is a superb, superb tutorial. Thanks Kyle!

  • @jacekarino
    @jacekarino 2 ปีที่แล้ว +12

    Incredible talk! Also, I love Minor Key Games' projects. Insanely satisfying platformer physics, great work.

  • @taylorbird901
    @taylorbird901 4 ปีที่แล้ว +3

    Excellent treatment of this material. You Have To Win The Game looks fun and nostalgic also.

  • @gordorodo
    @gordorodo 7 ปีที่แล้ว +221

    Is there an extreme stereo effect on this video or is it just me? If he moves two inches to the right, his voice gets almost completely panned to the right channel, idem for left channel. I wonder if this was recorded with two mics on stereo channels (WHY?!) or the person who did the edit of this video was just bored to hell and decided to pan the speaker's voice each time he moved just a little tiny bit.

    • @manictiger
      @manictiger 7 ปีที่แล้ว +84

      It's pretty bad. You'd think they'd know to use a mono mic for voice.
      _"GDC talks cover a range of developmental topics including game design, programming, _*_AUDIO_*_..."_

    • @sismikkk
      @sismikkk 7 ปีที่แล้ว +3

      i read your comment before the end of the video and now i'm hearing it, THANKS !

    • @HerbaMachina
      @HerbaMachina 7 ปีที่แล้ว

      I listened to the video with one ear bud in so I didn't notice thankfully lol

    • @gafeht
      @gafeht 7 ปีที่แล้ว +1

      I was already messing with my audio settings and had fixed it by switching to mono when I noticed your comment

    • @desktorp
      @desktorp 7 ปีที่แล้ว +2

      Speaking of floating between two points, is the speaker australian or a southern dandy or what? His accent is all over the map.

  • @MatteoAntonyMistretta
    @MatteoAntonyMistretta 7 หลายเดือนก่อน +2

    This was pure gold, thank you so much for sharing!

  • @TomKermode
    @TomKermode 7 ปีที่แล้ว +5

    That was really nicely presented and explained.

  • @ZxCrono
    @ZxCrono 7 ปีที่แล้ว +4

    YOOOO, I've won the game a long time ago, and I'm a fan of the mechanics. I'll have to look back on that game in reference to this video later.

  • @merkaba48
    @merkaba48 6 ปีที่แล้ว +147

    Here's my resulting code after watching this and the tutorial series "[Unity] Creating a 2D Platformer" mentioned below. Hopefully this will be useful for someone.
    // Calculate the gravity and initial jump velocity values
    _jumpGravity = -(2 * JumpHeight) / Mathf.Pow(TimeToJumpHeight , 2);
    _jumpVelocity = Mathf.Abs(_jumpGravity) * TimeToJumpHeight ;
    // Step update
    stepMovement = (_velocity + Vector3.up * _gravity * Time.deltaTime * 0.5f) * Time.deltaTime;
    transform.Translate(stepMovement);
    _velocity.y += _gravity * Time.deltaTime;
    // When jump button pressed,
    _velocity.y = _jumpVelocity;
    NB. that is for a simple jump, no double jumping, differing gravity when descending, etc. Those things should be trivial to solve; the meat of the 'better jump' is calculating velocity/gravity from a desired height variable and time to reach it variable, and implementing the "velocity verlet" when calculating the step movement (+ gravity * deltaTime * 0.5). I wish I understood the math behind this stuff a bit better, but just knowing how to implement it is good enough for my purposes.

    • @garryiglesias4074
      @garryiglesias4074 4 ปีที่แล้ว +5

      Useful for who ??? What is useful is people doing it THEMSELVES... This is basic maths, you can program this at 14 y/o... So no it's not useful, and if people find this useful, I hope it's for their own education and not to pretend becoming a pro one day.
      Copy paste has NEVER been useful. Unless you're a cheater, lamer, and think more about your programming career as becoming some "unproductive chief" than becoming a real expert programmer.

    • @dampee6
      @dampee6 4 ปีที่แล้ว +70

      @@garryiglesias4074 This guy goes two years with zero comments and just some "quiet" likes. Then you come along...

    • @garryiglesias4074
      @garryiglesias4074 4 ปีที่แล้ว

      Principle of learning are older than Aristotle... It's not about the writer, but the potential reader who could be tricked to "learn" by Copy-Paste.

    • @UndeadFleshgod
      @UndeadFleshgod 4 ปีที่แล้ว +4

      Oof I hope that since you wrote that, you learned that the _ naming scheme is fucking retarded

    • @kaganylmaz3904
      @kaganylmaz3904 4 ปีที่แล้ว +32

      @@garryiglesias4074 Geez dude, for someone who doesn't want to watch to video but learn about the topic, this code can be much useful you know he can learn what makes a better jump in seconds. Did we really need a lecture about being successful at programming.

  • @MarcCastellsBallesta
    @MarcCastellsBallesta 2 ปีที่แล้ว +6

    I learned about the Verlet algorithm while doing Molecular Dynamics. I'm surprised to see it applied to videogames. :-)

    • @flavioryu5922
      @flavioryu5922 2 ปีที่แล้ว +1

      I used it to simulate a harmonic oscillator :o I'm surprised too

  • @subliminalman
    @subliminalman 7 ปีที่แล้ว +5

    Thanks for laying this out, I've been messing with different ways of doing jumps in my platformers. I'll have to try this one out

    • @DJ_POOP_IT_OUT_FEAT_LIL_WiiWii
      @DJ_POOP_IT_OUT_FEAT_LIL_WiiWii 7 ปีที่แล้ว +7

      I suggest you try fooplot online.. much easier, less math and pretty much same result.
      For a basic parabola try: -(x-1)^2+1
      You substitute X value for time and the result is the height of the jump at time X. C# would be -Math.Pow(time - 1, 2) + 1.
      Time should be from 0 start of jump to 1 end of jump.
      Height will be from 0 floor position to 1 max jump position.
      When you reach max position, calculate a second parabola for the down jump. This one should work pretty well: (x-1)^4

    • @HalkerVeil
      @HalkerVeil 7 ปีที่แล้ว

      The sarcasm in this comment is amazing.

  • @louther1213
    @louther1213 7 ปีที่แล้ว +4

    Wow learned more about physics from this than high school...

  • @alessandrodarmiento5131
    @alessandrodarmiento5131 6 ปีที่แล้ว +2

    Very interesting video, I updated my falling system with this. Thank you!
    One question: I didn't get very well how should I update G using the Runge Kutta integrator, given the position offset previously defined.
    Thanks

  • @computerrcat870
    @computerrcat870 2 ปีที่แล้ว +1

    THANKS IT HELPED A LOT WITH MY PLATFORMER

  • @pixl237
    @pixl237 4 หลายเดือนก่อน

    This is pure gold !

  • @yananliu2902
    @yananliu2902 3 ปีที่แล้ว

    very helpful, thank you!

  • @tushargupta764
    @tushargupta764 5 ปีที่แล้ว

    I am loving thus channel

  • @MaxwellsWitch
    @MaxwellsWitch 7 ปีที่แล้ว +1

    Yeah, I used rk4 to simulate projectile motion in curved spacetime.

  • @zoeythebee1779
    @zoeythebee1779 ปีที่แล้ว +2

    boy I wish I had more than middle school level math knowledge

  • @marverickbin
    @marverickbin 7 ปีที่แล้ว +2

    i remember all jump possibilities in super mario 3d world, and it is amazing. wamdering how it was programed

  • @tensevo
    @tensevo 6 ปีที่แล้ว +23

    This guy could play the archetype nerd in any sci-fi film. Wild accent.

  • @jayxofficial5126
    @jayxofficial5126 3 ปีที่แล้ว +18

    I suck at math and still program, this is why my games suck! I get it now lol. I really need to consider getting better though, or I will keep making crap.
    Thanks for this video it really helped : )
    No room for lazy!

  • @neodaltiair8624
    @neodaltiair8624 3 หลายเดือนก่อน

    So he’s saying use your known values such as height and distance to find initial values like starting velocity and gravity.
    Do that for each scenario/parabola and apply those velocities and gravities given the conditions are met.

  • @senpaizuri5166
    @senpaizuri5166 5 หลายเดือนก่อน

    This is very -chug down liquid- Insightful. Thank you~

  • @paulomarcio3133
    @paulomarcio3133 2 ปีที่แล้ว

    This is awesome!

  • @drdca8263
    @drdca8263 7 ปีที่แล้ว

    time 9:25 or so for "how to choose initial velocity and gravitational constant in order to get any given jump height and time to reach the top of the parabola".

  • @MacoDeVinx
    @MacoDeVinx 5 ปีที่แล้ว +140

    Akward ending for him lol

  • @divine308
    @divine308 7 ปีที่แล้ว +2

    How about only programming the height of the jump an speed of the character going up the porabula could be just controlled by moving forward at the same speed as the characters standard running or walking speed based on which direction the character runs
    Example:If I run to the right and push space to jump the character should move right at the same speed just traveling up in the air also coming back down

  • @indiegamemaster1639
    @indiegamemaster1639 7 ปีที่แล้ว

    Nice talk! I wish I could see your talk right before the starting develop the game.

  • @jackypark3638
    @jackypark3638 2 ปีที่แล้ว

    Are the integration techniques used to manually implement parabolic jump in a game engine without physics? or are there other use cases that I have no idea of? Thanks!

  • @benjaminramsey4695
    @benjaminramsey4695 2 ปีที่แล้ว +1

    This is great stuff. Just a nerdy nitpick - you're not "momentarily weightless" only at the peak of the jump, but are in fact weightless throughout the entire parabola.

  • @091Cash
    @091Cash 6 ปีที่แล้ว

    Does anybody knows where does the example sprites come from?
    I really liked them

  • @codingWithHambone
    @codingWithHambone 6 ปีที่แล้ว

    This dude is awesome.

  • @noface7842
    @noface7842 ปีที่แล้ว

    ...I just played the game showed in the thumbnail of the vid and the game's physics is great not gonna lie

  • @RedHotBagel
    @RedHotBagel 7 ปีที่แล้ว +326

    Tl;DW: Use variable gravity to design your jump mechanics.

    • @TheMarrt
      @TheMarrt 7 ปีที่แล้ว +49

      So true, if he would just have started with the warped jumping parabolas and mentioning the accumulated error he did not fix his whole talk could have been 2 Minutes with the same informational value

    • @kevnar
      @kevnar 7 ปีที่แล้ว +15

      I've seen game design tutorials on TH-cam that explain this stuff in less than one minute. dy -= jumpSpeed. dy += gravity. Let the math sort out everything else.

    • @caxco93
      @caxco93 7 ปีที่แล้ว +14

      +kevnar thats the Euler one he showed. but its not that good

    • @HeyzDexy
      @HeyzDexy 7 ปีที่แล้ว +11

      He didn't get his point across very well, he should have simplified his talk

    • @Rooster128
      @Rooster128 7 ปีที่แล้ว +18

      honestly in a network setting when you have clientside prediction and serverside movement, i would probably still stick to euler too. his method he describes seems very dangerous when talking about multiplayer games- or talking about any other game that uses other movement abilities. honestly, i don't know why he doesn't make a new variable like "fall factor" to multiply by gravity, rather than adjusting the gravity variable itself. gravity should be constant unless something in the game explicitly calls for it to be altered (like in Prey, or what have you)

  • @NeesyPlaysGuitar
    @NeesyPlaysGuitar 7 ปีที่แล้ว +3

    every time he says "back" i think of kyles cousin from NY in South Park. Trolly accent. Grevity.

  • @petersmythe6462
    @petersmythe6462 3 ปีที่แล้ว

    One this I can't recommend enough: automatically crouch jump every time you jump. If you want to be able to jump up a meter tall object, what do you do, do you throw your 1.7 meter forehead 20 centimeters deep in your 2.5 meter cieling while moving your center of mass a whole meter vertically? Or do you lift your feet and tuck your head so that a jump that only launches your center of mass 40 centimeters in the air lets you clear a meter high object? I know which option I choose.

    • @petersmythe6462
      @petersmythe6462 3 ปีที่แล้ว

      I feel like not automatically crouch-jumping it one of the reasons why games so often throw 20 m/s or 30 m/s G into the game. Look at Minecraft for example?

  • @baumwollaugenjohannes6770
    @baumwollaugenjohannes6770 7 ปีที่แล้ว

    More interesting than i thought! Only the way of the of the speaker to end each sentence by pressing out the last word without breath is very distracting, once i noticed it.

  • @tightlypackedcoil
    @tightlypackedcoil 7 ปีที่แล้ว +39

    I only have one question.
    What?

  • @cortexai6541
    @cortexai6541 7 ปีที่แล้ว +2

    1:13 lool that fat cat jump thoe, never gets old - Geronimooooo!!! ;'D

  • @MaxwellsWitch
    @MaxwellsWitch 7 ปีที่แล้ว +2

    So... I want to make a General Relativity raytracer. I got the maths I want to use, but where do I start with the programming? I can calculate the light paths by hand, on the computer, but I want to make images with this data I can calculate. I know c++, cuda, sfml, and some other stuff, but I need to use some pretty efficient stuff.

  • @alfredogodoy6854
    @alfredogodoy6854 ปีที่แล้ว

    Es un genio este péndulo

  • @preetmokha7002
    @preetmokha7002 3 ปีที่แล้ว +6

    Who's here after Pontypants video? xD

  • @tunmixx
    @tunmixx 2 ปีที่แล้ว

    there should be mono sound checkbox next to quality settings @youtube

  • @randomdude4043
    @randomdude4043 2 ปีที่แล้ว

    runnin on that schedule

  • @bakinto
    @bakinto ปีที่แล้ว

    to this date, this is the best gdc talk ever... thak you so much Kyle Pittman

  • @princekodjo7798
    @princekodjo7798 5 หลายเดือนก่อน

    I had an issue I solved where the final height of a jump never quite reached the specified final height. It turns out that it was off by height/t^2. I'm not sure why, but I fixed it by adding that to my initial velocity. Just putting this here in case anyone has the same problem, spent hours in Desmos calculator trying to fix it...

  • @algi1
    @algi1 6 ปีที่แล้ว +8

    3:55
    My favorite autocomplete typo: textbox physics. :D

  • @noname-mw7oy
    @noname-mw7oy 2 ปีที่แล้ว +3

    Holy shit that guy at the end was an ass. Great talk broski.

  • @giviarabidze2287
    @giviarabidze2287 3 ปีที่แล้ว

    I don't understand one thing, if someone can make it clear. How can you use V0 in equation on Th considering V0 on Th is 0 and it is gTh + 0 = 0 and not gTh + V0 = 0?

  • @tear728
    @tear728 7 ปีที่แล้ว +13

    grayvity and paraybolas

  • @unvergebeneid
    @unvergebeneid 7 ปีที่แล้ว +3

    Can we get the _Thomas was Alone_ guy to give a talk about jump mechanics?

    • @FreakStyler
      @FreakStyler 2 ปีที่แล้ว

      It had some of the worst jump mechanics for such a simple game. He had one job...

  • @hodgey1668
    @hodgey1668 7 ปีที่แล้ว +121

    This guy's accent is wild, he's dropping t's like I would expect from the english but he sounds american?

    • @porteal8986
      @porteal8986 7 ปีที่แล้ว +9

      Hodgey yea, it sounds like he lost a bet and had to do the whole talk in a british accent, but he has no idea how to do a british accent

    • @simonRTJ
      @simonRTJ 7 ปีที่แล้ว +7

      Er..as a Bri-T-ish man, I objec-T to the notion of one dropping ones T's...tha_T is usually a-TT-ributed T-o Lazy American slur!! thank you very mu-T-ch

    • @porteal8986
      @porteal8986 7 ปีที่แล้ว +5

      Simon Rose​ yea, but the american idea of a brittish accent usually involves a specific stereotypical brittish accent that involves alot of dropped t's for some reason

    • @TheBanderolli
      @TheBanderolli 7 ปีที่แล้ว +1

      While, like we all know, it's the H's that get dropped instead!

    • @LunaEqualsLuna
      @LunaEqualsLuna 7 ปีที่แล้ว +4

      Yup it is a very strange accent. It seems like an American accent yet he pronounces about 10% of words with what sounds like a british accent

  • @kamilkarwacki9590
    @kamilkarwacki9590 6 ปีที่แล้ว

    The picture in 6:00 is missleading of course the height also changes with g

  • @0osk
    @0osk 2 ปีที่แล้ว

    The talk that takes place after this one is called "Math for Game Programmers: Juicing Your Cameras With Math"

  • @nilamelody
    @nilamelody 2 ปีที่แล้ว +4

    Celeste, the best platformer game I've ever played so far.

    • @alexgeeves7096
      @alexgeeves7096 2 ปีที่แล้ว +1

      very strongly agree

    • @bobvella7228
      @bobvella7228 2 ปีที่แล้ว +1

      try slime-san

    • @nilamelody
      @nilamelody 2 ปีที่แล้ว

      @@bobvella7228 I've tried that, pretty good I'd say but not a huge fans of the physics there haha. The boss battle is fun and challenging tho.

  • @matthewcasey1703
    @matthewcasey1703 6 ปีที่แล้ว

    Hey cool idea man. I totally agree with using parameters that are more useful to designers than physicists. I do have one question though, typically we use a physics engine and add forces and such to make things move around, with the benefit of them responding to the environment and other physical objects. With this method, everything is isolated in it's own world. Did you have to build your own geometry collision and how did this interact with your jump equations?

  • @zombiedude347
    @zombiedude347 7 ปีที่แล้ว +1

    They way I'd do it is store the frame(s) when the player pressed/released the jump button when applicable for the jump and the current frame value. Use this with a numerically stable variant of the exact formula instead of integrating.

  • @slaanesh_pet
    @slaanesh_pet 7 ปีที่แล้ว +12

    Loved this! Great presentation, well presented and very informative.

    • @HalkerVeil
      @HalkerVeil 7 ปีที่แล้ว +2

      And full of nonsense.
      We developers do not use this crap at all.
      Nobody quantifies a jump like this. It's like trying to calculate the amount of PSI in your bowels before you take a dump so you apply the right pressure to minimize backsplash.
      In fact it's exactly like that.
      Here's a better way. Just push and get a feel for it.

    • @iforce2d
      @iforce2d 7 ปีที่แล้ว +1

      lol that's a very fitting analogy indeed :)

    • @salientgraphic41
      @salientgraphic41 6 ปีที่แล้ว +6

      Wow. Anon Mason really has a hate boner for this guy. He's all up and down the comments here trashing the talk, the ideas, the presenter.

    • @alvin_row
      @alvin_row 6 ปีที่แล้ว +7

      Be Compassionate I love how he says "we developers". The guy making the talk has worked on some cool games to back what he's saying up. If mason can't prove he's worked on games that feel better (or any game at all), saying "we developers" holds absolutely no value.

  • @TaberIV
    @TaberIV 7 ปีที่แล้ว +1

    So how do you keep the distance you can jump constant with variable gravity?

    • @Aidiakapi
      @Aidiakapi 7 ปีที่แล้ว +1

      You do not, if the player wants to make a tiny jump, they probably doesn't expect to jump equally far.

    • @Seanmcfarlane115
      @Seanmcfarlane115 7 ปีที่แล้ว

      Vertical distance or horizontal? I feel like it would be hard to justify either since players expect bigger jumps with lower gravity. An idea might be to instead make the gaps bigger.

    • @TaberIV
      @TaberIV 7 ปีที่แล้ว

      Sorry let me make what I meant more clear, how do you keep the MAXIMUM distance you can jump constant with variable gravity?

    • @Aidiakapi
      @Aidiakapi 7 ปีที่แล้ว +1

      If you implement variable jump height in the way the video suggest (ie. increasing gravity while not holding jump button), your maximum jump distance will be the same as it was before adding variable gravity.

    • @jeek313
      @jeek313 7 ปีที่แล้ว

      I think I understand what you mean. In the video, the jump distance is defined by the distance to the peak of the jump (x_h). Instead, you want to be able to set the distance covered by the *entire* (asymmetrical) jump, correct?
      Assuming:
      'jumpDistance' is how much distance should a jump cover on flat ground
      'fallGravityMultiplier' is how many times stronger you want the gravity to be after reaching the peak (i.e. when falling)
      You can get the distance to the peak of the jump (x_h) by dividing your 'jumpDistance' by:
      1 + fallGravityMultiplier^(-1/2)
      So, in C# for Unity:
      float distanceToPeak = jumpDistance / (1 + 1 / Mathf.Sqrt(fallGravityMultiplier));

  • @thatlonzoguy
    @thatlonzoguy 2 ปีที่แล้ว

    This guy gives off huge tim sweeny vibes, he even sounds like him hah. Very good talk and interesting!

  • @bunnybreaker
    @bunnybreaker 7 ปีที่แล้ว +10

    I found this really interesting, but I fully admit, a lot of it went over my head. I decided to try following along in GameMaker. The first section about defining a jump in terms of jump height and time-to-peak went absolutely fine. When the next section comes along talking about defining jumps in terms of height and distance (my goal) it goes horribly wrong. I followed the substitute calculations at @13:10 and the gravity value is giving me a wildly different number resulting in tiny tiny hops compared to the height/time version.
    Can anyone confirm they have followed this (not necessarily in GameMaker) and had it work?
    I assume I am doing something wrong or GameMaker has a bug, since this guy seems really smart and I'm sure he would have noticed a massive mistake while presenting even if it had slipped into the PowerPoint.

    • @Nicoladen1
      @Nicoladen1 7 ปีที่แล้ว

      Do you have the right settings for your room under the physics tab?

    • @bunnybreaker
      @bunnybreaker 7 ปีที่แล้ว +14

      Nicoladen Hey. I completely forgot I posted a comment here. The problem was identified (by someone else) and fixed. Here is the reddit thread where my code was posted and the solution discussed. www.reddit.com/r/gamemaker/comments/5i9svk/help_following_a_video_about_defining_jumps_from/

    • @error.418
      @error.418 7 ปีที่แล้ว

      Thanks for the awesome reply

    • @SxAde
      @SxAde 5 ปีที่แล้ว +2

      ​@@bunnybreaker I was having the same problem until I found your commentary. Tho I'm implementing it on Unity I found the answer on the link you shared really helpful, thanks.

    • @bunnybreaker
      @bunnybreaker 5 ปีที่แล้ว +1

      @@SxAde I'm glad it could be of use to you. I'm actually in a similar situation, now I've switched from GM to Unity and want to build an action platformer. I will probably have to back and read the thread again too :P

  • @wtmftproductions
    @wtmftproductions 2 ปีที่แล้ว

    Just making sure I follow, this all assumes a kinematic character movement right? As in, we're simulating the gravity, right? I'm wondering because I'm lost on why the latter part of the video deals with updating our acceleration when I'm here just using Unity's built-in gravity. Not sure how to implement any of this. (To be clear, this is in no way a critique of this video. I am, in fact, humbled by just how little I know, and realize this might be a noobish question.)

    • @ondrej_hrdina
      @ondrej_hrdina ปีที่แล้ว

      I just spent like an hour implementing this and had no idea what I was doing lmao, dind't work at all for me.

  • @hasanshafy_
    @hasanshafy_ ปีที่แล้ว

    How do I apply this in Unreal?

  • @heavysaber9431
    @heavysaber9431 4 หลายเดือนก่อน

    gold

  • @jacopobertolotti5025
    @jacopobertolotti5025 6 ปีที่แล้ว +9

    Someone please tell me that this is not the typical level of math competence of a game developer...

    • @goji5887
      @goji5887 6 ปีที่แล้ว +2

      its not.

  • @Sim2322
    @Sim2322 2 ปีที่แล้ว

    It's sad they didn't talked about Coyote Jumps and Hangtimes, but it was pretty good nonetheless

  • @pacifico4999
    @pacifico4999 3 ปีที่แล้ว +3

    My opinion: Don't derive position, but rather velocity or force. Whichever one is easier to work with on your game engine. If you derive position, you won't be able to react to physics objects very well.

  • @DelkorYT
    @DelkorYT 7 ปีที่แล้ว

    How about some maths to fix the audio? :/

  • @Nenkos
    @Nenkos 7 ปีที่แล้ว +17

    The audio makes me nauseous.

    • @LittleRainGames
      @LittleRainGames 7 ปีที่แล้ว +1

      Yeah the swallowing is nasty...

    •  7 ปีที่แล้ว

      Exactly, I'm using headphones and the audio is really uncomfortable and makes me a bit nauseous (no problem with other videos). Can't really pinpoint why though. Like the quality is corrupted somehow.

  • @Thinkyhead
    @Thinkyhead 6 ปีที่แล้ว

    I wonder if he might be from the northern NY - Rochester - or maybe Minnesota region…

  • @27182818284590452354
    @27182818284590452354 7 ปีที่แล้ว +1

    I don't get why would you do incremental approximation if you can just calculate the position (and the velocity) from the last singularity (launch, change of gravity, etc.).

    • @igotdembombs
      @igotdembombs 7 ปีที่แล้ว

      Well with incremental approximation you only need the information from the previous frame so you don't need to remember what happened at the start.

    • @27182818284590452354
      @27182818284590452354 7 ปีที่แล้ว +1

      How is that an advantage? You save on keeping a single time value?

    • @igotdembombs
      @igotdembombs 7 ปีที่แล้ว +2

      I suppose you could do it your way but it makes more sense to keep track of instantaneous velocity and position.
      If there's a platform above the characters head what will you do to compensate? With instantaneous velocity you could have it keep pushing into the platform until your velocity becomes negative, then the character falls down.
      You would also be able to easily add multiple accelerations or forces. You calculate their impact on the instantaneous velocity individually, then add them together.

    • @27182818284590452354
      @27182818284590452354 7 ปีที่แล้ว

      igotdembombs
      This is completely irrelevant. You still have both velocity and position (duh), just without accumulated errors. The way you calculate them has no affect on creation of new singularities or composition with other functions.

    • @igotdembombs
      @igotdembombs 7 ปีที่แล้ว

      Oh yeah I guess it creates a new "singularity" if you bump your head, so then no difference I guess

  • @alicewithalex
    @alicewithalex 6 ปีที่แล้ว

    Hello, what I'm need to do, if I jump from very high place, how calculate how much I go forward?

  • @Rhino1004
    @Rhino1004 7 ปีที่แล้ว +3

    Is this going to be on the test?

  • @spaderkungskuk
    @spaderkungskuk 2 ปีที่แล้ว +1

    Math for those who skipped class, explained in too many words.

  • @xananax6823
    @xananax6823 7 ปีที่แล้ว +22

    Interesting, but after doing 15 platformers, it's much faster to begin with setting the gravity and other stuff upfront and just tweaking...You develop a feel for what the numbers map to in terms of movement.

    • @Tudumanu
      @Tudumanu 7 ปีที่แล้ว +4

      The theory vs pratice... one knows how to do it and the other one just do it!

    • @mycollegeshirt
      @mycollegeshirt 7 ปีที่แล้ว +2

      Yeah, all the best platformers in the world used that I'm not sure why I would do it this way, I mean working forward doesn't the player get the game feel, and an ability to predict how the character will behave.

    • @xananax6823
      @xananax6823 7 ปีที่แล้ว +9

      I don't think there's one way of doing it, it's just good to vary methods and test different ways of thinking

    • @ChannelOfJoris
      @ChannelOfJoris 7 ปีที่แล้ว +14

      The Mario games design their jump with a predetermined maximum, minimum and average height and distance. The advantage of this method is that it is easier to design levels on paper when you know these values, which is faster than playtesting (which you still need to do, just not as much). Furthermore, the Ratchet & Clank games use roughly predetermined distances to make it easier for players to see whether they should jump, double jump or hover. Of course every method has its pros and cons, and since all methods work you should just use the one that you feel most comfortable with.

    • @HalkerVeil
      @HalkerVeil 7 ปีที่แล้ว +9

      I agree. These people trying to quantify everything when it's just a simple jump. You can look at a bad jump and instantly know it's bad. If you just play games. It's intuition.
      This talk is like trying to explain how to take a dump and the amount of PSI you need in your bowels. Just push damn it.

  • @jawnsushi
    @jawnsushi ปีที่แล้ว

    What game is in the thumbnail?

    • @dihydrogen
      @dihydrogen 3 หลายเดือนก่อน

      You Have To Win The Game. it's free on steam, and a pretty nice though small platformer

  • @farhadhussain9142
    @farhadhussain9142 4 ปีที่แล้ว

    Like I am attending physics class in front of my professor..

  • @kylestankovich2199
    @kylestankovich2199 7 ปีที่แล้ว

    I am terrible at math, too bad pretty much 100% of this went over my head.

    • @satannstuff
      @satannstuff 5 ปีที่แล้ว +1

      Good thing you don't actually need to do any of this to make a good jump then. Even when you do know the math the iterative approach is faster. Besides you're supposed to build the levels based on what the character can do, not the other way around so there's no real point in aiming for any specific target value.
      Tweaking jumps after levels are already built means you get to redo all of them to make sure they still work, nobody wants that.

  • @uhhmir
    @uhhmir 3 ปีที่แล้ว

    i didnt know david wallace joined the videogame industry

  • @uncleswell
    @uncleswell 5 ปีที่แล้ว

    Close your eyes... It's Jared.

  • @mattsharp6708
    @mattsharp6708 7 ปีที่แล้ว +11

    I teach game development at a university. When my students ask me when we are doing jumping, they are always so confused about why I tell them that will probably have to be in the advanced coding class lol.

    • @automatescellulaires8543
      @automatescellulaires8543 5 ปีที่แล้ว +5

      Oh please. Gravity add one unit of speed vertically each frame. That's it, perfect jump, all equations presented in this video taken account of. Assuming they understand that speed tends to be constant otherwise, and that it is added to the position each frame.

    • @MadBunnyRabbit
      @MadBunnyRabbit 4 ปีที่แล้ว +2

      @@automatescellulaires8543 And you just got yourself the worst, not even a prototype level jump in your game. Have fun redesigning your entire levels when someone changes the physics in the smallest way :3

    • @automatescellulaires8543
      @automatescellulaires8543 4 ปีที่แล้ว +3

      Changing the gravity / friction is exactly the same in either case, because the rules of the world are the same. It's like we are talking about apples, and we say that some variety taste better, and you tell us "have fun when you'll need to peel them". When really it's obvious that the peeling of one is equivalent to the peeling of another. Hey, if you want to believe complex notations and slow computations are better, that's your right. You can. I don't think we really care about that. But maybe, maybe you shouldn't make false claim on the internet without at least pointing to some suppporting evicence.

    • @BaremetalBaron
      @BaremetalBaron 4 ปีที่แล้ว +1

      @@automatescellulaires8543 Sounds like you need this talk more than anyone. It's well known that the "Euler" integration method for solving a jump (just adding gravity to your velocity every frame and then altering the position by the velocity), while the intuitive and obvious first thing you'd try, and one that seems to give good results at first glance, is extremely unreliable and inconsistent under varying conditions. Your jump height can be radically altered by something as silly as a change in frame rate, if I understand correctly. This is why the method you described isn't usually used in professional games, like classic platformers (say, Mario or Mega Man games). That's why people tend to use the Verlet method.
      Having said that, it isn't always necessary, and I do agree that people tend to over-complicate this stuff. I use the method you described all the time for prototyping and trying things out, or when I know it won't be a problem.

    • @automatescellulaires8543
      @automatescellulaires8543 4 ปีที่แล้ว +1

      If the simulation is framerate related, lower frame rate, would mean lower simulation speed, not lower simulation jump height, the simulation would be the same, only slower. Now if you can't have fixed frames, and have no guarantee to be able to tick integrate, then you do have a point. I'm not sure in exactly what kind of use case that would happen nowaday, maybe if you have some complex synchronization code for multiplayer i guess. Still your "wrong jump height" seems just wrong.

  • @therealtraderlife
    @therealtraderlife 2 ปีที่แล้ว

    Wow not one mention of rb.velocity ..

  • @moversti92
    @moversti92 7 ปีที่แล้ว +1

    Opened steam after watching this and the featured game was you have to win the game.

  • @Kudoshi
    @Kudoshi 3 ปีที่แล้ว

    Got lost when the slide showed Integration.

  • @VJFranzK
    @VJFranzK 7 ปีที่แล้ว

    Good discussion. BTW - Say: "Button" or "Buhun"?

  • @xchronox0
    @xchronox0 6 ปีที่แล้ว

    tfw windows removed the option to set your headphones to mono

  • @jadimatic1096
    @jadimatic1096 4 ปีที่แล้ว +1

    This guy has quite an interesting accent, its like a weird mix of a western accent and an american accent.