luxtorpeda-dev / luxtorpeda

Steam Play compatibility tool to run games using native Linux engines

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

On usage of reverse engineering for creating open-source game engines

neuromancer opened this issue · comments

Hi,

I wanted to create an issue to discuss in detail the following statement:

reverse-engineering projects are not supported for this project, where the original executable is used to create the engine, instead of creating it in a more open source manner.

If you are not interested in this discussion, feel free to close it.

The idea here is simple: most, if not all the reimplementations are based on reverse engineering (with the notable exception of source ports such the Doom ones). A few notable examples:

  • ScummVM developers relies heavily on tools like IDA or Ghidra, so most of their engines used reverse engineering.
  • Rigel engine (Duke Nukem 2):

There was never any source code released for the original game, so this project is based on reverse engineering (specifically, disassembly of the original binaries). See Duke2Reconstructed for a complete reconstruction of the original code.

  • BStone (Black Stone games): this engine was clearly based on decompiled assembly code, where it was replaced with C code (but it is still easy to see that the original code was assembly one, here you can see an example of it)

And there are many many others.

Some other engines relied on leaked source code, which is, IMHO, more legally questionable:

  • Most of Blood reimplementations relied on Blood Alpha leaked code in some way or another.
  • Dominatrix (SiN reimplementation): this is directly based on a source code leaked, that is why it will never be open-source.

If you are looking to avoid reimplementations that rely on the usage of decompiled code directly (e.g. where they directly recompiled part of the source code, which end in the final executable), then it will be good know specify that. In particular how much original assembly code is acceptable (most of the projects will state how much original code is still left to replace, such as dethrace). On the other hand, there is the question of the legality of replacing every assembly line, similar to the Ship of Theseus.

If you still want to allow projects with decompiled assembly, but avoid compromising the legality of the other packages, one option is to use a different package repository (e.g. github.com/luxtorpeda-dev/packages-re). In that case, if GitHub decides to take down the certain game engine, it will not affect other packages.

One of the main things with this was to avoid projects that use decompiled code directly, so reverse engineering the game is ok, but not just using the decompiled code directly, which alot of these projects do. I realize it's difficult to have a perfect rule for this. One of the things that I've looked at in the past is longevity, mainly that if the project has been around for quite a few years, without getting DCMA, like with what happened with re3.

Games with leaked source code can also be tricky. One of the things that helps with Dominatrix is that I'm not actually hosting it, just providing a link to a download, although i wasn't aware of how it was created.

I've thought about having another repository for certain decompiled games, at the moment that'd mainly add a bunch of maintenance costs, in terms of duplicated workflows and the like.

The other problem with alot of those projects is they don't really have a clear license, like MIT or GPL, so it makes it alot harder to determine if I can actually distribute. That's only mostly related to it being a decompiled project, but shows another issue with those sort of projects.

What sort of engines in this manner are appealing to you?

It makes sense to avoid duplicating the workflow with another repository, and on top of that, I will also suggest to avoid Rockstar games (e.g. GTA) and Nintendo (e.g. Mario 64 or Zelda) reimplementations, since the companies are too litigious to risk all the project. In any case, this is preliminary list of engines that could be nice to add is:

  • Deathrace (Carmagedon I)
  • OpenJKDF2 (Jedi Knight Dark Forces 2)
  • TRX1 (Tomb Raider I) -> No assembly
  • Devilution (Diablo 1 and 2) -> No assembly
  • fallout1-ce and fallout2-ce (Fallout 1 and 2) -> No assembly

There are a few more, I can update this list later.

Games from Sega should be fine. They are very tolerant of fan projects and often encourage them, like when they hired the author of Retro Engine, originally a fan game engine recreation for Sonic 1-3, to make Sonic Mania.

Dominatrix (SiN reimplementation): this is directly based on a source code leaked, that is why it will never be open-source.

I'm just curious, do you know anything about this source code? https://github.com/NightDive-Studio/sin-ex-game

I'm not an expert, but I think that's only part of it, not the complete game.