What's up with the Pokémon BDSP calculator? - Reverse engineering and code review

แชร์
ฝัง
  • เผยแพร่เมื่อ 27 ก.ย. 2024

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

  • @EmpyreanRagnarok
    @EmpyreanRagnarok ปีที่แล้ว +1573

    "We all know what language the pokemon games were programmed in."
    "Japanese."
    "Unity."
    "Oh right."

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

      ...more like C#, but Unity as a Game Engine existing on many platforms, ..uhh, yeah.

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

      Had the exact same thought xD

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

      Had the same thought.. And I'm a programmer. I am ashamed of myself... LOL

  • @birdofclay9581
    @birdofclay9581 ปีที่แล้ว +2689

    The worst part: Based on what I remember and what I could find about it, the calculator did actually function correctly in all regional versions of Diamond, Pearl and Platinum.

    • @ClassicBentobox
      @ClassicBentobox ปีที่แล้ว +972

      That was back when you were required to release finished games though.

    • @goldenhate6649
      @goldenhate6649 ปีที่แล้ว +183

      @@bigbadgammagnome Or in the case of tons of titles now, never gets fixed because they can't be bothered because they made their money and the game was 'good' enough that the whales will just buy the next one.

    • @ClassicBentobox
      @ClassicBentobox ปีที่แล้ว +133

      @@bigbadgammagnome
      I think for me, it’s about priority. I don’t care about an exploit like Backwards Long Jump in Mario 64, because the game is complete as a package with or without that.
      But BDSP in its vanilla form doesn’t have proper music. It’s missing important parts of the complete package. That’s where it’s an issue.
      The big issue is really that a day will come when the servers offering the patches will go down. And thus some games will live incomplete in their original form. It’s short sighted.

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

      I know expensive software that has problems from this very problem class and the bugs remain for over a decade. Note the plural. The most stupid thing is, that the software "sometimes" uses comma and "sometimes" dot as canonical decimal separator and "sometimes" it accepts both and autoconvertes.

    • @D0Samp
      @D0Samp ปีที่แล้ว +21

      In particular, if the original source was written in C, localization was a feature that was likely either unused and/or not implemented in the standard C library or DS system code (neither has facilities for decimal floating point numbers either), so code similar to this never came even close to assuming to see decimal commas.

  • @58209
    @58209 ปีที่แล้ว +957

    thank you so much for including manual captions. youtube's auto captions would have absolutely mangled this script.

    • @Linventor
      @Linventor ปีที่แล้ว +78

      Yes.
      It's one of those things that doesn't often get much attention, but including captioning is always appreciated.

    • @competitively3315
      @competitively3315 ปีที่แล้ว +89

      Any TH-camr who makes manual captions are based.

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

      +1 !

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

      +1 for manual captions 🧡

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

      I've had to unsub from people who keep captions off, upload auto captions months after posting, etc... I need them

  • @WannabeMarysue
    @WannabeMarysue ปีที่แล้ว +5335

    no, that's just how math works in germany

    • @rubengoldman5830
      @rubengoldman5830 ปีที่แล้ว +168

      incredible username

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

      Dopio

    • @gerbentime4175
      @gerbentime4175 ปีที่แล้ว +112

      It's how math works in the entirety of Europe.
      Source: I'm Dutch.

    • @princier_7215
      @princier_7215 ปีที่แล้ว +43

      @@gerbentime4175 I can confirm
      Source: I'm british

    • @Qvartz_Lite
      @Qvartz_Lite ปีที่แล้ว +21

      BMW owners: "Makes sense"

  • @DarthAnimal
    @DarthAnimal ปีที่แล้ว +434

    This is why I feel so stupid as a programmer sometimes. Not because my code doesnt work, its never a big bug that destroys it, its always something dumb like miss parsing a decimal symbol

    • @neoqwerty
      @neoqwerty ปีที่แล้ว +33

      I'm just a minecraft datapack maker and I SWEAR commas are 94% of the reason why my stuff fails (with 3% being "it's not supported on your version, goober, you were using the latest release's docs and asked the game about a non-existent function")
      At this point I've gone past feeling stupid and I swear the commas are my archnemesis.

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

      @@neoqwerty what about the other 3%?

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

      @@neoqwerty yeah those damn json and their stupid commas lol

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

      @@fatsu Thats the space for problems we know must be there but we havent encountered yet

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

      @@jek__ Or the problems we have encountered and can pinpoint to a specific location but don't know why they happen. I hate those.

  • @watsonwrote
    @watsonwrote ปีที่แล้ว +1088

    My phone language is in French which uses the comma as a decimal instead of period, and I have ran into some weird issues on apps and websites that expect a period but the phone forces a comma. Makes me wonder how many other systems only function within the culture they were designed in

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

      French Canadian would not have these issues, I presume.

    • @Nuvcore
      @Nuvcore ปีที่แล้ว +30

      @@ambozz3726 French Canadian is wierd. We use commas for decimals, but it's definitely not everyone who does so. But technically, it should be commas, so we should have that issue.

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

      English in Canada use periods or full stops as decimal points. And unlike Americans we don't use commas to denote new scales of numbers. Like, "1 000 000" is written without commas or any marks

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

      @@velvetbutterfly Though that does depend on whos doing the writing. Officially, we use commas. Unofficially, we are way to lazy to actual write them unless numbers get huge.

    • @prowhiskey2678
      @prowhiskey2678 ปีที่แล้ว +37

      As a programmer I am pretty confident 95+% of ict systems only work in their designed locale.
      So many things can go wrong, but mainly:
      - wrong translation. translation whose text does not fit in the designed space
      - number formatting
      - currency conversion
      - imperial/metric units
      - and most importantly timezones

  • @KrakatonMain
    @KrakatonMain ปีที่แล้ว +592

    Meanwhile, I have finally learned of the term "nerd sniping" and my god if this is not dangerous af for someone like me. I'm gonna have to be careful from now on

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

      wtf is nerd sniping

    • @masonbarber871
      @masonbarber871 ปีที่แล้ว +41

      @@wackyanimations3326 look up XKCD comic 356

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

      Isnt "nerd sniping" the same as "starting an interesting conversation"? Like whats the issue here, that if you start an interesting conversation with someone unaware while theyre standing in the middle of a road they might get hit by a car? lol

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

      @@jek__ No, nerd sniping is coming across a problem or question so interesting that you're compelled to suddenly stop what you're doing and drop everything to work on it--potentially to your detriment. I guess a conversation could nerd snipe you, but that hook could come from anywhere really.
      In the xkcd comic it comes from (you can pause when he brings up nerd sniping), the guy in the hat is holding up a sign that has a simple-looking (but actually very complicated) electrical problem on it, and the physicist crossing the road gets so distracted trying to solve it that they stop and get hit by a truck.

  • @endlesswanderer1753
    @endlesswanderer1753 ปีที่แล้ว +159

    Back when I worked in QA, we would be given a stack of different region carts/a spindle of different region discs. These days, I figure you just flip back and forth through the regions on the Switch itself. Now, most people who QA aren't as anal as I or some of the others who worked with me were. We would sit there and prod something for hours trying to see if it could bend or crack. A tiny little calculator app that doesn't really matter? You'd think even the most dedicated QA tester wouldn't mess with it.
    ...but if you were in the game long enough, you'd know this was a common issue between regions due to the decimal point difference. The first thing you'd check wouldn't be '2+2? 4? Alright, it works.' No, it would be popping in that EU-GER cart then dividing something.
    Now, one thing I keep seeing people repeating is 'how didn't anyone at ILCA catch this?' The truth is, they probably did. Then the dev team labeled that shit as having least priority and never fixed it before shipping. Every game I worked on had major problems labeled as none issues and ignored until it bit them in the ass. The dev management treated us QA as the enemy almost. I straight up got told to my face 'Stop trying to ruin MY game!" by multiple dipshit managers over the years. And when you look through the comments here, it's no wonder QA testers don't last long. Dudes like me who worked QA over a decade were mostly psychos who hated ourselves enough to sit through getting shit on by the dev team, getting shit on by fans, getting shit on by reviewers, and not even being paid or credited like we worked on the game. Oh, and guess what? When layoffs came by, it was QA that was first to go a lot of the time. If you managed to survive your first game launch, you were likely to be let go at the end of it anyway cause you're disposable and some bright-eyed kid will gladly get paid worse than you to do your job and two other people's. Cause working in games is your dream, isn't it? You should feel lucky to do it.

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

      At my company we've recently slipped into an odd situation involving QA. The devs and QA/QC work together just fine (oddly enough). This time it's release management saying that if we schedule a hotfix window after a new update (for any one of our twenty to thirty big software packages) that's a defeatist attitude. In truth QA isn't magic and our software vendors simply don't have the manpower to work out all the bugs the testers and users will find before a release. Sometimes the issues are minor - "if we do things from this menu the application freezes for a minute but we can do it from the other menu and it goes just fine" - other times they're mayor - "whenever we process a customer onboarding form database errors happen".
      To see devs, operations, and QA/QC team up against release management is a sight to behold.

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

      well said

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

      I don’t even work in game dev but I work on an understaffed team with many high priority bugs, and I can confirm that if we have a user report a bug like this we would mark it as low priority and probably never get around to fixing it.

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

      Sorry it sounds like you had such a rough experience

  • @nadiaholmquist
    @nadiaholmquist ปีที่แล้ว +52

    Ah yes, locale dependent number parsing issues strike again.
    You'd be surprised how common this is. A year or so ago I reported a bug to Apple causing some UI elements to go missing on macOS with the framework we were using - the culprit was that any SVG image containing a decimal point would fail to parse in locales that use commas, because whoever wrote the parser for those in the OS forgot to specify the locale when parsing the numbers in the file.

  • @Zakar0
    @Zakar0 ปีที่แล้ว +1845

    I'm not sure whether to be impressed or disgusted that a coding program sold for less than 20 dollars can automatically detect and warn about an issue that evaded the coder, UI dev, and beta tester(s) (though those were probably 0, or 1 for JP and 1 for EN only). Like, that borders on impressive just how overlooked it was.

    • @Gold_Yoshi
      @Gold_Yoshi ปีที่แล้ว +224

      Maybe only the EN and JP testers were the only one who tested the calculators, the rest may have decided "Oh! A calculator *1+1*. Well, it works! Time to never use this again, not that it matters! I trust that GameFreak (Edit: ILCA developed this rather than GameFreak, my bad) can build a basic calculator."

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

      The biggest ever franchise in the world missed all of this and its only getting worse

    • @shinydragon69
      @shinydragon69 ปีที่แล้ว +108

      @@Gold_Yoshi Game Freak deserves all the hate, but BDSP was developed by ILCA, not Game Freak.

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

      @@Gold_Yoshi The plugin is usually used by professionals developing stuff in Unity but ILCA were new as hell to coding and probably did not get that.

    • @KojoGotMojo
      @KojoGotMojo ปีที่แล้ว +21

      @shinydragon69 but game freak hired them to do their job, I blame gamefreak for giving them a task that couldn't be handle

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

    omg I always say that BDSP always looks like it is "baby's first unity project" but holy moly it's actually true, it baffles me how they couldn't go for the Let's go engine, if that game was made to the same level of care as the lets go games it would be so incredibly memorable.

  • @dameatofdavoid32
    @dameatofdavoid32 ปีที่แล้ว +325

    Honestly didn’t even know that the calculator was broken outside of the US and Japan but it makes a lot of sense why it was broken

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

      Europe Ruins Everything by not following basic standards part 761

    • @AliceErishech
      @AliceErishech ปีที่แล้ว +35

      @@snintendog How did they even end up using a comma as a decimal point anyways? I mean it's literally called a decimal POINT. Commas are blatantly not points. That's just as stupid as us Americans sticking adamantly to our imperial measurements.

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

      @@AliceErishech As a fellow programmer in Europe, I personally see the , as cursed and use . as much as I can.

    • @anda3487
      @anda3487 ปีที่แล้ว +95

      @@AliceErishech Surprise: its not called decimal point in german, but literally just comma. Its annoying that we dont have a unified system - But your reasoning isnt good lmao

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

      @@AliceErishech Imperial Measurements are slowly falling away in the US in a lot of engineering and architecture so it's not as stubborn as you think. But as for the comma crap all I can see is the Need to be different all programing follow the UK Us Asian math system and it's literally 4th world countries that are doing this so why are we capitulating to them? (4th world country a country that Willingly gimps itself.)

  • @someone.8878
    @someone.8878 ปีที่แล้ว +97

    imagine the broken calculator becoming an all-new arbitary code execution glitch

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

      Yeah! And it'd never happen because modern technology is strong!

    • @mariocamspam72
      @mariocamspam72 ปีที่แล้ว +26

      Sadly the Switch has memory guards and rw protection and all, so no SNES-esque consequenceless access violations :(

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

      @@mariocamspam72
      Speaking of access violations, didn't the original Crash Bandicoot override system memory? The past was, as the kids say, a whack place.

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

      @@klobiforpresident2254 how

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

    Literally a CS101 project and they managed to do it this badly in a game from the highest grossing franchise ever.

    • @leohuangchunwang
      @leohuangchunwang ปีที่แล้ว +158

      @Lind Morn Gamefreak didn't even make this game, it was outsourced to a different company...
      Though honestly I wouldn't blame the devs for failing to catch the bug - the fact that the decimal point can be something other than a dot is not exactly a well-known fact outside of the countries that do use a comma, and I'm pretty sure any CS101 version of such a program would have far worse bugs (especially around floats) than this

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

      Look, no, this is the easiest project possible stop defending it. If there were bugs or would’ve been in implementing it into the poketech or the actual UI not it’s functionality. If someone cannot code a calculator’s functionality then go back to school cause you learn that in coding camp from middle school, this is just much more variable management, it’s also in C# one of the easier languages to use.
      I’ll nerd out a little as a cs grad. So for something like this program you don’t even need to pay $20 for a program, there are many packages and apis that will do it for you for free. Even if you don’t want to use those, since there are only 2 different types of numbering systems , and . You can write 2 methods let’s call printdot and printcomma, do all the original math normally, pass the answer into those methods depending on your region selected, and reconfigure the , into .. Now a issue that people might say is oh what if put the number in using . easy, write a third method called readdot and send it into the normal calc. The bigger thing people will bring up is, “they don’t have the time” no, they do, writing these 3, no 2 methods will take maybe 30 minutes at most, basically if they hired an extra highschool intern. So yeah, no excuses

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

      The code is fine except for a single fuckup that they missed. This is more of a QA issue than a coding one.

    • @alarii2582
      @alarii2582 ปีที่แล้ว +29

      @Lind Morn The Pokemon Company (The company that actually owns the rights to Pokemon) is owned 50% by Nintendo and 50% by GameFreak. They have access to more then enough money to actually make a good game if they wanted to.

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

      @@maverillion4610 my brother in christ, this bug could be easily resolved if they actually had time to test the game and every single thing in it, which take more than 30 minutes

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

    Knew as soon as you mentioned "region" that it'd be a locale issue with period/comma. Every newbie programmer's nightmare, surprised to see such an issue in such a highly regarded franchise though, I guess an extremely small portion of their budget is going to developers lol

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

    from bulbapedia:
    "In Pokémon Brilliant Diamond and Shining Pearl, [the calculator] has been reported to exhibit wonky behavior."

  • @Stingpie
    @Stingpie ปีที่แล้ว +161

    I cannot imagine the thought process behind this code. Why didn't they just turn the number into a string to send to sendnumimage? It would've been simpler, faster, and less buggy. This was either programmed by somebody who didn't know how to iterate over a string, or is some weird hold over from the GBA.

    • @HenryLoenwind
      @HenryLoenwind ปีที่แล้ว +52

      I guess they ran into some edge cases (e.g. integer part longer than 10 digits) and couldn't come up with a way to handle those in a sensible way.

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

      DS*

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

      @@HenryLoenwind then just render 10 digits starting from the left side if the string is longer than 10 digits, and check if the number's value is too high to display. Then write some code to remove the 0s at the end if there's a decimal point. Problem solved

    • @X-3K
      @X-3K ปีที่แล้ว +18

      he got paid per line

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

      I imagine that there was no thought process behind this code; not only should the developer not have used the default culture, they should not have used the default format either, since they already knew how many digits they wanted. And they definitely should not have required so many conversions just for one number display routine.

  • @competitively3315
    @competitively3315 ปีที่แล้ว +97

    I didn’t know the calculator wasn’t correct. That’s absolutely hilarious lmao

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

    I thank you for this video. I use the exact same approach since february to do various unity reverse engineering projects and data mining. And I didn't know that I could also parse and use the header file in ghidra. This would have made so many things so much easier. Until now, I had to manually rename function parameters and figure out when a field of the current class instance was referenced.
    Great content, keep it up, and leave some of those information in the videos to maybe help others that stumble over your content. Have a great day :)

  • @anselmschueler
    @anselmschueler ปีที่แล้ว +65

    OK, I’m at 9:17 currently and I’m *betting* this has something to do with the fact that German uses the comma (,) as the decimal separator. Some locale-dependent parsing or formatting function is getting called and it’s not outputting what the rest of the code expects.
    EDIT: I was right, but wow, I’m surprised this code doesn’t crash

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

      German, more like Europe

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

    I am very happy TH-cam recommended this to me, this is a great video! Learning about how games can be reversed engineered almost makes me want to try it, but I'm terrible at reading code so I'll stick to dumping games and getting their music files instead.

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

    A new piman video is always sure to be quality content

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

    Funny to see pros making a similar mistake to what I did before!
    I had to replace "ToString();" with "ToString(System.Globalization.CultureInfo.InvariantCulture);" in some of my code to make the commas/dots not change.
    Lucky that I was using two computers with different locales, otherwise I would have missed the bug.

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

    Excellent video! You did a great job explaining everything to be understandable without overly bloating the details.

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

    I highly appreciate you not treating me like I'm stupid! This topic is so interesting. Great video!

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

    I'm more impressed that this thing still gives the right answer sometimes.
    Aside from the locale thing it looks like they treated C# like assembly.
    Impressive how much you can overcomplicate a calculator.

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

    Excited for the pokemon crystal ranking coming out

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

    Changing the operator mid calculation is the same way a lot of built in calculator apps work. You could reasonably call that a feature rather than a bug.

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

    Your work is just incredible, just mind blowing stuff

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

    It's incredible that I know nothing about game dev, have never used unity, and haven't looked at C++ code in five years and I knew the second you mentioned the problem was with certain regions that it was comma-related. Such a remarkably obvious oversight and the fact that nobody ever thought about it prior to release is jarring.

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

    this is an example of why overcomplicating something can result to chaos

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

    Didn't even realize you were they guy that did the SMO videos. Fantastic content

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

    Within the first minute, I knew exactly what happened. It actually happened to me in a mod from Vampire The Masquerade Redemption. The mod included a launcher that let you set some percentages of gameplay elements and they completely broke in my spanish PC.
    So the aesop is: pay attention to the goddamn locale when you're coding an app that is meant to be globally distributed.

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

    Dang, havent even really started the Video yet but that infinite resistor grid nerd sniped me. 😂

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

    This reminds me that a game dev youtuber I follow had a similar problem.
    On one cutscene, the characters would teleport to coordinate "1.000", which worked well on some PC's, but caused the player to end out of bounds on other cases.
    It was due to the country you had your PC set on.
    Very interesting, honestly. This video goes more in depth, which is something I, as a junior programmer, find very nice.

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

    Wow, great video.
    When I watched Matt's original video, I thought the problem is probably somehow related to the calculator parsing the locale dependent string representation of the number and then searching for a "." character specifically to split the number into an integer and decimal part. But I had no idea why it would do that instead of just displaying the string directly and after watching your video I still have no idea :D

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

    the recommendation algorithm was good today. very satisfying being able to see this video just a day or two after matt's!

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

    I really enjoyed this video and dive into some of the broken code in the Pokémon games! There’s plenty of it & I’d love to see more some day!
    Thank you for making this video :D
    Keep up the astounding work!

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

    How come this calculator doesn't throw up the "????????" for 7/3 like in the original video? Was that a bug that was introduced in later patches?

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

      Yeah, I haven't checked the code in the later patches, but I don't think there's any code in v1.0.0 that would make it display question marks.

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

      They probably added a check if the integer part is longer than 10 digits. And as 7/3 is repeating, and they count everything as "the integer part", it most certainly is longer than 10 by an infinite number of digits.

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

      @@HenryLoenwind It can't possibly be infinite since infinite string won't fit in the memory

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

      @@jhgvvetyjj6589 You don't actually need to fit it into memory. Calculating the digits and counting them would be enough, and would keep the machine busy until the end of the universe. There's enough RAM to store a really huge number.
      However, for knowing that an infinite string of digits is longer than 10 digits, stopping after the 11th digit is quite sufficient.

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

      @@HenryLoenwind I don't think there even is that kind of abstraction in the language, it's most likely doing double precision so the default conversion to string would be up to 17 significant digits at most.

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

    I just now learned of this game being a unity engine based game. Honestly I cannot say I expected it to be one, but honestly I’m not suprised

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

    i thought i get bored as hell, but even me as a programmer must say you made a intressting vid, nice work!

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

    Reminds me of a bugreport I saw a couple years back, where in the minecraft mod Astral Sorcery, a turkish player either got a crash or was missing an item. The culprit was that the upper/lowercase conversion functions in java are, again, locale specific with most regions having I/i paired, but turkish has I/ı and İ/i, which caused the failure.

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

    The funny thing is that the way SetNumImage is coded is an amazing portrait of a confused dev who is sort of reimplementing the modulo operator from scratch, rather just using the modulo operator. So even though that function is "correct" as far as I can tell, it could have been so much shorter and simpler:
    private void SetNumImage(UInt64 num, int digit, int dispIndex) {
    for (int place = 0; place < digit; place++) {
    var placeIndex = dispIndex + place;
    numImage[placeIndex].enabled = true;
    numImage[placeIndex].sprite = (CalcCode)(num % 10);
    num /= 10;
    }
    }

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

    the song in the second half is called Dragon's Den (From "Pokémon Gold & Silver") by DJMykah

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

    Okay analysis video! Thanks for uploading!
    Looking forward to the Crystal-based video! Thanks for uploading!

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

    Now that I've fooled you with the cartoon creatures, let's talk about computer science.

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

    That suppressed laugh at 3:40 haha

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

    Truly impressed with this video, great content and you deserve more subscribers and likes. Commenting for the algorithm, good luck with your channel

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

    Wait, so they do the arithmetic on numbers, then cast the result into a string, which they then try to parse to get back to the number from step 1?

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

    On one hand, I really don't blame them too much for failing to grasp localization as that is a genuinely hard thing to wrap your head around. On the other hand I am dumbfounded by the fact they used strings to store numeric values.

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

    Amazing, would love to see more of this stuff

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

    Man I love bugs like these they're so annoying but funny when you find them!

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

    That's why I'm subbed to this channel.

  • @Bobbias
    @Bobbias ปีที่แล้ว +28

    This could have been avoided several different ways. There should be no reason to convert it to a string at all, but if they're going to do it, they should at least search for the localized decimal separator (you can query your locale to find out which separator is valid) rather than hardcode a specific character :/

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

    We have multiple shared recommended videos. Nice.
    Anyways, excellent video!

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

    I think that videos showcasing BD/SP’s absolute mess of game design + coding is a genre that needs more appreciation. Love the in-depth explanations and ESPECIALLY the hand-written captions, MUCH appreciated!

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

    TH-cam fetched me the perfect video today, I assume!

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

    I'm quite proud I figured this one out on my own, shows my degree wasn't completely worthless lmao

  • @NekiCat
    @NekiCat ปีที่แล้ว +62

    Seems unbelievable they made such a simple mistake. That's probably somewhere near the top of a "falsehoods programmers believe in" list. Highly recommend reading through those, by the way.

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

      The professional cad software Altium Designer has this issue all over the place and that for over a decade.
      So... I don't mind it in a pokemon game.

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

      I would put this onto the list "things programmers micro-manage in a completely convoluted way". Instead of writing a format string for format() that matches their limited display space (which is exactly what format() was made for), they mix 3 different ways of handling a number. Although, the list "what happens when programmers combine alternative ways to do things instead of sticking to one of them" also is a good candidate.

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

    1:49 YOOOO ACE ATTORNEY IN YOUR LIBRARY

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

    Going to save this, a little ago I gave up on a RE project because I couldn't use the header on ghidra

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

    How the machine parses language is something so easy to trip over when you don't think about how each line will work in each language. I don't blame the person that made the calculator, but at the same time, it really should have been something they saw coming.

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

    Man he confirmed he's doing Crystal for the ranking series! I hope you eventually earn enough from TH-cam that you can purchase a good computer specifically to run the simulations. That would be awesome for speeding things up!

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

    Babe, wake up. A new vídeo released

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

    This is crazy. I didn’t know any of this was possible

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

    Oh the shining pearl/diamond games are unity/c#? That makes the cause of the problem fairly straight forward if it happens only in german regions.
    At least in theory:
    The calculator and the ui probably use . as decimal separator, but the german locale for string parsing uses a , for that. That should probably cause an error, but it just probably interprets the result/input as integers instead, which at least explains why 5/2 is 2 instead of 2.5

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

      this video literally deep dives into the code and literally shows not only why but also how it behaves that way

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

    9:05 german here, the a in Taschen- and e's in rechner are not silent, e's are rarely silent in german at all they only are when a u follow because eu is a specific sound. strahlender was almost right but you didnt pronounce the first r for some reason? And Diamant was perfect.

  • @1337treeckolol
    @1337treeckolol ปีที่แล้ว +1

    I hope you see this but I really like the music you chose. The creator of the music you used however has hundreds of videos- what songs did you choose? Can you list them?

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

      There's the Cerulean City remix, the Dragon's Den remix, and the Elm's Lab remix I commissioned for the Crystal video which he hasn't posted yet.

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

    If it already generated the string in '_numDispString', why doesn't it just show that?

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

    "if anyone asks I got this legally, here is proof I own the games"
    Classic.

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

    Nice upload schedule

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

    Liking commenting and subscribing for Neon White.

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

    Ghidra reminds me of movie/game hacking stuff. And that stuff is funny to me

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

    decimal separator is still a thing in business software in 2022 also

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

    it’s wild to me that you can just… do this. the tools are out there

  • @1014p
    @1014p ปีที่แล้ว

    You would think by now these few countries would use a period as a decimal point. Comma as the separator. No way they are not aware of the flaw in the flipped used.

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

    Google Docs Sheets is full of similar bugs. Comma separators are replaced with semicolon ; as separator for ... half the people in the world? Well, many features become completely broken as app general user code correction enforces ; but the features expect the US , separator.

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

    I remember liking your AI tournament videos

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

    I will say I understood nothing about what you were saying but I did watch the whole video

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

    the Taaschenreickner in Pokemon Stahlender Diaman

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

    "Not paying for IDA"...
    Looking at compiled C# in IDA is like staring into the abyss anyway. They give you decompiled bytecodes, while other disassemblers (even free ones) can at least regenerate C# syntax.
    It may work well with the transmogrified code though.

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

    I did have fun and did learn something

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

    o shit he's back

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

    I love these!!! Could you do the same thing for "Mario Kart 8 Deluxe", by any chance, if you have that game? That's my favorite Nintendo game for the Switch. I love how the thing plays, and I'd love to at least try to get an understanding of how the antigravity mechanic works under the hood.

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

    There’s a version of the il2cpp dumper which makes a good c# decompilation, which is way better than hydra

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

    ...why are they converting their string to a number by method call and then manually converting that back into a string?

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

    It's so weird, send like they wrote the code to parse the localised value turning 2,5 into 2.5 but then reference the localised value for the display rather than the parsed one? Why even parse it at that point?

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

    I always complained about how stupid imperial system is, but using comma as decimal point is even worse to me lol

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

    TLDR; Because the code wasn’t fixed for countries that use commas instead of full stops, it messes up the code for the calculator and tries its best to give an answer according to the buggy code

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

    I'm pretty sure you can just use dnSpy to decompile Unity C# code and get near-perfect working code files already, you don't have to look at the compiled code.

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

    Me who can barely make a functioning command-line dog year converter in C# watching this: 👁👄👁

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

    Liked for manual captions

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

    Germans when you call a calculator a calculator instead of "DASMATHENCALCULEN"

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

    Clicking on a new operator and changing the current operation is pretty standard. I's viewed as correcting a mistake.

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

      Admittedly it's been a while since I've used a pocket calculator, but I feel like for the vast majority, when you enter a second operator it'll show the result of your first one and then let you enter a third number. This calculator just overwrites that first operator.

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

      I don't think it is.
      With this calculator it's like:
      1- input: 1, display: ": 1", memory: 1
      2- input: +, display: "+: 1", memory: 1+
      3- input: 2, display: "+: 2", memory: 1+2
      4- input: "-", display: "-: 2", memory: 1-2
      Here's what happens inside my phone's calculator when I do this:
      1- input: 1, display: "1 (₁)", memory: 1
      2- input: +, display: "1+", memory: 1+
      3- input: 2, display: "1+2 (₃)", memory: 1+2
      4- input: "-", display: "1+2-", memory: 1+2-
      5- input: 3, display: "1+2-3 (₀)", memory: 1+2-3
      And here's what happens inside my calculator app on my windows 10 laptop:
      1- input: 1, display: ": 1", memory: 1
      2- input: +, display: "+: 1", memory: 1+
      3- input: 2, display: "+: 2", memory: 1+2
      4- input: "-", display: "-: 3", memory: 3-
      5- input: 3, display: "-: 3", memory: 3-3

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

    This was really rad even though I understand about half of everything being said

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

    Hey, I made this mistake too, in my first year of uni.

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

    3:42 this dude just laughed at "dumper".
    I laughed too, but I just wanted to point it out.

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

    ... I'm going to come back to this video any time I get imposter syndrome.

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

    inb4 Nintendo sues you for showing Pokémon disassembly on the internet

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

    sorry for not being able to pick this up, but what was the correct value of parsedNumber supposed to be, 12? and if so, what's the point of using the parsed one rather than integerPart? I'm especially confused because the draw function used decimalPart...