this post was submitted on 03 Aug 2023
505 points (100.0% liked)

196

16744 readers
1847 users here now

Be sure to follow the rule before you head out.

Rule: You must post before you leave.

^other^ ^rules^

founded 2 years ago
MODERATORS
 
you are viewing a single comment's thread
view the rest of the comments
[–] OmegaMouse 9 points 1 year ago (7 children)

As a layperson, what's valuable about the source code in particular?

[–] SSUPII@sopuli.xyz 35 points 1 year ago (1 children)

Archival, making mods, making custom modern builds of the game for new hardware, improving the game...

So much potential to keep a game alive instead of locking it on some arcaic hardware nobody has spare parts for.

[–] const_void@lemmy.ml 15 points 1 year ago (1 children)

Not just new hardware, but other operating systems like Linux.

[–] SSUPII@sopuli.xyz 6 points 1 year ago* (last edited 1 year ago)

A native port from the ongoing efforts to decompile Donkey Kong 64 and Perfect Dark would be so sick!

[–] TragicNotCute@lemmy.world 31 points 1 year ago

It would let you recreate or change any aspect of the game you wanted. Much more control than mods would generally allow for.

[–] wander1236@sh.itjust.works 7 points 1 year ago* (last edited 1 year ago)

If the game is something people really want to play, having the source code makes it a lot easier for someone to make the game work on modern operating systems, and possible to port it to ones it didn't originally support.

[–] deadcade@lemmy.deadca.de 4 points 1 year ago (1 children)

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 3 points 1 year ago (1 children)

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@lemmy.blahaj.zone 5 points 1 year ago* (last edited 1 year ago) (1 children)

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

[–] AzzyDev@beehaw.org 1 points 1 year 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++.

[–] GlitchyDigiBun@lemmy.dbzer0.com 3 points 1 year ago* (last edited 1 year ago) (1 children)

So, especially with PC games, software is compiled using an IDE/language and runtime environments. That last part is why games stop running on newer versions of windows, and it's especially why older games can't just "be ported" to consoles, mac, etc. Once you compile a program, it's like etching that program into a stone called an executable/extension(DLL). If you want your program to run on anything other than the old compatible hardware using their runtime libraries, you gotta have the OG source code in order to recompile. Blizard North had a liquidation sale way back and the source codes to their projects was in it. They've been scrambling to get it all back to make remakes/remasters.

[–] OmegaMouse 1 points 1 year ago

Thank you for this. The only bit I'm not quite sure on is runtime libraries - would you mind elaborating / explaining what these do?

[–] i_am_hiding@aussie.zone 2 points 1 year ago

Ports? With the source code, it would be relatively trivial to make homebrew ports of the game just about everywhere. A bit like how Doom runs on anything - or more accurately, like how Super Mario 64 runs on a lot more than just the N64.

[–] kogasa@programming.dev 1 points 1 year ago

It could conceivably be used to make a community-run clone of the game. Networking would be an issue. It could also be used as a foundation for new games.