The Minecraft boat-drop mystery

Поделиться
HTML-код
  • Опубликовано: 20 ноя 2024

Комментарии • 3 тыс.

  • @akaHarvesteR
    @akaHarvesteR 7 месяцев назад +22268

    As a game dev, this is the level of bug-reporting quality we only dare hope for in our wildest fever dreams.

    • @sarunint
      @sarunint 7 месяцев назад +1924

      The reason Minecraft bug reports can be so datailed is because the Minecraft EULA allows end-user to decompile the game. So technically Minecraft is a source-available software.

    • @Poondaedalin
      @Poondaedalin 7 месяцев назад +814

      finally, something more than "the game stopped working, please fix it :("

    • @aladanor
      @aladanor 7 месяцев назад +296

      I agree its great but honestly not sure how i would fix that bug, without breaking anything else or have more computation and checks.

    • @Khantia
      @Khantia 7 месяцев назад +381

      @@aladanor personally I would give the same tolerance for the onGround check, as the status has, so there wouldn't be a discrepancy between the two. But yeah... I'm not familiar with the rest of the code, so I don't know if this wouldn't break something else xP

    • @noahblack914
      @noahblack914 7 месяцев назад +172

      ​@@aladanorI mean, the system (at least as explained here) is definitely a little clunky. Probably because Minecraft is approaching 15 years old after all.
      I'd have to look at the actual code, but I imagine some cleaner logic for handling the fall would either eliminate this bug all together or at least make it easier to fix.

  • @nathanjames.
    @nathanjames. 7 месяцев назад +7100

    Floating point numbers causes boats to break. Makes sense, since boats need to float correctly.

    • @jacobhgoldman
      @jacobhgoldman 7 месяцев назад +170

      11/10 comment

    • @abebuckingham8198
      @abebuckingham8198 7 месяцев назад +55

      Extremely underrated comment. They should pin this. 😆

    • @adityakhanna113
      @adityakhanna113 7 месяцев назад +27

      Gosh this is genius

    • @landru27
      @landru27 7 месяцев назад +43

      @@abebuckingham8198 no worries; it has floated to the top

    • @CtrlGame
      @CtrlGame 7 месяцев назад +14

      @@landru27 just because is a good point

  • @Chase3141
    @Chase3141 7 месяцев назад +3315

    Another fun fact: If a boat falls from 44970 blocks high, it will not break despite it being in the sequence calculated. This is because after falling for that long, the tiny difference between 0.0399999991059303 and 0.04 compounds enough to offset the boat by more than the 0.001 block margin to have the ON_LAND status.
    This also means that boats are safe to fall from any height of 43543 or higher until you get all the way up to 1794944 blocks, at which point the boat is offset by the 0.04 blocks needed to wrap back around into the range where it can take damage, after falling for nearly 8 minutes.

    • @RobinNashVideos
      @RobinNashVideos 7 месяцев назад +4

      Lovely fact!

    • @ralanham76
      @ralanham76 7 месяцев назад +29

    • @eightyfoahh
      @eightyfoahh 7 месяцев назад +7

    • @reIONEre
      @reIONEre 7 месяцев назад +64

      That is far more than the maximum height....

    • @Chase3141
      @Chase3141 7 месяцев назад +217

      @@reIONEre yeah but you can get mods that remove the build height limit. You can also just teleport the boat to that height.

  • @LeDoctorBones
    @LeDoctorBones 7 месяцев назад +15089

    The status of neither being in the air nor on the ground is what we in more basic speech call "Swimming".

    • @88porpoise
      @88porpoise 7 месяцев назад +2115

      And, specifically relevant to this, being in water negates all fall damage.

    • @Jazardly
      @Jazardly 7 месяцев назад +1440

      that could also possibly be the status of being on a ladder

    • @llKirosll
      @llKirosll 7 месяцев назад +392

      in lava, yes. :)

    • @Marco-ti8sx
      @Marco-ti8sx 7 месяцев назад +521

      Or cobweb, right?

    • @KoryFae
      @KoryFae 7 месяцев назад +500

      I have a feeling that a lot of things that negate or reduce fall damage would be relevant here. I'm not in the air, I am actually:
      in water, on a ladder, in a cobweb, in lava (it doesn't negate it then for some reason), in scaffolding, in powdered snow...

  • @Mogswamp
    @Mogswamp 7 месяцев назад +3439

    Him: Warning math people they don't need to know anything about Minecraft to enjoy the video
    Me: A Minecraft person, worried that I need to know anything about math to enjoy the video

    • @supsnail
      @supsnail 7 месяцев назад +43

      haha

    • @asheep7797
      @asheep7797 7 месяцев назад +108

      This video simplified:
      Computers do not like numbers that are not multiples of 2^integer.

    • @mazik148
      @mazik148 7 месяцев назад +5

      Oh, hello there)

    • @taliadx
      @taliadx 7 месяцев назад +7

      and DID you need to know about maths to enjoy the video?

    • @NiaSwift
      @NiaSwift 7 месяцев назад +2

      hi moggy swampy

  • @logan5018
    @logan5018 7 месяцев назад +671

    imagine being the mojang dev that receives the bug report containing a full stand-up maths video

    • @dimwarlock
      @dimwarlock 6 месяцев назад +30

      "Oh, I actually know why the problem is here! thank you, thank you THANK YOU!!! Now I will break 60% less when trying to fix it!"
      That's what I imagine they would say.

    • @whatzause
      @whatzause 6 месяцев назад +7

      He’s in the loony bin now.

    • @timsonins
      @timsonins 4 месяца назад +5

      ​@@dimwarlockI think they'll be frustrated because they weren't the ones who found it, because finding fixes is 99% of Dev's joy

    • @leubes_games919
      @leubes_games919 2 месяца назад +1

      they fixed in this new snapshot.

    • @RedTail1-1
      @RedTail1-1 Месяц назад +1

      ​@@timsoninseh... The joy is in things working first time.

  • @tissuepaper9962
    @tissuepaper9962 7 месяцев назад +5003

    9:42 The reason we need to check that fall damage was actually caused by falling is that Ender Pearls deal fall damage to the user when used.

    • @tetsi0815
      @tetsi0815 7 месяцев назад +147

      This comment needs to be pinned! 😀

    • @petergerdes1094
      @petergerdes1094 7 месяцев назад +97

      This suggests that if you use them while in the air you would be immune to that damage because your status would be IN_AIR. Is that correct?

    • @modernkennnern
      @modernkennnern 7 месяцев назад +88

      ​@@petergerdes1094you take damage regardless 😅

    • @ShadowlessDeath47
      @ShadowlessDeath47 7 месяцев назад +170

      ​​@@petergerdes1094Ender pearls teleport the player, and I'm assuming that the position (and therefore the ON_GROUND status) happens before the damage check is done.

    • @ouroya
      @ouroya 7 месяцев назад +218

      @@ShadowlessDeath47 ender pearls do not have this check, it simply deals 5.0 fall damage to the player

  • @johnchessant3012
    @johnchessant3012 7 месяцев назад +5293

    12:54 "famously, multiples of 5 are at least 5 apart"

    • @MCLooyverse
      @MCLooyverse 7 месяцев назад +268

      But only if they're distinct!

    • @aurelia8028
      @aurelia8028 7 месяцев назад +26

      Yes we all saw the video, mate

    • @MCLooyverse
      @MCLooyverse 7 месяцев назад +385

      @@aurelia8028 Not necessarily. Every once in a while I will space out and miss a line like that. Regardless, this is a comment conveying appreciation for a good joke; it's positive feedback, and good for the algorithm. It has value, even if it has none directly for you.

    • @talideon
      @talideon 7 месяцев назад +25

      To be fair, this makes more sense when you know how floating point numbers work. It's a reference to rounding errors that crop up all the time.

    • @gregorymorse8423
      @gregorymorse8423 7 месяцев назад +8

      That was profound.

  • @lutherfox
    @lutherfox 7 месяцев назад +572

    examples of both on_ground and inair being false:
    -climbing/descending ladders
    -swimming
    -falling through cobweb
    -climbing/descending vines
    -riding a boat/other entity 8:54

    • @chickenmaster3879
      @chickenmaster3879 6 месяцев назад +36

      Also probably sinking through powdered snow or scaffolding. Maybe sliding on the side of a honey block. And potentially gliding with an elytra because the damage taken from crashing with an elytra is calculated separately from fall damage, so there's probably a different state specifically for that.

    • @ejvalpey
      @ejvalpey 6 месяцев назад +11

      This makes me wonder if Matt has his explanation slightly off and it is the case that the boat’s in-air value is true but your in_air value is false when riding in the boat and usually means the boat bypasses its damage calculation except for the floating point cases and separately you bypass the damage calculation except for these floating point errors where maybe the boat has reached the ground; been destroyed; your in-air gets set to true; so in the next tic you don’t bypass the checkFallDamage method and instead die.

    • @redfrog9717
      @redfrog9717 6 месяцев назад +2

      Actually, horses don’t count (unless it’s Bedrock version) if I recall correctly
      Edit: I made a mistake. This is for fall damage when riding horses.

    • @eugenefullstack7613
      @eugenefullstack7613 6 месяцев назад +3

      climbing was the first thing i thought of

    • @HappyBeezerStudios
      @HappyBeezerStudios 6 месяцев назад +2

      @@ejvalpey good point. If the boat counts if could mean the player isn't in_air, since they're on a boat.

  • @dkfrumwithin
    @dkfrumwithin 7 месяцев назад +4318

    Last time I saw a gaming breakdown this specific it involved parallel universes.

    • @IcecalGamer
      @IcecalGamer 7 месяцев назад +140

      Mario?

    • @darkshoxx
      @darkshoxx 7 месяцев назад +145

      @@IcecalGamer M(a/2)rio

    • @pas-giaw6055
      @pas-giaw6055 7 месяцев назад +21

      Matpat

    • @ruben307
      @ruben307 7 месяцев назад +220

      i wonder how many half a presses was needed for this.

    • @Spolt_main
      @Spolt_main 7 месяцев назад +76

      Super Mario 64 TAS Speedrun for anyone wondering.

  • @jackdog06
    @jackdog06 7 месяцев назад +620

    I love how we’re all just accepting that the situations where falling from a great height whilst sitting in a boat kills you are the bugs and the ones where you survive with no repercussions are the game working as intended.

    • @SnakebitSTI
      @SnakebitSTI 7 месяцев назад +68

      The case where the outcome is contrary to the intended logic is the bug. In this case, the intended logic is that being in a boat negates fall damage.

    • @TimSheehan
      @TimSheehan 7 месяцев назад +55

      ​@@SnakebitSTI it clearly started life out as a bug which they've kept around because people like it's quirky/exploit nature.

    • @zocker1600
      @zocker1600 7 месяцев назад +48

      @@TimSheehan
      > a bug which they've kept around because people like it's quirky/exploit nature.
      it is a feature then, not a bug

    • @TimSheehan
      @TimSheehan 7 месяцев назад +14

      @@zocker1600 ... you know that "not a bug its a feature" phrase is from people making fun of buggy/ faulty things right?
      E.g.
      Oh the door handle has fallen off... Not a bug its a feature car is very secure against breakin now!

    • @PandaFan2443
      @PandaFan2443 7 месяцев назад +43

      ​​@@TimSheehan It becomes a feature once its presence becomes intentional. Your examples are different.

  •  2 месяца назад +45

    This bug was just marked as fixed! \o/

  • @geoffp8366
    @geoffp8366 7 месяцев назад +3046

    Programming tip of the day: floating-point values that get repeatedly added should, whenever possible, be chosen to be exactly-representable numbers. Instead of 0.04, the acceleration should have been chosen to be 0.0390625 ( = 1/32 + 1/128 ); then the problem would not have arisen.
    (In memory of the late Garry Tee, who taught me this many years ago. Rest in Peace.)

    • @Shaddymaze
      @Shaddymaze 7 месяцев назад +102

      Great tip!

    • @arcaneminded
      @arcaneminded 7 месяцев назад +188

      I did not expect to get this kind of wisdom from a youtube comment. Thanks.

    • @derekjc777
      @derekjc777 7 месяцев назад +226

      This may solve the problem of repeated adds, however because of the use of the mantissa and exponent in IEEE floating point representations that is not guaranteed. This would produce deterministic results in fixed point arithmetic with 8 bits or more reserved for the fractional component. However, this bug is actually due to floating point/integer rounding errors and therefore your suggested improvement is not a solution.

    • @christianbarnay2499
      @christianbarnay2499 7 месяцев назад +175

      My programming tip is only use floating points when absolutely unavoidable. If you are only using numbers with a fixed number of decimals, prefer switching the decimal point and using whole numbers for all the calculation. For example properly coded accounting applications use whole numbers to represent the value in cents, not floats to represent the value in dollars with a decimal part. And in modern languages, there is even a "decimal" type that is specifically designed to do that for you.

    • @hanifarroisimukhlis5989
      @hanifarroisimukhlis5989 7 месяцев назад +82

      @@christianbarnay2499 Yeah no. Many times, fixed-point math can actually be *slower* than floating-point counterpart. Like multiply/divide across multiple orders of magnitude, trigonometry, exp/log, etc.
      Point being (pun intended), modern computer are absolute beast when numbercrunching IEEE 754 floating-point, to it being a measure of power (FLOPS). I would dare to say the inverse, *don't* use fixed-point unless you absolutely sure:
      1. All numbers fits, including intermediates.
      2. Has sufficient precision that is more than standard floating-point.
      3. You *really* need that extra precision, with trade-off of more memory/register/cache/etc.
      4. Use good generic fixed-point library (don't try to manually implement, it's 100% not worth it).

  • @barryberg2944
    @barryberg2944 7 месяцев назад +1901

    Climbing on a ladder doesnt count as in the air, while also not being on the ground

    • @uu8217
      @uu8217 7 месяцев назад +61

      swimming maybe too? (if you can swim in that game)

    • @atemoc
      @atemoc 7 месяцев назад +114

      @@uu8217 You can swim in the game (properly only as of only a few years ago), and it has its own state.

    • @JorgetePanete
      @JorgetePanete 7 месяцев назад +4

      doesn't*

    • @andrewwebb917
      @andrewwebb917 7 месяцев назад +61

      You can also climb vines. And scaffolding, though that may be considered on the ground. You may also be in lava or falling though a cobweb. Or lying in a bed, or riding a horse. I'm not sure what any of those mean.
      .

    • @2424Lars
      @2424Lars 7 месяцев назад +6

      @@uu8217 There's boats, so obviously you can swim

  • @ouroya
    @ouroya 2 месяца назад +20

    this bug report finally got fixed today! only took them 7 years

  • @ehfik
    @ehfik 7 месяцев назад +2195

    "whatever floats your boat"

    • @megamangos7408
      @megamangos7408 7 месяцев назад +52

      This is such a high quality pun it hurts. +1

    • @Q_20
      @Q_20 7 месяцев назад +7

      genius

    • @JustAnotherCommenter
      @JustAnotherCommenter 7 месяцев назад +6

      +2 moment

    • @Owl90
      @Owl90 7 месяцев назад +7

      You win the internet for today.

    • @SicTr4nsit
      @SicTr4nsit 7 месяцев назад +9

      pff, get real

  • @Kaiasky
    @Kaiasky 7 месяцев назад +773

    Oh this is SO funny to see a video about this. Fun fact--since most players have no clue about this and use driving boats off ledges as a safe way to get down cliffs, you can often trick people into exploding if you measure out a drop that's exactly the right height.
    It gets a bit into the weeds, but the historical reason for the "don't calculate fall damage if you're falling" stuff is that boats used to break if you rammed them into land. That got removed, but the fix was kinda a hack and accidentally left this method in.

    • @LeeAnnC
      @LeeAnnC 7 месяцев назад +105

      Thank you for reminding me of this! I felt like i was missing one piece of information and i think this was it. Boats used to break and now they don't! Matt keeps talking about a fall damage calculation but I think a better name would be *collision* calculation. And to protect them against damage this is the code they added which in turn inadvertently also keeps the player from damage as well!

    • @SteinGauslaaStrindhaug
      @SteinGauslaaStrindhaug 7 месяцев назад +154

      So the bug isn't really that the boat breaks at certain heights, but that the "avoid having the boat break all the time" workaround causes a bug where you _incorrectly_ don't receive fall damage while sitting in a boat _except_ with these rounding errors.

    • @LeeAnnC
      @LeeAnnC 7 месяцев назад +22

      @@SteinGauslaaStrindhaug this is a good way to put it!

    • @TheAechBomb
      @TheAechBomb 7 месяцев назад +11

      I remember boats breaking... I always hated that but maybe I should go back and play old minecraft

    • @frankcl1
      @frankcl1 7 месяцев назад +26

      ​@@SteinGauslaaStrindhaugit used to be a bug, now it's a feature!

  • @emoharalampiev1590
    @emoharalampiev1590 7 месяцев назад +211

    An interesting thing is that the boat breaks into sticks and planks. And here's the thing, once upon a time boats were really fragile, they would break from crashing too hard, and they of course also break when you hit them, and in both of those instances they used to break into blocks and planks. Then in an update a long time ago they made it so that they don't break as easily (can't break by crashing) and if you break them by hitting them they drop themselves (or in other words a boat item).
    But with that bug they still drop the old drops.

    • @HappyBeezerStudios
      @HappyBeezerStudios 6 месяцев назад +30

      I vaguely remember losing my boat when driving into land too fast. Was that real....?

    • @bowenchapel5732
      @bowenchapel5732 5 месяцев назад +37

      @@HappyBeezerStudios yup. Used to happen a lot

    • @TranscenGopher
      @TranscenGopher 5 месяцев назад +47

      ​@@bowenchapel5732 it used to happen when driving into freaking lily pads. A floating leaf was more durable than a boat!

    • @teathesilkwing7616
      @teathesilkwing7616 4 месяца назад +10

      @@TranscenGopherto be fair those lily pads can carry a full grown man carrying hundreds or maybe even thousands of cubic meters of gold

    • @TranscenGopher
      @TranscenGopher 4 месяца назад +7

      @@teathesilkwing7616 so does the boat.

  • @hugoiwata
    @hugoiwata 7 месяцев назад +852

    I like that, as soon as he told the numbers where that happened, my first instinct was to pause the video and put the sequence on OEIS. Next scene is he putting the sequence on OEIS and finding nothing.

    • @Benw8888
      @Benw8888 7 месяцев назад +23

      I just wish he tried to find a pattern on his own for a bit longer, both before OEIS and especially after OEIS failed. That feels like a more rewarding way of doing things.

    • @tulliusexmisc2191
      @tulliusexmisc2191 7 месяцев назад +22

      I am disappointed that as of the start of April 2024, it is still not in OEIS.

    • @Universal_Craftsman
      @Universal_Craftsman 7 месяцев назад +51

      Now the "Minecraft Boat Fall Damage Sequence" will be introduced to OEIS.

    • @BrainyGreenOtter
      @BrainyGreenOtter 7 месяцев назад +15

      I asked ChatGPT (not the best option, I know, but it was worth a shot)
      It started strong (-ish?) and then started (convincingly/confidently) pulling stuff out of it's virtual arse.
      :)

    • @Hexa1123
      @Hexa1123 7 месяцев назад

      Same.

  • @GrandMagusDK
    @GrandMagusDK 7 месяцев назад +1127

    As a programmer, floating point imprecision has been cause for may hours of desperate debugging.

    • @adfaklsdjf
      @adfaklsdjf 7 месяцев назад +54

      And why I avoid floats unless I'm _really_ certain I need them

    • @pinkraven4402
      @pinkraven4402 7 месяцев назад +63

      ​​@@adfaklsdjfI remember that once I actually created a class 'fraction' that had integer numerator and denominator to be able to compute some numbers exactly, I remember I needed it for something haha

    • @gottagowork
      @gottagowork 7 месяцев назад

      I'm not a programmer, but I did some gauge stuff for Flight Sim back in the day. One involved some INT(float) operation that wouldn't work (iirc I was converting to octal for transponder), and I was completely unaware of the float rounding error. Obviously, my "programming" failed and I couldn't figure out why. So I set it up in Excel to see what was going on, and to my amusement even excel did it wrong. Only when I expanded number of decimals did it show i.e. 4.9999999543xxx instead of 5. I've been aware of it since, even if I've never had to deal with it again.

    • @Sopel997
      @Sopel997 7 месяцев назад +44

      it helps when you understand that they are in fact precise, just inaccurate

    • @ahall9839
      @ahall9839 7 месяцев назад

      ​@@adfaklsdjf Why would you be using any data structure that you aren't sure you need?

  • @Durtle02
    @Durtle02 2 месяца назад +14

    Rest in peace boat breaking bug :(

  • @Turalcar
    @Turalcar 7 месяцев назад +708

    2:50 You can use levels of snow for 1/8 of a block precision with some additional levels at 1/16 - carpet, 3/16 - trapdoor, 9/16 - bed, 15/16 - grass path (I could've forgotten something).

    • @TheRenaSystem
      @TheRenaSystem 7 месяцев назад +149

      Bells, enchantment tables, cakes, are some more specific ones, but (and this is slightly cheating) there's also falling ANY distance up to 0.01 precision by falling sideways out of a water stream or honey blocks (or even technically off of vines/ladders/scaffolding but that's way harder to be precise ironically)

    • @fwiffo
      @fwiffo 7 месяцев назад +24

      Are you actually lower than a block on soul sand or is that implemented differently? It's unlike grass paths because you can place rails and redstone.

    • @DreadKyller
      @DreadKyller 7 месяцев назад +76

      @@fwiffo Yes, you are lower, which is why you can get effects from blocks below the soul sand, if ice for example is below the soul sand you will find it gets slippery, and this isn't hard coded, it's just the fact that the block your feet are in is the block above the ice. You can also see the Y coordinate in F3 go down when you step on soul sand.

    • @Arkios64
      @Arkios64 7 месяцев назад +18

      @@fwiffo I'd guess that Soul Sand simply has a lower collision for the top part, so it isn't actually a full block, only visually represented as one.

    • @lordlightspeed
      @lordlightspeed 7 месяцев назад +9

      ​@TheRenaSystem and different stages of amethyst shard growth, pitcher plants, and...

  • @robertmauck4975
    @robertmauck4975 7 месяцев назад +675

    9:08 when you're under water, you can be neither in the air nor in the ground.

    • @pinkraven4402
      @pinkraven4402 7 месяцев назад +7

      I mean, unless you're on the bottom

    • @haiperbus
      @haiperbus 7 месяцев назад +39

      if you jumped into a cobweb or are sliding down honey as well

    • @koolkrafter5
      @koolkrafter5 7 месяцев назад +14

      My first thought was that it might apply to ladders.

    • @FreekDijkstra
      @FreekDijkstra 7 месяцев назад +12

      My first thought was "when you're swimming in lava". I guess that resembles my fortune, errr, skills, when playing Minecraft. :)

  • @maticjurac
    @maticjurac 7 месяцев назад +87

    Finally, a video that combines three of my favorite things. Mathematics, floating point number tomfoolery and Minecraft.

    • @Vifnis
      @Vifnis 7 месяцев назад +6

      People who code in Java must love this!

    • @maticjurac
      @maticjurac 7 месяцев назад +4

      @@Vifnis I do 😅

    • @mikeuk1927
      @mikeuk1927 7 месяцев назад +1

      Now go compute some inverse square roots :p

  • @LunizIsGlacey
    @LunizIsGlacey 7 месяцев назад +316

    The rabbit hole for Minecraft gravity goes so much further! Turns out most different entities experience different accelerations due to gravity, and different drag forces too! Boats are the simplest, since they don't experience drag.
    As an example, players and most mobs experience 0.08 b t^-2 of acceleration, or 0.01 b t^-2 if they have slow falling, and experience a vertical drag coefficient of *nearly* 0.02, and a horizontal drag coefficient of *nearly* 0.09 (just as in the video, these "nearly"s are due to floating point errors). Drag is calculated after applying acceleration.
    Another example would be projectiles, all which experience ~0.01 drag in all directions, but in this case drag is calculated *before* acceleration! Every projectile experience different gravity though: the ones that stack to 16 like pearls, eggs and snowballs experience ~0.03, while potions, arrows and tridents experience ~0.05, llama spit experiences ~0.06 and xp bottles experience ~0.07.

    • @PromptCriticalJello
      @PromptCriticalJello 7 месяцев назад +9

      I'm just surprised that SciCraft hasn't figured out how to hack Minecraft physics using this.

    • @Kirby703
      @Kirby703 7 месяцев назад +6

      I was looking into horse jump heights a while back and found out that if you're riding a horse in moderately-recent versions, it experiences .02 vertical drag twice per tick, or around .0396 per tick. Do you know if other entities experience this sort of effect in any direction?

    • @kito323
      @kito323 7 месяцев назад +3

      I was about to comment that I remember seeing somewhere some acceleration graphs for MC and they weren't constant and then the higher numbers in Matt's sequence prolly won't work but you pointed it out way more detailed *kudos*

    • @LunizIsGlacey
      @LunizIsGlacey 7 месяцев назад +3

      @@Kirby703 As far as I'm aware no, but I haven't looked much into mobs riding other mobs like in this case. Maybe that could be something interesting to look at...

    • @sky01james28
      @sky01james28 7 месяцев назад +9

      One time I was modding a monster that jumps in the air to land on the player and crush them, and I was having *so* much trouble until I discovered Minecraft has **different air resistance** for *vertical* and *horizontal* motion 🤨

  • @opensocietyenjoyer
    @opensocietyenjoyer 7 месяцев назад +501

    you can actually fall down non-integer heights, falling from different snow layers or from cakes, beds, enchanting tables, ....
    has anyone looked that those?

    • @davidbarroso1960
      @davidbarroso1960 7 месяцев назад +92

      it rounds to the nearest number of blocks fallen minus 3 (meaning first 3 blocks don’t deal damage, every block afterwards deals 1 point of damage). so if you fall 3.49 blocks, you take 0 damage. if you fall 3.5 blocks, you take 1 point, half a heart of damage.

    • @opensocietyenjoyer
      @opensocietyenjoyer 7 месяцев назад +27

      @@davidbarroso1960 but would you take damage in a boat if you fall 12.5 blocks, for example?

    • @auseawesome9112
      @auseawesome9112 7 месяцев назад +43

      @@davidbarroso1960That doesn't matter, because floating point inaccuracy could still occur and place you very slightly above the ground

    • @auseawesome9112
      @auseawesome9112 7 месяцев назад +14

      @@opensocietyenjoyerI'm assuming it hasn't been tested yet because it isn't really necessary to fix the bug, but it could be really easily tested by spawning boats with command blocks, slowly travelling upwards by using an invisible armour stand

    • @davidbarroso1960
      @davidbarroso1960 7 месяцев назад +10

      @@opensocietyenjoyer no. for you to take damage, the resulting position has to be “equal” to the floor position. but the resulting position never ends in .5, so it’ll never equal the floor position if the fall height ends in .5.

  • @willphillips2522
    @willphillips2522 7 месяцев назад +181

    A Camman18 Matt Parker crossover is NOT something I expected but I thoroughly enjoyed

  • @jimmyh2137
    @jimmyh2137 7 месяцев назад +112

    8:50 one example is having your upper body in the water (technically "swimming"), or in a cobweb.

  • @boysenbeary
    @boysenbeary 7 месяцев назад +188

    Didn’t realize there was an online encyclopedia of integer sequences, but thats pretty neat

    • @nocturnomedieval
      @nocturnomedieval 7 месяцев назад +17

      You watch at Matt Parker not knowing numberphile's most featured website? Quite suspect

    • @stevesmith2044
      @stevesmith2044 7 месяцев назад +4

      Neil Sloane

    • @nekogod
      @nekogod 7 месяцев назад +9

      They have the founder of it -Neil Sloane on quite a few numberphile videos. He's pretty cool

    • @NotKyleChicago
      @NotKyleChicago 7 месяцев назад +7

      I think Matt has a copy of the EIS (i.e. the printed version, before it was the OEIS).

    • @shingofan
      @shingofan 7 месяцев назад +13

      @@nocturnomedieval They're probably new here - be gentle.

  • @jglackey2
    @jglackey2 7 месяцев назад +58

    Never in my life did I think Camman18 would end up in a stand up maths video. We truly live in one of the times.

    • @its_w4yne
      @its_w4yne 2 месяца назад

      Surely one of the times ever

  • @FuncleChuck
    @FuncleChuck 7 месяцев назад +291

    This also makes ROUNDING a number an actual nightmare, because XX.5 might actually be XX.49999999 or XX.500000001 and you just can't tell

    • @TroyLaurin
      @TroyLaurin 7 месяцев назад +46

      Rounding floating point numbers is a legitimate nightmare that you should only do if you don't actually care about the result being consistent with anything else in your system.

    • @jesselapides4390
      @jesselapides4390 7 месяцев назад +33

      Thankfully 0.5 is exactly representable in binary

    • @TroyLaurin
      @TroyLaurin 7 месяцев назад

      @@jesselapides4390 yes, but should 0.1+0.4 round up or down? Should 0.1x5 round up or down? Should 0.05x10 round up or down? If you're dealing with precise numbers you usually don't need to round

    • @xanderh2404
      @xanderh2404 7 месяцев назад +25

      @@jesselapides4390 Sure, but not all numbers with a .5 at the end are representable. For example, the number 65166464.5 is stored as 65166464, which means if you round 65166464.5, it will round down instead of up, like it should.

    • @syirogane
      @syirogane 7 месяцев назад +14

      @@xanderh2404 You cannot store 65166464.5 in a 32-bit float. You can't store even 65166464 vs 65166463 in a float (ie, you'll get the same value (65166462 to 65166466 all "round" to 65166464))

  • @RyanGracias
    @RyanGracias 7 месяцев назад +1362

    Stand-up Maths is slowly becoming a Minecraft stan

    • @rhysbaker2595
      @rhysbaker2595 7 месяцев назад +54

      Stan-up maths

    • @spacelover4106
      @spacelover4106 7 месяцев назад +71

      Stand-Up Crafts

    • @babilon6097
      @babilon6097 7 месяцев назад +8

      And the bad thing about this...

    • @yty1941
      @yty1941 7 месяцев назад +6

      @@babilon6097 Is that nothing ever goes wrong with a bit of Math, right...

    • @davidioanhedges
      @davidioanhedges 7 месяцев назад +20

      At this rate Matt will have to actually play it...

  • @aabrightlove
    @aabrightlove 7 месяцев назад +72

    1:08 - looking at this offhand, there is some patterning here:
    12 and 13 have a difference of 1
    49 and 51 have a difference of 2
    111 and 114 have a difference of 3
    202 and a perhaps missing 206 would have a difference of 4
    310 and 315 have a difference of 5
    I'm not sure what is placing these pairs, but I hypothesize that 206 is also a height from which you would die, and that the next two heights would have a difference of 6 between them. If 206 doesn't work, perhaps that is for a significant reason?
    edit- oof it was 198! so my hypothesis was actually not too far off then, nice!

    • @ps.2
      @ps.2 7 месяцев назад +15

      Yeah the missing 198 is at least part of what kept me from seeing a pattern.

    • @jordanberndt4157
      @jordanberndt4157 7 месяцев назад +8

      Yeah, I'm bad at maths but decent at pattern recognition and the pattern didn't take me long to see:
      Along with what you said, the distance between each pair of numbers is:
      - 36 = 12×3,
      - 60 = 12x5,
      - 84 = 12x7,
      - 108 = 12x9,
      Following the pattern, the next 10 numbers in the sequence would be: 447, 453, 609, 616, 796, 804, 1008, 1017, 1245, 1255...

    • @studdy4930
      @studdy4930 5 месяцев назад +1

      i also thought the exact same as you also the difference between 12 and 49 is 37 then 49 and 111 is 62 then 111 and 198 is 87 then 198 and 310 is 112 the pattern might not be very obvious now but again if you get difference of differences then 62-37 is 25 87-62 is 25 112-87 is 25 so next difference should be 112+25=137 and then 310+137=447 then the next 2 numbers should be 447 and 453 and so on

    • @Selunei
      @Selunei 3 месяца назад

      The pattern that I noticed is similar. Break the sequence into pairs of (12, 13), (49, 51), (111, 114), (198, 202), (310, 315), such that each is a pair of (x, y), so that (12, 13) is (x1, y1), (49, 51) is (x2, y2), etc. The difference between numbers within each pair we'll call n, so y1 - x1 = n1, y2 - x2 = n2, etc. The difference between differences (?) is such that n2 = n1 + 1, n3 = n2 + 1, etc. (Just like you already mentioned.)
      The pattern that separates the pairs themselves (that is, the x of a pair and the y of the previous pair) we can call m, where x2 - y1 = m1, x3 - y2 = m2, etc. Each difference is such that m2 = m1 + 24, m3 = m2 + 24, etc.
      Might be a slightly more roundabout way of finding each number than was already mentioned, but that's the pattern I found just before finding this video. 😜

    • @nathan22211
      @nathan22211 3 месяца назад

      considering worlds post 1.16 can be up to 8192 blocks tall via datapacks there's probably a lot to go through. we know some values above y=0 but the world goes to y=-64 now by default

  • @juliafloridausa
    @juliafloridausa 7 месяцев назад +323

    08:48 I think the reason for having the additional onGround variable is because you can swim in Minecraft too (i.e. not in air, and not on ground)

    • @Khantia
      @Khantia 7 месяцев назад +20

      Which can be covered by the status "is_swimming" or something :P

    • @reilandeubank
      @reilandeubank 7 месяцев назад +7

      yes. there can often be good reasons to have an enum status variable but also a bool that covers a specific case of that enum

    • @bilboswaggings
      @bilboswaggings 7 месяцев назад +3

      ​@@Khantiathat would bloat the code and if you add enough stuff like this your performance will suffer
      It's more efficient to cover all 3 options with just the two states

    • @Khantia
      @Khantia 7 месяцев назад +13

      @@bilboswaggings first time I'm hearing of such practices... since when is it more optimal to check if (this.status == ON_GROUND && !isGrounded) instead of just (this.status = IN_WATER)? Computation-wise the latter option is more efficient. It makes little sense for this to be the reason for the existence of isGrounded :P

    • @bilboswaggings
      @bilboswaggings 7 месяцев назад +5

      @@Khantia as shown in the example both are needed for the game to function as it's built
      Adding a status for in water would also require you to add the code necessary for that check (how else would you know what the status is)

  • @outputcoupler7819
    @outputcoupler7819 7 месяцев назад +221

    With regard to the bit at 10:28, this is actually the normal, correct way to compare floating point numbers. The fudge factor even has a name, epsilon.
    You _never_ do a strict equals comparison on floats, because it'll be false unless you're comparing something to itself or to zero. Instead you check if it's within some range, like above or below a target value. You add or subtract epsilon from the value as appropriate to account for the rounding errors.

    • @AlRoderick
      @AlRoderick 7 месяцев назад +10

      So does that mean that when you use the standard == comparison operator in your code that under the hood the CPU is actually subtracting one from the other and checking that the result is within plus or minus epsilon of zero? So that in something like Java, that's a thing that's being done without the programmer necessarily knowing it?

    • @byeguyssry
      @byeguyssry 7 месяцев назад +22

      @@AlRoderick I think it's something the programmers integrated (and OP just means it's common)? Because I definitely have been screwed over by this before

    • @catmacopter8545
      @catmacopter8545 7 месяцев назад +49

      ​@@AlRoderick actually no! "==" does a direct comparison, which is why 0.1+0.2==0.3 (as floats, idk about doubles) returns false. There is probably some package for comparing floats somewhere :)

    • @outputcoupler7819
      @outputcoupler7819 7 месяцев назад +30

      @@catmacopter8545 Yup, exactly this. The language can't make the == operator do this by default because somebody someday might actually want to do a true strict comparison of floats.
      Math packages will usually have a way to do this, or you can just do it yourself. It's not exactly a common problem, most of the time you're working with integers (not necessarily the _datatype_ integer, the mathematical integer).

    • @kibels894
      @kibels894 7 месяцев назад +13

      @@AlRoderick No, == does an exact comparison, which would cause you to fall through the ground unless you were clamping the value, because you would never exactly be at the same level as the ground. Clamping instead of comparing an approximate value may be a way to fix this bug though, like only comparing if you are at or below the ground and correcting the position to be exactly equal to ground level to avoid ever rounding in a way that causes fall damage.

  • @Andoxico
    @Andoxico 4 месяца назад +12

    lol, in the initial youtube short video the numbers listed were 12, 13, 49, 51, 111, 114, 202, 310, and 315. I noticed there was a pattern. First two numbers are 1 apart, the next two are 2 apart, then 3, then there was just 202, and then two numbers were 5 apart. I felt like there should also be the bug happening at 198 or 206, thus completing the pattern by filling the gap with a pair of numbers that are 4 apart. Then low and behold, 198 was included in the bug report :p

    • @DeJay7
      @DeJay7 3 месяца назад +3

      That is a really interesting observation to make with no prior knowledge about the sequence. It's logical if you know how it's derived, but you didn't, so props to you.

  • @playerplayer5838
    @playerplayer5838 7 месяцев назад +143

    Went to investigate. Turns out 198 will break the boat with a player in it (although it waits to do so until you leave the boat), but doesn't cause player damage, which is probably why it isn't in the short.

    • @Systox25
      @Systox25 7 месяцев назад +10

      🙃 Minecraft physics

    • @jneal4154
      @jneal4154 7 месяцев назад +8

      I was trying to figure out why no one was pointing out that there was a missing value in his list... several times.

    • @BlueCyann
      @BlueCyann 7 месяцев назад +18

      12 and 13 also don't cause player damage, though, (and also don't break the boat when a player is in it), so I don't think that's the reason. I think people just repeat the "theoretical" values without testing them very thoroughly.
      Something about "player in boat" is different from other cases, for both the rider and the boat itself.

    • @AAFREAK
      @AAFREAK 7 месяцев назад

      I was thinking of that, though that was included in the bug report. The video that was documenting this though was specifically about the java edition, which I don't know if that's either significant, or that wouldn't make a difference and it was just overlooked when the short was published. Either way, the important issue is that this phenomenon was recorded through the bug report, which I'm more inclined to monitor.

    • @AAFREAK
      @AAFREAK 7 месяцев назад +4

      @@BlueCyann There's about 2 kinds of negligence upon the short's inclusion of 12 and 13, as it's omission of 198. However, nothing about this is theoretical. It's in the bug report, and the report does mention that there are different conditions which the player does/doesn't survive (but never specified which). They simply used examples of the affected values to illustrate the point about the bug and how that's handled.
      I would think that would've been beyond the point to include the player in the test used in this video when it's illustrating the fall damage to the boat with those values. When the boat is "destroyed" is a whole matter unto itself with the game's code in relation to the distance. That's already covered.

  • @ManIkWeet
    @ManIkWeet 7 месяцев назад +259

    As a programmer working with geometric operations, I hate floating point numbers. They're the worst.

    • @SushiElemental
      @SushiElemental 7 месяцев назад +40

      Wait until a work colleague wants to use floating point numbers with currency 😨

    • @natsuzkan
      @natsuzkan 7 месяцев назад +9

      @@SushiElementalDo it and pull an Office Space 😂 (but unlike the movie, do your arithmetic correctly)

    • @SushiElemental
      @SushiElemental 7 месяцев назад +1

      @@natsuzkan Haha I'll think about it 🤓

    • @bobson_dugnutt
      @bobson_dugnutt 7 месяцев назад +5

      @@SushiElemental There's an open source ERP (not super well known but actually used by some companies) that uses floating points for currency. ERP does inventory, accounting, etc. One of the many reasons that made me want to tear my hair out when working with it.

    • @SushiElemental
      @SushiElemental 7 месяцев назад +4

      @@bobson_dugnutt It seems some people just want to lose money.

  • @XandaPanda42
    @XandaPanda42 6 месяцев назад +22

    Extremely common situations where boats aren't on the ground but not in the air....
    is when they float. On or underwater.

    • @LegendLength
      @LegendLength 5 месяцев назад

      I feel it will just avoid all ground checks while you are in water state

    • @alexandermcclure6185
      @alexandermcclure6185 3 месяца назад +2

      That's actually why the boats don't break. They used to break when colliding with ANYTHING (even lily pads!) and they implemented this weird fix to prevent collisions from breaking them into planks and sticks. Those values are when this fix DOESN'T work! So it's not a bug, it's a feature that they don't break!

  • @chromonym
    @chromonym 7 месяцев назад +137

    but then matt had a very good idea. he used f5. you see, using f5 gave him a whole new perspective and he was able to see a floating point error he couldn't have seen before.

    • @potatolyria9375
      @potatolyria9375 6 месяцев назад +6

      OH NO THIS PHRASE IS GONNA HAUNT ME EVERYWHERE NOW THAT I'VE WATCHED THE HOPPER SAGA NOOOOOOO

  • @rismosch
    @rismosch 7 месяцев назад +212

    Stand-up Code Review

    • @TheGreatAtario
      @TheGreatAtario 7 месяцев назад +16

      _[Agile/Scrum PTSD intensifies]_

    • @slice-the-pi
      @slice-the-pi 7 месяцев назад +1

      oh god please no

  • @JohnDoe-rr8uf
    @JohnDoe-rr8uf 7 месяцев назад +6

    That's why we usually try to avoid floating numbers in programming! Excellent video, enjoyed every second of it.

  • @PrincessTidge
    @PrincessTidge 7 месяцев назад +112

    I was surprised to hear absolutely no mention of terminal velocity in this video about acceleration due to falling, so I did a bit of my own investigation and it turns out that although Minecraft does have a terminal velocity, under these specific conditions the boat/player would not be falling long enough to achieve it. 🤓

    • @Baddaby
      @Baddaby 7 месяцев назад +6

      When would it though? Considering the video deals with all the height values in MC

    • @intan4722
      @intan4722 7 месяцев назад +28

      @@Baddabythere are ways to launch a boat upwards so it goes above build height, like hooking a bunch of fishing rods to it and pulling them up at the same time

    • @PrincessTidge
      @PrincessTidge 7 месяцев назад +7

      @Baddaby Okay, this is an excellent question because my initial answer would have been: "Because of the build height limit in Survival worlds there is only enough height in Sandbox worlds to achieve terminal velocity so Matt must be testing in a Survival world... etc" BUT after reviewing the video again it does appear that Matt WAS indeed testing at heights above the Survival height limit (it makes sense that one would do certain tests in a Survival world) so in theory some of the higher tests should be reaching terminal velocity and no longer be subject to acceleration, so what's going on here? 🤔
      I did a little more digging and my current theory is that he is testing on a Super Flat world that starts at Y=60 and bedrock is directly beneath one layer of Grass blocks, which would potentially reduce the maximum falling distance by 60 blocks e.g. a result from Y=300 is actually only falling 240 blocks.
      Again I could be wrong, perhaps Matt is the only person who can answer this, I wonder if he considered terminal velocity at all or if it would even effect the results but I feel like it should, right?

    • @PrincessTidge
      @PrincessTidge 7 месяцев назад +9

      ​@@Baddaby *deep breath* And just to complicate this further, terminal velocity in Minecraft is different for different entities! For a; Player=78.4m/s, Item or Block=40m/s, Arrow=100m/s
      I don't know which of these is applicable for a player in a boat, your guess is as good as mine 😂

    • @icedlava7063
      @icedlava7063 7 месяцев назад

      what's the point of the emoji?

  • @Roadsguy
    @Roadsguy 7 месяцев назад +78

    14:40 The short stops at 315 because that's the longest drop you can achieve within the buildable height of a Minecraft world, which goes from y=-64 to 320 for a total height of 384 blocks.

    • @sky01james28
      @sky01james28 7 месяцев назад

      While true, I feel like I should point out that data packs can change worldgen to go from -2032 to 2032
      minecraft.wiki/w/Custom_noise_settings

    • @Skeke
      @Skeke 7 месяцев назад +1

      Yeah you're right

  • @Great.Milenko
    @Great.Milenko 7 месяцев назад +6

    in air and on ground are separate to allow for easily coding things like ladders, platforms, bouncy slime blocks, swimming, floating in lava, lots of stuff.

  • @epicponedge1177
    @epicponedge1177 7 месяцев назад +84

    8:56 While not on the ground but also not in the air, you could be swimming in water, swimming in lava, falling through packed snow, or falling through the Void (basically the out of bounds area). These are just what I could think of off the top of my head.

    • @LdyVivianne
      @LdyVivianne 7 месяцев назад +2

      Stuck in a spider web…

    • @xycrypt
      @xycrypt 7 месяцев назад

      perhaps falling inside of a non solid block like fire might not count as in the air? just a thought

    • @Halinn
      @Halinn 7 месяцев назад +2

      Climbing a ladder

    • @SomeoneBeginingWithI
      @SomeoneBeginingWithI 7 месяцев назад

      @@Halinn would you be in the air while climbing a ladder? or are you just "in" the ladder?

  • @rianfuro4088
    @rianfuro4088 7 месяцев назад +101

    11:00 The reason why the check has a tolerance on it is precisely because of those pesky binary floating point problems you tend to run into.
    Since you can never be *quite* sure you end up at exactly a whole number when doing calculations, an easy workaround is to just check to be within a 0.001 margin of it.
    Yes, we programmers are lazy and can't be bothered to do this properly 😎

    • @chrishillery
      @chrishillery 7 месяцев назад +26

      Pretty sure that IS "doing it properly", given the context of the problem.

    • @JochCool
      @JochCool 7 месяцев назад +9

      ​@@chrishillery I would argue it's not, because you're not getting the analytically correct answer for any given input. Floating point was designed to be a jack of all trades format; it's good enough at representing basically any kind of number, but not the proper way for anything specific.
      In this case, a proper way to do it could have been to store postion as an integer multiple of 0.04 (essentially, a fixed-point format rather than floating point). This way you can get a proveable, exact algorithm.

    • @chrishillery
      @chrishillery 7 месяцев назад +14

      @JochCool Sure, that's why financial apps don't use floating point. But that's what I meant by "the context of the problem". *Given that* you're working with floating point, the only valid implementation of "equals" is that kind of epsilon comparison.

    • @buttonasas
      @buttonasas 7 месяцев назад +1

      ​@@chrishillery I still disagree: there already exists code that makes sure you don't fall through the ground - the code that checks for collisions. If you can detect for collisions, you can certainly check whether you have "finished falling" and are, in fact, on the ground, in the exact same way as the collision - this should hopefully eliminate the distinction of becoming "on ground" and touching the ground.
      But hey, the margin is a neat trick that probably made for less code and fewer bugs than my idea, so I don't mind it.

    • @BryanLu0
      @BryanLu0 7 месяцев назад +3

      ​@@JochCoolActually, your position isn't limited to 0.04 increments if there are forces other than gravity

  • @kovanova9409
    @kovanova9409 7 месяцев назад +6

    The seperation of IN_AIR and onGround is for swimming.

  • @slawless9665
    @slawless9665 7 месяцев назад +188

    as of this comment, the sequence is still not in the OEIS but I don't expect that to hold forever

    • @cadekachelmeier7251
      @cadekachelmeier7251 7 месяцев назад +66

      This is entirely dependent on the 0.04 acceleration constant, so it doesn't really seem like something they would add. "Integers 1/25th of a triangle number" is pretty arbitrary.

    • @cameron7374
      @cameron7374 7 месяцев назад

      @@cadekachelmeier7251 Methinks we need a way to search the OEIS for sequences that are offset or a multiple of some sequence then.
      Because triangle numbers are probably in there and would come up.

    • @aikumaDK
      @aikumaDK 7 месяцев назад +64

      "Block heights in Minecraft, from which being in a boat will not save you from fall damage"

    • @LethalChicken77
      @LethalChicken77 7 месяцев назад +33

      ​@@cadekachelmeier7251as if they don't have completely arbitrary sequences

    • @slawless9665
      @slawless9665 7 месяцев назад +5

      @@LethalChicken77 they do but they try to keep them to a minimum . . . however I think an exception will probably eventually be made for this sequence, just because it's in this video.

  • @CyborusYT
    @CyborusYT 7 месяцев назад +38

    matt parker camman18 crossover is not what i expected today

  • @Crystal_Bull
    @Crystal_Bull 6 месяцев назад +16

    Did not expect Camman to end up in a science video but here we are.

  • @ordanarymods4990
    @ordanarymods4990 7 месяцев назад +34

    the fact that the boat breaks into planks and sticks is incredibly interesting and likely due to vestigial code. Back in the day if you ran into a shoreline, your boat would break into sticks and planks but now, there are no circumstances in normal gameplay where that should happen, if you break one by hand, it drops the boat item itself so there must be something else going on that makes the boat shatter at those particular heights

    • @Systox25
      @Systox25 7 месяцев назад +2

      They never removed it that you can break the boat. They made it way sturdier and able to pick up.

    • @ordanarymods4990
      @ordanarymods4990 7 месяцев назад +7

      @@Systox25 but the code is vestigial because these bugged block heights are the only time breaking a boat drops sticks and planks now

    • @Systox25
      @Systox25 7 месяцев назад +1

      @@ordanarymods4990 thought explosions would also destroy them into pieces.

    • @LiEnby
      @LiEnby 7 месяцев назад +8

      @@Systox25 fun thing is, it always gives you oak planks no matter the wood type used, meaning you can use boats to convert any wood type into oak

    • @ordanarymods4990
      @ordanarymods4990 7 месяцев назад +1

      @@Systox25 they don’t

  • @aikumaDK
    @aikumaDK 7 месяцев назад +76

    Both for this and the first Minecraft video, Matt specifies 'for those not familiar with Minecraft' that they shouldn't worry about not knowing.
    Now I'm curious how big an overlap there is between the "knows about minecraft" and "watches Matt Parker videos" demographics.

    • @Neo-vz8nh
      @Neo-vz8nh 7 месяцев назад +5

      I would guess that some of Matt's viewers play minecraft as it is probably popular in programers too. But most of the minecrafters are probably children who do not know Matt and math.

    • @Billycca3
      @Billycca3 7 месяцев назад +23

      ​@@Neo-vz8nhnerdy 20 year olds likely make up a sizable chunk of his audience and I'd bet those people grew up on Minecraft (or were at least around it) and would have played Minecraft. Though I agree that obviously the majority of Minecraft players have never seen one of his videos

    • @jackradzelovage6961
      @jackradzelovage6961 7 месяцев назад +7

      i watch(ed) ilmango on the scicraft server and i watch people like marcel vos in openrct2 and im also here, so theres at least one XD

    • @BobCat0
      @BobCat0 7 месяцев назад +4

      Someone made a CPU in Minecraft. Like a .0000001 MHz 8086 or something.

    • @breznknedl
      @breznknedl 7 месяцев назад +5

      @@BobCat0someone also made a 1 hz cpu in Minecraft. Most other ingame redstone computers run way slower though

  • @zamf
    @zamf 2 месяца назад +6

    The bug has just been fixed in one of recent new versions of the game.

  • @U014B
    @U014B 7 месяцев назад +31

    "Multiples of 5, in my opinion, are at least 5 apart."
    -Peggy Hill

  • @misspotato813
    @misspotato813 7 месяцев назад +48

    onGround is mostly used for deciding if you should take fall damage or not. This is often used for quite a few fly cheats to prevent fall damage, especially older ones. However, it also prevents ladders, vines, and scaffolding from killing you when you fall onto them.

    • @chitinousbones9230
      @chitinousbones9230 7 месяцев назад

      hi misspotato

    • @endernightblade1958
      @endernightblade1958 7 месяцев назад

      wait, scaffolding stops fall damage?

    • @misspotato813
      @misspotato813 7 месяцев назад +1

      @@endernightblade1958 I'm not certain actually. I just assumed so because they're just cube shaped ladders, but I haven't actually tested it.

    • @endernightblade1958
      @endernightblade1958 7 месяцев назад +1

      @@misspotato813 i think i vaguely recall them stopping me when crouched at least, but as far as i know without that they’re practically a solid block

    • @dylan__dog
      @dylan__dog 7 месяцев назад

      @@endernightblade1958 if you are holding shift when falling onto scaffolding you will not take any. If you're not holding shift you're taking full dmg

  • @SemiHypercube
    @SemiHypercube 2 месяца назад +9

    As of 24w37a, this bug is now fixed

  • @Mergatroid
    @Mergatroid 7 месяцев назад +226

    I wonder how related this is to Minecraft's weirdest death message: "death.fell.accident.water"?
    That death message only happens when falling a specific number of blocks down onto a waterlogged slab (half block with water on top). Normally water cancels fall damage, but in this one case it doesn't and it gives a very unusual death message about dying by falling into water.

    • @schwingedeshaehers
      @schwingedeshaehers 7 месяцев назад +2

      how is waterlogged counted? because i think it is, when you hit a solid piece of a block, that is also waterlogged

    • @VoltisArt
      @VoltisArt 7 месяцев назад +20

      I do not know, but it seems possible that it's the same issue between the math and the conflicting status.

    • @BlueCyann
      @BlueCyann 7 месяцев назад +1

      @@VoltisArt Maybe it's when you get a fall damage death (some kind of floating point issue) while the game is telling you you're in water.

    • @maxastro
      @maxastro 7 месяцев назад +12

      I would bet nearly any amount of money that the death happens when your falling speed is such that after one "tick" you are exactly aligned with the top of the slab, having been outside of the water the previous tick.
      I can think of several different code weirdnesses that could actually be responsible for the death, but I bet that's the edge case regardless of the specifics.

    • @zipfling11
      @zipfling11 7 месяцев назад +5

      I think that message occurs because the developers didn't account for you dying in that specific way, and didn't assign a proper message to play when it happens.

  • @bhickling3248
    @bhickling3248 7 месяцев назад +40

    Finally tackling the big issues.

  • @astra1288
    @astra1288 Месяц назад +2

    This bug was actually fixed recently! In addition, this video is linked on that bug report page, so I suspect this video contributed to the bug getting fixed!

  • @elmaster65
    @elmaster65 7 месяцев назад +85

    The math and reasoning is sound all around , but i think there's a missunderstanding of the 'why', at around 09:00 , with the whole 'on ground on air' explination, i think that it's not about 'taking fall damage while not being on the air' The actual 'bug' is, when you are on a boat, since you are ON TOP of the boat, 'this.status' is never on_land, so the game basically ignores the 'on.ground' and asumes you are still falling. But in those numbers, the distance from the ground to your character (trough the boat), is so small, it correctly identifies that you did fall and should take damage. I think this reasoning makes more sense than 'taking fall damage when you are not falling'.

    • @LeeAnnC
      @LeeAnnC 7 месяцев назад +5

      Thank you! I was confused his explanation here too

    • @aPictureElement
      @aPictureElement 7 месяцев назад +1

      So, if they used the same method/formula to calculate when (this.status = ON_LAND) and when (onGround = TRUE), then this bug would be fixed, right? Or are they somewhat different things?

    • @lazykbys
      @lazykbys 7 месяцев назад +11

      So this is a case where they decided that a bug was a feature, then got a "bug report" for cases where the game was working the way it was originally supposed to? I haven't the words to tell you how much I love this.
      ETA: Apparently, the "no falling damage while on a boat" thingy was a by-product of fixing a different bug (boats broke when rammed into land or something). Dear gods, how I love it all.

    • @LagMasterSam
      @LagMasterSam 7 месяцев назад +4

      Isn't the issue that the boat is breaking, and then the player falls through and hits the ground? The boat, without even having a player in it, breaks from certain fall heights.

    • @ZonieMusic
      @ZonieMusic 7 месяцев назад

      This makes much more sense! I do hope this gets pinned!

  • @higztv1166
    @higztv1166 7 месяцев назад +22

    you're not on the ground if you're IN the groud, suffocating
    also void
    also water and lava
    also cobweb

    • @nbboxhead3866
      @nbboxhead3866 7 месяцев назад +5

      If you're in the ground, you count as on the block beneath your feet, I think
      If you're in the void, you count as in the air but just don't have anything to hit
      Liquids shouldn't count as in the air or on the ground, and probably don't
      Cobwebs shouldn't change if you're in the air or on the ground, and they'd just affect your falling speed/acceleration

  • @theneilpowers
    @theneilpowers 2 месяца назад +7

    And the bug is fixed!

  • @UserTeemu
    @UserTeemu 7 месяцев назад +13

    3:25 Note: 0.04 is the gravity for boats. It varies from entity to entity and most have it be 0.08 if I recall correctly.

  • @camman18
    @camman18 7 месяцев назад +930

    who is that guy

  • @NuclearSlayer52
    @NuclearSlayer52 7 месяцев назад +5

    8:48 the game does do a check for when your head is underwater, which divides your mining speed by 5 unless you have aqua affinity on your helmet, and the same occurs when "in the air" (including creative flight in survival mode, but that requires mods or server plugins), not sure if those affect anything in this case, but they do combine (atleast in 1.10.2 that i have open to afk)

  • @Gekoloudios
    @Gekoloudios 7 месяцев назад +31

    I was NOT expecting such a good explanation from a non-minecraft channel

  • @zev4133
    @zev4133 7 месяцев назад +83

    Minecraft!? Heck yeah!

  • @grafzhl
    @grafzhl 7 месяцев назад +4

    This is very similar to Quake 3's overbounce bug, source of many very neat tricks in the Defrag trickjumping mod for the game.

  • @TrimutiusToo
    @TrimutiusToo 7 месяцев назад +30

    So the real bug is that status and onGround are not using same margin of error

    • @billionai4871
      @billionai4871 7 месяцев назад +6

      or that they are not updated at the same time. either way, the real bug isn't floating point rounding, but de-sync of state.

  • @vibaj16
    @vibaj16 7 месяцев назад +16

    Minecraft has some really interesting quirks with the way it calculates fast moving entities. To prevent it going through a block when it's moving extremely quickly, it checks every block position between the entity's previous and current positions, but does this separately for the x, y, and z directions. So it can go through a block diagonally because it effectively moves to its new position along the x direction, then y, then z. Some crazy tnt cannons take advantage of this.

    • @sy-py
      @sy-py 7 месяцев назад +2

      Moreover, blocks in unloaded chunks don't have collisions. If an entity is so fast, it moves into an unloaded chunk in one tick, it will go through all blocks it would otherwise collide with in that one tick (before also becoming unloaded)

  • @Wulfstrex
    @Wulfstrex 2 месяца назад +4

    Aaand it's gone. Or rather fixed to be more precise.

  • @LethalChicken77
    @LethalChicken77 7 месяцев назад +41

    9:00 as a games programmer and a minecrafter, there is one situation in game where you can be not on the ground and not in the air at the same time, and that's when swimming. In that case, onGround would evaluate to false, but status would be something like SWIMMING, and the game modifies the player physics based on status. onGround just determines if you can jump, start sprinting, and probably a few other things.

    • @HonestAuntyElle
      @HonestAuntyElle 7 месяцев назад +10

      Ladders

    • @smutnejajo5149
      @smutnejajo5149 7 месяцев назад

      I would guess OnGround is used to reduce your mining speed while it's false (ever tried mining something while on a ladder? It takes like twice as long)

  • @maia5034
    @maia5034 7 месяцев назад +13

    By the way if you ever find yourself in this situation in Minecraft (trapped exactly one of these numbers in the air with nothing but a boat) you can get in the boat and then, while you’re falling, quickly get out and then back in again. This will reset your momentum from the point you exited the boat, and prevent the bug.

    • @thesurlywombat
      @thesurlywombat 7 месяцев назад +5

      You can also just exit the boat right before hitting the ground

    • @BlueCyann
      @BlueCyann 7 месяцев назад

      @@thesurlywombat Yes, this is far easier. Getting back into a falling boat reliably is a little bit tricky, mechanically.

  • @DavidJCobb
    @DavidJCobb 7 месяцев назад +3

    6:43 the h-schmidt float converter has been so useful to me in my reverse engineering work. i unironically enjoyed seeing it in this video. no clue who H. Schmidt even is but their converter is such a great tool

  • @btf_flotsam478
    @btf_flotsam478 7 месяцев назад +12

    You can actually test this hypothesis by testing to see what happens if you land on certain blocks. Some blocks in Minecraft are not exactly one block tall when it comes to entity collision (e.g. with boats and players), and this height can be measured and checked with regards to collision. (Alternatively, you can manually change the tick rate to check what happens when it changes).

  • @Epinardscaramel
    @Epinardscaramel 7 месяцев назад +63

    8:44 Caption error here, “this is just boolean” became “this is just bullying” 😄

    • @angeldude101
      @angeldude101 7 месяцев назад +7

      There were a _lot_ of caption errors. One of the few times I've turned off non-automatically generated captions other than because it was covering up parts of the video.

    • @aikumaDK
      @aikumaDK 7 месяцев назад +3

      There's been plenty of caption errors in recent videos.
      I'm almost inclined to volunteer to contribute to the subtitles myself.

    • @jeffreykirkley6475
      @jeffreykirkley6475 7 месяцев назад +11

      Hey man, don't be boolean the captions.

    • @mkks4559
      @mkks4559 7 месяцев назад +5

      There's also "12th" instead of "20th" when talking about ticks.

    • @yosefmacgruber1920
      @yosefmacgruber1920 7 месяцев назад +1

      Voice-to-text seems to have quite a problem with uncommon words, nor does it judge well by context. That is also similar to why I do not trust auto-correct. I prefer it mark suspected misspelling and let me correct it myself. Those random word switcheroos are really annoying.

  • @avakining
    @avakining 26 дней назад +4

    This bug was patched! Minecraft 1.21.2 (released just 3 days ago - 22 Oct 2024) fixes it!

  • @doublehuman94
    @doublehuman94 7 месяцев назад +11

    3:37 1/20th of a second in the captions as 1/12th of a second. Not like anyone will get messed up because 1/20 is on screen but still not the best, assuming the captions are automatically generated

  • @Barteks2x
    @Barteks2x 7 месяцев назад +14

    What I found really surprising there is that for boats, Minecraft doesn't apply air resistance logic!
    So in theory if you were to spawn a boat at an insane height and go into it, you could reach arbitrarily high speed. This is not at all how the rest of the game works. The player itself has a terminal velocity, because the game takes into account "air resistance"
    Also Minecraft has different value for gravitational acceleration for different entity types.

    • @Systox25
      @Systox25 7 месяцев назад +3

      Someone mentioned here that the boat has a maximum velocity but it needs to fall from higher than here shown

    • @breznknedl
      @breznknedl 7 месяцев назад +10

      actually, when a player is sitting in a boat, air resistance is added. However this does not appear to be the case for mobs, so when you put a pig with a saddle in a boat it doesn't have air resistance. You can then hop on the pig and enjoy gravity freely

    • @Systox25
      @Systox25 7 месяцев назад +3

      @@breznknedlwith enough Hermits with some fishing rods and you got yourself a space program 😂

    • @YounesLayachi
      @YounesLayachi 7 месяцев назад

      I notice this when speedrunners launch a shulker riding boat high in the sky for transportation.
      The boat comes down at such speed it looks like teleporting to the ground

  • @paulmcburney6874
    @paulmcburney6874 2 месяца назад +3

    Computer Science professor here: thank you for this video on floating point imprecision - I have shown it to students

  • @Nolys-bk4kd
    @Nolys-bk4kd 7 месяцев назад +31

    YOOOOO!!!! My favorite math guy uploads a video on MATH AND MINECRAFT?!! While I'M playing Minecraft?!? And while I'm doing Minecraft math myself for Stronghold triangulation?! THIS IS A DREAM!

    • @parkersummers1287
      @parkersummers1287 7 месяцев назад +11

      no dream was a different video

    • @bronsoncarder2491
      @bronsoncarder2491 7 месяцев назад +8

      @@Nolys-bk4kd It's a joke. Matt Parker's other video about Minecraft was about the Dream controversy.

    • @Nolys-bk4kd
      @Nolys-bk4kd 7 месяцев назад

      @@bronsoncarder2491 I get that, but what's the joke?

    • @nbboxhead3866
      @nbboxhead3866 7 месяцев назад

      @@Nolys-bk4kd just a pun on how you said this is a dream because of this lining up with exactly what you're doing, and how Matt released a video about the youtuber Dream and the chances of the item drops of his legendary run. We know you definitely weren't talking about the youtuber, but the pun's still funny.

    • @JohnSmith-ie8ir
      @JohnSmith-ie8ir 7 месяцев назад

      ​@@Nolys-bk4kd you said "THIS IS A DREAM!", hence dream.

  • @recurvestickerdragon
    @recurvestickerdragon 7 месяцев назад +13

    I bet there's even more holes if you went from partial heights, such as using snow layers to add 1/8th of a block at a time

    • @danmerillat
      @danmerillat 7 месяцев назад +3

      No, because 1/25 has no common divisors with 1/8. The closest you get is .125: 2 ticks in you're at y-0.12 leaving you 0.005 above the ground. You'd need an accumulated error of 0.004 to pass the check. The precision error is 0.0000000009, so you'd have to fall for 4.4 million ticks to accumulate enough errors to trigger the bug.

    • @xa-12musk8
      @xa-12musk8 7 месяцев назад

      It rounds

  • @Guedez1
    @Guedez1 7 месяцев назад +7

    Ladder is probably an example on "Not on ground" but "Not in air"

    • @alexandermcclure6185
      @alexandermcclure6185 3 месяца назад +1

      Swimming? So the boats won't break when they hit land now!

  • @WeedL0ver
    @WeedL0ver 7 месяцев назад +32

    A similar thing happens with items and anvils. Anvils can delete items if they are dropped from certain heights

    • @eddie1538
      @eddie1538 7 месяцев назад +8

      it's any height

    • @tOGGLEwAFFLES
      @tOGGLEwAFFLES 7 месяцев назад

      ​@@eddie1538 It's three or more blocks. At two or one they just shove the item out of the way like any other falling block.

    • @YounesLayachi
      @YounesLayachi 7 месяцев назад +3

      ​@@tOGGLEwAFFLESit's a feature not a quirky code.
      Anvils deal damage on impact (and they get chipped themselves) but only if tbey fall more than 1 or 2 blocks.

    • @sky01james28
      @sky01james28 7 месяцев назад +1

      This was fixed in a recent update! Now anvils will only destroy items if they have a special nbt tag

  • @TrainOfImagination
    @TrainOfImagination 2 месяца назад +4

    I did not expect a weird Minecraft falling bug with boats to turn into a 16 minute maths video.

  • @hiucko
    @hiucko 7 месяцев назад +2

    not on the ground, and not in the air - swimming in the water.

  • @enderslice8378
    @enderslice8378 7 месяцев назад +72

    Camman18 in a stand up maths video is something I never expected

  • @pdlbackup
    @pdlbackup 7 месяцев назад +4

    Did not expect another Minecraft video, but I'm very glad to see you looking into this!

  • @rookermtg9321
    @rookermtg9321 6 месяцев назад +7

    My brain immediately starting to think of Mario Maker and the X=9 glitch.

  • @bubzthetroll
    @bubzthetroll 7 месяцев назад +4

    There used to be a bug with boats in the game that they would break extremely easily when using them in water as they are meant to be. I think the fact that players can avoid dying most of the time when falling in a boat is actually a bug that exists because of the code changes done to stop the boats from breaking due to normal use.

  • @deltamico
    @deltamico 2 месяца назад +10

    It's patched now everyone

  • @zwatotem
    @zwatotem 2 месяца назад +2

    Coming back to this, after they finally patched it.

  • @_Matchu
    @_Matchu 7 месяцев назад +4

    underwater would put you not ON_GROUND while neither IN_AIR
    but more importantly these seperate values play different roles in applying gravity & using player's oxygen underwater

  • @Xathroz
    @Xathroz 7 месяцев назад +4

    That swiping sound at 11:37 and other times made me jump out of my seat every time. Felt like someone was in the room with me.

  • @PineappleFlau
    @PineappleFlau 7 месяцев назад +2

    14:30 I had noticed that pairs of values were following a pattern (12 and 13 were one apart, 49 and 51 are two apart, 111 and 114 three apart) and was confused about why it didn't work for four apart, and then came right back for 310 and 315. Cool that the equation actually finds the number that had been missed in the original video, and then the actual boat drop test does show a boat breaking at 198 like it should.

  • @lordender_kitty_official
    @lordender_kitty_official 7 месяцев назад +3

    8:24 if you're not in the air but also not on the ground, you could maybe be in water? cause it's not air nor ground.

  • @Fafr
    @Fafr 7 месяцев назад +5

    3:07 Unrelated, but the way you pronounced it as "metres per second per second" made me finally realise why it has a power of 2 there

    • @ps.2
      @ps.2 7 месяцев назад

      Aren't those little "aha" moments great?

    • @Fafr
      @Fafr 7 месяцев назад

      @@ps.2 They very much are

  • @mishli7670
    @mishli7670 6 месяцев назад +2

    The tolerance for 'in air'
    Was likely implemented due to something like a path block being very close to, but not quite a full block. If the game considered you airborne for that moment, it would feel clunky and not let you jump. Especially if you had one foot on the grass and another on the path (depending on where the ground check is measured from)
    It could also be to ensure your character remains grounded during little rounding errors like that
    Super cool break down!!

    • @mathphysicsnerd
      @mathphysicsnerd 5 месяцев назад

      Like falling onto ground layered with snow from a snow golem's path?

  • @pniemcunowicz
    @pniemcunowicz 7 месяцев назад +7

    so it wasn't String Theory, it was Minecraft that quantized gravity successfully!

    • @andersjjensen
      @andersjjensen 7 месяцев назад +3

      But as the Minecraft gravity quantisation produces solutions that are in conflict with observations, it still needs some work.