• @deadcade@lemmy.deadca.de
    link
    fedilink
    211 months ago

    The source code of a program is like a recipe and list of ingredients. If you buy a coffee from Starbucks, you get a coffee from Starbucks. You can’t easily change the beans used, the brew temperature, etc. With the recipe, you could brew your own with slight differences, or make coffee from scratch knowing everything that’s in Starbucks coffee. With the source code for a game, you could change/mod anything. FPS unlock mods, ports to other platforms, and much more. You could make your own game, and make it better knowing how some systems work in another game.

    Some games have their source code leaked, in which case it is illegal to own, redistribute, or learn from the code. Although it’ll usually still happen, it’s much more “underground” than games where the source code was reverse engineered. Reverse engineering is like buying a coffee, tasting it, then coming up with your own recipe. Having your own recipe almost exactly identical to the original still allows you to make changes easily, but it’s not illegal, as you wrote it, and are allowed to share your own recipe. Some older titles like Super Mario 64 have been fully reverse engineered, and ported to every possible platform, with multiplayer mods, FPS unlock mods, etc.

    • @OmegaMouse@feddit.uk
      link
      fedilink
      English
      211 months ago

      So the source code gets turned into a .exe (or equivalent) when it gets compiled right? What stops it from being decompiled? Do the developers add in some kind of cipher? Or is it just that working out what the low level code does in the exe is very difficult?

      • ShittyKopper [they/them]
        link
        fedilink
        English
        5
        edit-2
        11 months ago

        in most cases you lose a lot of the information in the source code during the compilation process, making decompilation significantly more difficult.

        there are cases, particularly with newer games that are less “close to the metal”, where decompilation works really well (hell, it’s the reason why minecraft modding is as it is), but for older or more demanding games those kinds of abstractions would often result in less performance, meaning the devs would spend more effort squeezing as much performance out as possible, which was often done by programming in a lower level than games of today

        • Azzy
          link
          fedilink
          English
          111 months ago

          An interesting note on Minecraft specifically, because it runs on Java which is half-compiled and half-interpreted (I guess??), there’s usually much more information within Java applications than those written in C or C++.