Using Calculus to Go Fast in Paper Mario: The Thousand-Year Door

แชร์
ฝัง
  • เผยแพร่เมื่อ 17 เม.ย. 2020
  • In this video, I explain the steps taken to solve a specific optimization problem for the Paper Mario: TTYD TAS.
    Room footage was made possible thanks to noclip.website
    This was an incredibly fun video to make. Having thought of this idea alongside TASPlasma almost a year ago, it's been long overdue for a video of its own.
    You can check TASPlasma out over at: / tasplasma
    _____________________________
    Twitter: / tasmalleo
    Twitch: / tasmalleo
    Join my Discord! / discord
    Check out Mario Kart Wii TASes: mkwtas.com
  • เกม

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

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

    Another banger vid
    Great job explaining this stuff, thanks for hitting me up to work on this!
    Edit: After thinking about it a little more, I think the wall pushing angle matching the approach angle is not a coincidence, this is after all the critical angle of refraction, which is the angle you'd direct yourself to be refracted parallel to the change in medium (i.e. the wall).
    What I think this means is the following:
    First you need to pretend Mario is a ray of light or more generally is an object that always takes the optimal path (light rays "do" this in classical physics, see Fermat's principle of least time)
    If you extended the wall to be an entire rectangle that Mario could travel in (at the faster wall boost speed) then pushing at a steeper angle than the wall boost angle would lead him to not have a purely horizontal angle. This is not optimal in this scenario.
    Similarly, if you push into the wall at a shallower angle than the wall boost angle, then there are other "optical" reasons why this results in Mario not traveling parallel to the wall, i.e. a purely horizontal angle (but this result is more confusing).
    I'm sure I didn't do the physics explanation justice, so any physics people please feel free to clarify or add anything necessary to the above.
    There is a purely mathematical reason for this result though:
    As we found, the optimal angle to approach the wall does not depend on the distance y away from the wall. This means that at every frame, Mario should approach the wall at this optimal angle we found, again no matter what his distance y is from the wall. So even if Mario is 0 distance from the wall, he should still approach the wall at that angle.

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

      I'm not a TASer, but I do have a degree in Math, and this is how I interpreted it as well, this really smells like a kind of refraction-equation. The arcsin of two speeds at the end really gives it away, I would imagine the resultant speedboost during the wall-boost is this problem in miniature, though I don't know of a good way to prove that without examining the underlying code, my guess is that the game is trying to calculate the shortest way to bump you out of the wall, and just moving the sprite there -- the shortest-path calculation would look very similar against a wall (though the scale would be much smaller).

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

      i was gonna comment that it was just the same equation with y being 0

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

      vsauce covers this exact thing nicely th-cam.com/video/skvnj67YGmw/w-d-xo.html

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

      Yeah this is just Snell's law with a transmission angle of 90 degrees. There's a variety of ways to obtain snell's law some of which don't require calculus.

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

      @@trafalgarla yeah, the wall-push angle is definitely an emergent result of Snell's law, since calculus is just a representation of rates of change, which are what the whole of physics are based on.

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

    Breaking news: speedrunners rediscover a version of snell's law in the process of optimizing straight-shot paths with wall constraints in Paper Mario.

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

    I’m sending this to my calculus teacher. This legitimately helped me understand optimization problems better.

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

      I did send this to my calculus teacher, she said that everybody in my class should watch it.

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

      Dill Pickle lol

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

      I shall do the same

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

      I've always aspired to become a maths/science teacher, but I'm going to try to be more laid-back, and I'd probably just send this to students to watch in a break period. Or not, I still have a lot of other things on my mind.

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

      Remind me in 2-3 years to watch this then

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

    I like that this basically boils down to Snell's law, which makes sense, as that's about light travelling at different speeds through different mediums, similar to how Mario moves at different speeds depending on if he's touching the wall or not.

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

      This is exactly what I was thinking of as the video was playing, I just couldn't get the brachistochrone curve out of my head long enough to figure out where the math was going

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

      @JorWat25 | 👏
      I knew something familiar was itching at my brain from those two years of college physics.
      I tip my hat to you.

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

      Yes, yes, of course, it's simple really, speedy thing goes in, speedy thing comes out, that sort of thing hahahahahahahahahahahahahhshs

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

      The VSauce video was all I could think of lol. I was completely lost when he started to bring Calculus in.

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

      the requirement for the tas is "path of shortest time" ie is fermats law, which produces snells law at discrete boundaries, so yeah not just related problems but identical. If you want a justification why fermats law actually applies to light (in the classical limit), it's because the lagrangian is constant, so the action becomes just an empty time integral. If you really want to, you could say that mario in an ideal tas behaves like a massless non-interacting particle inside some really weird geometry

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

    1:12 "Well, thanks to Isaac Newton..."
    *Leibniz has left the chat*

  • @Stop.Arguing
    @Stop.Arguing 4 ปีที่แล้ว +589

    Thanks to "Eye-zach New-ton"? That's a funny way of pronouncing Gottfried Leibniz.

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

      Underrated joke over here.

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

      Or should I say Archimedes?

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

      Yeah, leibniz calculus is what is used in this video. Newton did the same things but with pure geometry and algebra.

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

      Leibnez calculus is superior, change my mind

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

      I chuckled

  • @RJ-zn2jz
    @RJ-zn2jz 4 ปีที่แล้ว +184

    1:18
    “Let’s derive how we got to this point”
    Brilliant

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

      Underrated comment lmfao

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

    Can't believe you did my boy Leibniz dirty in giving the credit to Newton. >:(

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

      virgin newton vs. chad leibniz

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

      Leibniz has a huge pair of Monads

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

      I felt that

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

      Leibniz has cooler hair

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

      But Newton invented calculus first! Just ask the committee led by Newton.

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

    Congrats, you basically rederived Snell's law with a destination on the boundary between the mediums.

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

    Slightly advanced mathematics and spending way too much time playing video games, my two favorite things!

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

      Same

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

      I love how TASers are so good at using applied mathematics. I could see an alternate life where some of these guys are the Eulers and Riemann's of the world, but math has gotten so advanced and convoluted, that it seems way less likely nowadays.

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

      Sometimes math only seems convoluted because of the enormous amount of unnecessarily weird expressions and terminology. If someone is passionate enough and their tutor is great enough at explaining it in the simple terms math deserves, anyone could become great at it. Mathematics is probably the most beautiful concept invented by our species, it's really sad to see it getting flak because of teachers who are unmotivated in teaching. There are millions of students who could be amazing, wonderful problem-solvers if the teaching methods were more intuitive and less stuck-in-the-past.

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

      @@cyancoyote7366 I more meant that the problems mathematicians have to solve are even harder than they used to be, like the Riemann Hypothesis. I agree there are great teachers, like Grant Sanderson of 3Blue1Brown, who genuinely captures the essence of math without bogging the viewer with heavy notation.

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

    That moment when you show us it's THE SAME ANGLE (and leaving it as an open mystery) just so good. My brain is turning trying to now figure why wall spd swap happens out of this

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

    The madlad actually applied Fermat's principle to Paper Mario.
    Also the reason why the angle is the same is because V1 and V2 are directly related to that angle. Due to how the game calculates the wall pushing speed, it gives V2 = V1/sin (theta), meaning sin theta = V1/V2. I assume this is because when you're pushing the wall at that angle, the game translates your diagonal speed into purely horizontal speed, making a triangle with V2 as the hypothenuse, V1 as one of the legs, and the angle opposite to V1 theta.

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

    As an engineer who loves math and logic (but haven't had to use much in the past 3 years), hearing things like "take the sine/cosine" and "65,536" (knowing that is a high power of 2) just made me smile a bit.
    TAS-ing is a beautiful art.

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

      It's the little things in life that makes it good.

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

      Aren't you the guy that watches almost as many chuggaaconroy videos as me? I saw you everywhere there.

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

      Rayquaza1090 Always in Siivagunner’s comments too

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

      typical engineer, doesnt even use math in 3 years

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

      I’m stressing the fuck out over my Differential Equations and mechanics finals tomorrow. What the hell do you graduates do on the daily if not math?

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

    I’m gonna be honest, I was hoping this would be using calculus to set up a sub pixel to clip through the gate...

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

    TASer: Hmm... I'm just going to make the joystick input (255, 79) throughout this whole section
    Malleo: Hold on, using calculus, we can find the optimal angle to take instead of just holding one angle for the whole thing.
    TASer: Okay, whatever you say.
    Malleo after hours of calculation: *Holy sh*t he was right!*

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

    Seems like there is an additional step at the end - find the angle that maximizes L1 (horizontal distance traveled) while still hitting the wall in the same # of frames t1 as the optimal theta. Maybe that is the angle computed here, but I don't think it is guaranteed because time isn't truly a continuous function. I believe you would also need to test the farthest you can go in t1 - 1 frames.
    The formula you boiled stuff down to at the end seems like an incredibly useful one for a TAS toolkit. Even in games without wall boosting, this is a pretty common scenario. E.g.: You want to head to a boost panel or escape a slowdown section, but at the same time you want to move in a different direction towards a goal. Makes me wish there was a repository of "known movement optimizations" so people don't have to re-invent the wheel every time.

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

      yeah i was gonna say you cant trust this to be the optimal path exactly since its discrete

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

      @@nathanisbored Yeah that's a really great point and one I didn't initially think about. Thanks for pointing it out RingRush!

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

      There's nothing stopping you from getting things started! Contact lots of runners and make an "online encyclopedia of movement optimizations."

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

      @@Malleo Similarly, the closest possible angle to the optimal theoretical angle is not guaranteed to be the fastest, right? Your chosen angle is slightly higher than the optimal one, but depending on how the slope on either side of the optimum is, rounding down by a bit more could theoretically be faster.

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

      This is actually a really good point. Both the angle and time measurements are discrete. He also forgot to calculate the value of the derivative for the endpoints of the domain, namely for theta taking its minimum and maximum values. Those are critical numbers, too. But I still love how it ends up as an elegant law of refraction that depends only on the values obtained by speed-swapping and wall-boosting, not on the dimensions of the corridor.

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

    Glad to see that Calculus II can be integrated into speedruns.

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

      kek *integrated*

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

      @@ceruleansky6670 I found it a good way to derive that joke based on the subject matter.

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

      I’m being series is there no limit to your jokes

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

      This more so uses calc 1 than any calc 2. Calc 2 would involve integrals, or the inverse of the derivative shown here..

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

    Wow, that was honestly such a cool breakdown, and even though I HATED calc, I was able to appreciate and understand what you guys did. That's fucking awesome.
    Really cool video!

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

    "See son calculus IS useful later in life"

    • @SPZ-gv2on
      @SPZ-gv2on 4 ปีที่แล้ว +2

      First application I've seen of it TBH

    • @mr.cook5
      @mr.cook5 4 ปีที่แล้ว +11

      @@SPZ-gv2on lol. try harder.

    • @212Assain
      @212Assain 4 ปีที่แล้ว

      purely for haha funne fast brotherman.

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

      I think it's harder to find someplace it isn't useful. Mathematical optimization is literally everywhere.

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

      @@gdtoob doing the dishes

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

    This reminds me very much of light, whose angle of refraction when entering a new medium is based on the difference in the speed of light between the two media, giving the formula that you used here. Physics!

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

      yeah the formula he has at the end is literally snell's law, it's the same equation (just with one of the angles being equal to 90 degrees because the destination is on the boundary between the two mediums)

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

    This is a great application of derivation in calculus. Just one note, be careful when doing this because when you set the first derivative of your displacement equal to zero, this represents both times where the equation is minimized AND when maximized. There are infinitely many angles that do this but we can limit our search between 0 and 180 degrees (since with the setup we have, going left will never make us faster). We also have to be careful with using inverse trig functions because it will only give us one answer of multiple correct angles. Essentially we could be maximizing the time by accident if we are not careful. If we double check those values we find that there is a second angle that satisfies this relationship that inverse sine does not show us, 106.341 degrees. As an example, such as when y=1 and x=5, 106.341 degrees gives us a time of 1.687 units and 73.674 degrees gives us a time of 1.897 units. If we are trying to minimize our time then 106.341 degrees is optimal over 73.764 but we wouldn't know that because we used inverse sine to reach our answer. The moral of the story is that we need to check for all angles within 0 to 360 degrees that make the first derivative equal to 0 and then test those in the original equation to determine which angle will give us the shortest possible time.

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

    brilliant transition at 1:12

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

      didn't notice it until you pointed it out.
      bruh

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

      I was messing around on noclip.website and happened to notice that and figured I had to make sure I get it in the video!

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

    As soon as you showed the route to take and the two velocities I knew (excitedly) it’d be an optimization problem. Thank you for bringing together two of my passions: TAS and calc :)

  • @904funny
    @904funny 4 ปีที่แล้ว +14

    The answer to students questioning why we need to learn math.

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

    9:20 It also means that if X is less than y*tan(73.674) then you shouldn't wall boost. The hallway distance has to be about 6.5 times the hallway depth.

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

    This was just a joy to watch as both a programmer and a calculus student. And also the fact that you brute forced every possible GameCube controller inputs into coordinates is insane💀

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

    In my calculus class, we started optimization problems yesterday. It's funny how this didn't show up in my sub box, and now showed up in my recommended at a fitting time

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

    Considering that the path necessarily requires Wall Boosting due to the length of the corridor, it makes perfect sense that the angle of travel would be equivalent to the optimal angle of Wall Boosting.

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

    If they taught us like this in school I’d have always paid attention

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

      How I wish they'd told me how important trigonometry is in games...

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

      no, it's because you're procrastinating

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

      no, its because you a bitch

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

      well, then people not interested in Mario would pay no attention whatsoever...

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

    "well thanks to Isaac Newton..." You just upset all the Leibniz stans. It's funny because, at least here, everybody says Newton invented it, but we all use Leibniz' notation far more often than the Newton's notation.

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

    These videos are so easy to understand & I find myself watching them countless times! I love your TAS' that you've uploaded. I put them on while I'm working 🙏🏽 Thank you for content ❤️💕

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

    As a computer engineer, these technical and mathematical strategies and explanations fascinate me. This calculus application in particular makes me wonder if another type of math, dynamic programming, is useful in routing a TAS. Simply put, DP is a way of finding an optimal solution for a problem by working backwards from the goal. For example, you can find the fastest route through a set of points grouped into distinct stages by finding the costs of traveling to a certain destination point from each possible prior point, then using the least costly path's starting point as the destination for the prior stage's calculation. I'm not sure how well that would work with the sequence-breaking that happens in a TAS, but since the game's story triggers do divide the game into different stages, it seems like an interesting concept, at least to me.

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

      We actually are currently using dynamic programming to route the recipes for the TTYD 100% TAS. We weren't sure in what order we should craft each recipe, and some recipes have multiple ingredients that work. Someone has developed a script which uses recursion and a stack to try to successfully craft all recipes while minimizing the number of frames wasted (which is our cost). So yes, we do get to use that for routing the TAS!

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

    Absolute beautiful job of explaining a complicated math problem in a beautiful way, it was thoroughly entertaining to watch! Great job!

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

    Wow awesome video, really fascinating!! I enjoy all of your videos and I am a little more fascinated by the TAS-world of TTYD and your approach towards continuously improving every time.
    Greets from Switzerland.
    Jan-Hendrik

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

    I love this so much. Thank you for your continued incredible work on this game!

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

    some random dude: you'll never use calculus in everyday life
    Malleo: *hold my TASbot*

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

    Brilliant! I was thinking the whole time -- this can be solved easily with an 'annihilator' approach (just finding the angle that is fastest through exhaustion). But you decided to add a bit of calculus to find the _exact_ angle, which, again, is quite brilliant. Kudos!

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

    "But first, I have to talk about parallel universes."

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

    Unrelated to Paper Mario, but I'm really glad you gave the Bastion soundtrack a cameo in this video. One of my favorite OSTs of all time.

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

    I love some well edited and calmly explained math! It remembers me some of MatPat old videos, with lots of formulas and numbers

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

    Pretty neat! I think I somewhat understood the math! Thanks for making this, & I'd love to see more like it!

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

    this is amazing, top tier.
    would loooove to see more

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

    I would not have watched a video on calculus whatsoever, but your style of making videos is incredible and makes any video not hard to watch. People like you make some want to get up in the morning. Thank you Malleo🙏

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

    TASes are BONKERS. I love seeing the stuff y'all come up with.

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

    Me: I hate Calculus!
    Also Me: (watches video)
    Me: I love Calculus...

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

      hahahaha the beauty of maths

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

    I think this might be the first video on math I've managed to get more awake from watching at almost 4 in the morning - good job!

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

    I'm taking Calc 2 atm right now and watching this has given me more hope. Thanks

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

    I love this and what's even better is that there is another way of solving this sort of problem using Constraint Optimisation... yeah maths is pretty dope

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

    As somebody who never got past Algebra II in math class and am very ignorant when it comes to Calculus, I still found this video interesting and (almost) comprehensible!

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

    That's pretty cool. I find it interesting when this kind of stuff comes up in these situations.

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

    As someone who has been dreading calc and hated trig so much I forgot literally everything, this was surprisingly comprehensible. Nice!

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

    Moment I saw the black lines for L1 and L2 I got memories of doing dozens of these problems for the AP.

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

    I'm almost finished with my first Calculus course and I knew exactly the process you were going to use before even watching any of the math, which makes me really happy.

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

    Hope there's more math misc stuff like that to tell because I loved it!

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

    Very nice video! I just shared this with my Calculus I students. Hopefully they will feel more motivated to tackle this kind of problems now (I know I would!)

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

      Thank you very much! It means a lot that you are referencing my video to encourage students to gain better interest in Calculus. It's definitely a useful subject and I'm glad you feel this video is a great way to engage your students with Calculus topics.

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

    Malleo this is awesome. Calculus reaching a new audience! My only comment is that the angle you found does not apply to all x and y values because if x is small enough, the optimal path is indeed a straight line with no wall boosting. Other than that, this video is fantastic! Good job to you and TASPlasma

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

    I'm literally doing these sorts of optimization problems in my calc class right now

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

    Yay! New Malleo video! I'll probably comment more on this later!

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

    This is awesome, keep up the great work!

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

    Damn, this equation is really useful, thanks for sharing that with this really easy to understand explanation. It can be used in other games where a situation analog to this one presents itself.

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

    this is THE late night youtube video i need

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

    When I saw the problem my first instinct was smells law and its cool that by doing a paper Mario TAS you fell into a nice derivation for theta_2=pi/2

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

    The question can also be solved using Snell's Law. If we assume the player to be a ray of light passing through a different medium, as light always takes the fastest path, and we assume the speeds to be the refractive index of both mediums, we can get the final equation in a single step

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

    This is pretty similar to deriving the refraction formula from fermat's principle of light, great work!

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

    Great video, I loved the big reveal at the end lmao

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

    Hey just want to let you know that while working on my math homework I encountered a similar problem and followed along with this video to solve it. thanks so much for the help!

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

    6:10 "Soinic CD"

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

    I'm happy I understand everything. I'm a bit sad I don't remember how to solve a tough derivative like that. I remember when you posted this on Twitter, great job explaining! Next time let's apply differential equations into TTYD

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

    It‘s 1 AM. Why am I watching a video of a guy using Calculus to go speedy gonzales in a Gamecube game?

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

    He didn't say "In addition" in the math video. I'm disappointed. :(

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

      Kesno he did say “let’s derive how we got to this point” though so that makes up for it

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

      Or similarly

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

    Inspired me to try harder in math. Thanks malleo!

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

    A good parallel to draw to this equation is the refraction of light through different mediums, which has the same equation of arcsin(v1/v2), where v1 and v2 are the speeds of light in the two mediums. Light takes the path of least time, so you can see the similarities.

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

    Great video man, keep it up!

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

    Never have i been more intrigued over calculus than this video
    Congratulations sir

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

    Great! I'm going to be learning calculus next year!

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

    I'll be referencing this video in an upcoming lesson in optimization! (and providing a link, of course)

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

    Highly appreciate the song title thing you added in

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

    This video was amazing and I loved it.

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

    I would definitely watch more stuff like this

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

    6:15 Holy shit! Soinic CD is my favorite!

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

    Interesting way to solve it, did similar problems in class and we used the Euler legendre equation to solve em

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

    Amazing! I wish I had problems like this while I was studying calculus back in college.

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

    Wonderful work

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

    I’m really glad you posted this, hopefully people who are interested in speedrunning can take more of an interest in mathematics like calculus which would give incentive to pursue further education and good education habits as well as provide extra utility among the speedrunning community

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

    Yoooooo
    This is sick, nice work

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

    When the mushroom landed on Newtown's head, it gave him an instant of Big Brain, where he invented the universe.

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

    See, Mom? I'm doing homework!

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

    Oh god, you're giving me flashbacks to Lagrangian mechanics... thankfully, it seems this problem wasn't nearly complicated enough to require that!

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

    The wall boost angle probably does a similar operation on collision, dividing the speed of Mario by the dot product of his angle against the normal of the wall. There's extra details but that's why the angles are probably identical

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

    Wow. All this just to figure out you basically just point the stick in one direction the whole time lmao. Great vid!

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

    I had a problem like this in my high school trig class. There was an oil rig off the coast and building a pipeline through the water was more expensive than along the coast. We needed to find the angle to build the pipeline. My cost function used the point that it met the coast and Pythagorean theorem. I then found the minimum with my graphing calculator :) Found the angle with inverse tangent

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

    All this to save a few frames... that's so unnecessarily cool

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

    Even if I couldn't understand half of it, this was so cool to see :)

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

    It should be noted that this kind of wall boosting behavior appears in many other games, most notably DOOM 1 and 2 et al. This is because the mathematics the game uses to "reflect" the player off of the wall to prevent them from passing through it (really though in DOOM's case it is more of a sliding movement). In DOOM's case, this speed boost is because the checks can happen twice per frame due to the game segmenting Doomguy's horizontal and forward movement in the same manner that Paper Mario separates Mario's movement.
    I always enjoy these kind of things popping up in different games because it can show how much similarity under the hood games can share. That's because the mathematics used for collision often boils down to using what works and what is known.

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

    I'm gonna show this to my high school calc and stats teacher - she let me do my stats project on altering the catch rate in Pokemon so I think she'll enjoy this too lol. Sick video Malleo! :)

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

    The fact that the two angles are the exact same makes me so happy for some reason

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

    I will admit, I laughed when the correct analog stick axes values matched the wall pushing value.

  • @K-SparkerZedtoned
    @K-SparkerZedtoned 4 ปีที่แล้ว +3

    From what I've noticed in my time in college, most people were never exposed to Calulus in high school... It's a shame, hopefully this video ends up teaching some people a thing or two :)

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

      I took pre calc in highschool but yeah it's some confusing stuff

    • @K-SparkerZedtoned
      @K-SparkerZedtoned 4 ปีที่แล้ว

      GigaHertz I’ve never found it confusing. I probably just have an affinity for it. I find it’s application very fun.

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

    New favorite channel

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

    Thank you for this video.
    I failed calculus first semester of this past school year and I won't lie, I really didn't understand what was happening math-wise in this video, but I feel like forcing myself to understand what's happening here is a good way to start preparing for retaking the class