• melsaskca@lemmy.ca
    link
    fedilink
    arrow-up
    0
    ·
    2 months ago

    I’m familiar with issues like this. Lots of copy/pasting with little edits here and there all the way down.

      • Zink@programming.dev
        link
        fedilink
        arrow-up
        0
        ·
        2 months ago

        This was a fun one to look up. https://en.wikipedia.org/wiki/Shannon_number

        It looks like the number of valid chess positions is in the neighborhood of 10^40 to 10^44, and the number of atoms in the Earth is around 10^50. Yeah the latter is bigger, but the former is still absolutely huge.

        Let’s assume we have a magically amazing diamond-based solid state storage system that can represent the state of a chess square by storing it in a single carbon atom. The entire board is stored in a lattice of just 64 atoms. To estimate, let’s say the total number of carbon atoms to store everything is 10^42.

        Using Avogadro’s number, we know that 6.022x10^23 atoms of carbon will weigh about 12 grams. For round numbers again, let’s say it’s just 10^24 atoms gives you 10 grams.

        That gives 10^42 / 10^24 = 10^18 quantities of 10 grams. So 10^19 grams or 10^16 kg. That is like the mass of 100 Mount Everests just in the storage medium that can store multiple bits per atom! That SSD would be the size of a small large moon!

        • lime!@feddit.nu
          link
          fedilink
          English
          arrow-up
          0
          ·
          2 months ago

          i think you did the weight approximation in the wrong order, 1024 is a lot bigger than 6×1023. so you can probably double the final weight.

          • Zink@programming.dev
            link
            fedilink
            arrow-up
            0
            ·
            2 months ago

            10^24 is a lot bigger than 6×10^23

            Well yeah it’s almost double, but I wrote the comment as a mental estimation of the order of magnitude, so it doesn’t change the substance of the discussion.

            I mean at the beginning I arbitrarily picked a number in that 10^40 to 10^44 range and that’s a factor of 1:10,000 rather than 1:2, lol.

            • JackbyDev@programming.dev
              link
              fedilink
              English
              arrow-up
              0
              ·
              2 months ago

              Slightly less than double, actually. (Doesn’t really change the meat of the argument or anything though.)

        • CrazyLikeGollum@lemmy.world
          link
          fedilink
          English
          arrow-up
          0
          ·
          edit-2
          2 months ago

          Assuming your math is correct (and I have no reason to doubt that it is) a mass of 10^16 kg would actually be a pretty small moon or moderately sized asteroid. That’s actually roughly the mass of Mars’ moon Phobos (which is the 75th largest planetary moon in the Solar System).

          • Zink@programming.dev
            link
            fedilink
            arrow-up
            0
            ·
            2 months ago

            I was thinking of 10^16kg diamond storage inside a larger SSD that’s the size of a large moon, similar to how a real SSD has data stored in tiny little slivers of silicon inside a much much larger device.

            I should have explained that one better. It’s easy to imply such details to keep text shorter.

          • Zink@programming.dev
            link
            fedilink
            arrow-up
            0
            ·
            2 months ago

            If you don’t limit it to valid positions/arrangements it’s like 10^120. Closer to the “number of X in the observable universe” caliber of number.

            • PolarKraken@programming.dev
              link
              fedilink
              English
              arrow-up
              0
              ·
              2 months ago

              So I think I was wrong, but you are too lmao.

              10120 is the number of valid game-trees, or valid ~80 move games.

              The much smaller number I quoted above, though, IS the valid positions, I was thinking it was actually the trimmed down “truly valid” game-tree sequences.

              Isn’t math fun? Limitless ways for us to be wrong!

  • SGG@lemmy.world
    link
    fedilink
    English
    arrow-up
    0
    ·
    2 months ago

    Honestly back when I was a kid this is how I thought games were made, every possible image of a game was already saved and according to your input it just loaded the next image.

    I stopped thinking that with 3d games

    • Makeshift@sh.itjust.works
      link
      fedilink
      arrow-up
      0
      ·
      2 months ago

      This is what I believed. And I tried to trick the game by doing movements and inputs no one could have planed. Never outdid that planning somehow. They were on to me!

    • Captain Aggravated@sh.itjust.works
      link
      fedilink
      English
      arrow-up
      0
      ·
      2 months ago

      It does work like that a little bit, like with sprites they’ve often hard-coded the frames of animation, so when you push a button it loads the correct image, like Mario’s jumping frame with his hand in the air. But there are such things as tilesets, and sprite positions, and all that good stuff.

    • 0ops@lemm.ee
      link
      fedilink
      arrow-up
      0
      ·
      2 months ago

      I thought that they were managing that stuff on a per-pixel basis, no engine, assets, or other abstractions, just raw-dogging pixel colors.

      And before I even played video games at all I was watching somebody play some assassin’s creed game I think and I thought the player had to control every single limb qwop-style.

      • FateOfTheCrow@lemmy.blahaj.zone
        link
        fedilink
        arrow-up
        0
        ·
        edit-2
        2 months ago

        In the first few Assassin’s Creed games, they did use the idea of a Puppeteer system for the control scheme, although it wasn’t physics-based or anywhere as hard QWOP. Each face button of the controller performed actions associated with each limb, and the right trigger would swap between low profile actions and high profile actions.

        In the top right of the screen, there was always a UI element showing what the buttons did at that moment in that context, which might’ve been part of why you thought it was like that. It’s not exactly what you were thinking of at the time, but you were closer than you realise.

        • Zugyuk@lemmy.world
          link
          fedilink
          arrow-up
          0
          ·
          2 months ago

          Not quite “Time Killers” level of limb to button assignment, but a line that I had not drawn in the AC control scheme!

    • Scoopta@programming.dev
      link
      fedilink
      arrow-up
      0
      ·
      2 months ago

      Even with 2D games that’s basically impossible. Only time it could work is with turn based games and then…you end up with this post lol.

      • Wolf314159@startrek.website
        link
        fedilink
        arrow-up
        0
        ·
        2 months ago

        I see you’ve never played “Dragon’s Lair”, where every scene was cell animated and the player “chose” the path that the animation would take.

        • Scoopta@programming.dev
          link
          fedilink
          arrow-up
          0
          ·
          2 months ago

          LOL, I’ve actually heard of it, but I have not played it. Ofc that game never even crossed my mind when writing my comment haha. I suppose choose your own adventure style books also fall into this category.

        • Captain Aggravated@sh.itjust.works
          link
          fedilink
          English
          arrow-up
          0
          ·
          2 months ago

          That one ran on a laserdisc, right? Like a CAV disc so it could very quickly move the laser to one of a couple of places for basically a win/lose decision, overlaying some graphics over top for the game UI?

    • papalonian@lemmy.world
      link
      fedilink
      arrow-up
      0
      ·
      2 months ago

      I remember having a thought one day as a young kid while interacting with a DVD main menu (the kind that had clips from the movie playing in the background, and would play a specific clip depending on what menu you went in to).

      “This is basically how video games work, there’s a bunch of options you can choose from and depending on what you do it shows you something. Videogames are just DVD menus with way more options.”

      I grew up to not be a programmer.

    • NotSteve_@lemmy.ca
      link
      fedilink
      arrow-up
      0
      ·
      2 months ago

      I grew up mostly with the PS2 and above and I thought the same thing 😅. I did think there had to be a better way though

    • TheTechnician27@lemmy.world
      link
      fedilink
      English
      arrow-up
      0
      ·
      2 months ago

      I remember speculating as a (small) kid that the AI soldiers in Battlefront II’s local multiplayer might be real people employed by the developer. Not the brightest child was I.

      • DesolateMood@lemmy.zip
        link
        fedilink
        arrow-up
        0
        ·
        2 months ago

        I remember as a kid seeing my older brother talk to people on a mic and thought he was talking to the characters in the game

  • MnemonicBump@lemmy.dbzer0.com
    link
    fedilink
    arrow-up
    0
    ·
    2 months ago

    As a middle schooler I used Power Point to make FMV games for my friends and classmates, and it was basically this. Just, like, SO MANY slides

    • Hotzilla@sopuli.xyz
      link
      fedilink
      arrow-up
      0
      ·
      edit-2
      2 months ago

      For efficiency you should you GOTO, so you can join trees that end up in same position.

      Like those create your own adventures books.

  • xep@fedia.io
    link
    fedilink
    arrow-up
    0
    ·
    2 months ago

    This is where you’d normally go “there must be a better way…”

  • Lovable Sidekick@lemmy.world
    link
    fedilink
    English
    arrow-up
    0
    ·
    2 months ago

    This reminds me of one of my very first programs, a tic-tac-toe game I wrote in high school. It displayed hardcoded grids of Xs and Os and blanks very similar to what’s shown here. This approach worked because of the much more limited move possibilities. The program could always win if it made the first move, and always win or tie if the human moved first, depending on if the human made mistakes. I wish I still had the code.

      • Lovable Sidekick@lemmy.world
        link
        fedilink
        English
        arrow-up
        0
        ·
        2 months ago

        I’m probably remembering it wrong, it was a long time ago. It definitely always either won or tied but could never lose, because it knew the right responses to every move. No, it didn’t cheat lol.

          • Couldbealeotard@lemmy.world
            link
            fedilink
            English
            arrow-up
            0
            ·
            2 months ago

            There are no invalid locations in tic Tac toe, passing a turn provides no advantage, I suppose you could take extra turns to cheat.

  • Owl@mander.xyz
    link
    fedilink
    arrow-up
    0
    ·
    edit-2
    2 months ago

    This is supposed to be a joke but sadly a lot of beginner tutorials on coding Tic-Tac-Toe teach this

  • the16bitgamer@programming.dev
    link
    fedilink
    arrow-up
    0
    ·
    edit-2
    2 months ago

    They are doing it dumb. You can text output chess but you just need to keep track of where the pieces are in code, then when you are ready to output, place the characters. Saves so much time. /s