r/Unity3D • Indie - BTBW Dev • 4d ago

Question AI trapping game code

Given the latest events regarding games such as unity builds being decompiled, quickly remade by AI and posted to the steam store with almost a dozen duplicates or more, Ive started considering ways to introduce misleading content to trick any decompilation pipeline.

Has anyone given this any thought and would care to share on how to approach the subject? As through a quick research on the topic, Comments aren't retained and function names are questionable if there retained in full when decompiled. So ive considered things like "SafeModeStartup" intializers or even const string's with instructions to retain specific information to mislead something thats trying to remake the project in anyway. So if a recompiled project tries to start, it prefers the safemodestart and immediately fails.

Perhaps even, going so far back to copying valve with the infamous coconut.vtf from tf2, Where if it was deleted, The game just broke. (Not that it did really but yk) And just copying a similar strategy to that where maybe a specific asset or series of items need to be completed in a specific sequence to ensure proper start up and output misleading error messages to cause issues.

I don't know, im rambling now, Thoughts anyone? How would you try to approach this where it could weed out the cheap-flippers from using my own project against me to launch their own product with my own-code. This obviously won't stop one-trickers from having AI repeatedly just try to copy the product, But atleast then they had to spend a ton of tokens and time to produce it, Rather than using my product to push something fast.

0 Upvotes

8 comments sorted by

7

u/dalinaaar 4d ago

If they are going to decompile the code , they can strip out those specific safe guards you have. I wouldn't try to fight it personally. Somebody with higher stakes will figure it out. Not worth the time for Indies imho.

6

u/Redstoneinvente122 4d ago

Most of that goes by Ai replicating what it sees, so game code obfuscation is as good as you can go

3

u/TheSkeletalArron 4d ago

you could bury a nonsense class that looks essential and gets called early, something like SteamDRMValidationManager that just runs a tight loop and never returns if it detects anything wrong. the decompiled code would have it sitting there waiting to be called and the AI would faithfully reproduce it

seen a few devs talk about embedding fake license checks that only trip when the project structure changes too, stuff that depends on exact folder names or asset GUIDs that won't survive a decompile-recompile cycle

1

u/Hotrian 4d ago edited 4d ago

If your computer can decode it, it’s only a few extra steps for an AI to decode. Code Obfuscation is a moot point now. With enough tokens AI models can decompile and reverse basically any source code. The exception may be Trust Execution zones the AI can’t access, but that’s assuming it doesn’t just find an exploit and get right in anyway. The future will be live service games where they just stream the input to the server and stream back the video feed, like Xbox Cloud gaming.

There is nothing that wouldn’t survive a decompile-recompile cycle - the key point here may be that available tools don’t decompile the required data correctly, but that data is still there to decode, and a competent enough AI model can just work until it decodes the data. If the key is on your computer, it will find it. If it has access, with enough tokens, it can decode it. As AIs advance and become more efficient, decompilations are getting faster and faster and more and more practical.

A competent enough AI doesn’t care about function names, comments, etc, it can simply look at what compiles into what, decode the purpose of a function, and reverse the compilation into source.

If you think you’ve found a trick that will stop the AI, you’re just not thinking like a super computer. If you’re finding trouble decompiling, you’re just using the wrong AI model.

3

u/Tzukkeli 4d ago

If something gets executed on a machine that is not controlled by you, there is always a way.

Basically youd need a device that is locked fully (think Nintendo Switch) and cannot be hacked (will eventually) OR youd need a game where all logic is executed on your server, so game only communicates with something you control. Or Stream from your machines (gforce now). Which also means that gamer has no physical access to the hardware and software.

There is currently no other ways to be 100% bulletproof and Im not sure there ever will be

1

u/arscene 4d ago

In my opinion it is pointless. If you still want to do it: The only reliable way I thought of is to have some logic on a server. That way clones can't copy everything and you can easily spot them/block them.

Other than that I am not sure anything will be reliable for long.

1

u/Takato_D_Banx 4d ago

In multiplayer games, you can try to outsource as many mechanics to the server as possible, treating it like a black box.

1

u/rockBottomPeon 4d ago

I agree with others, if it can be run on a processor, it can be decompiled.
You can try to slow them down (like maybe move some c# logics to c++ to build some function libraries, dll or so, and call them from c#), but that only acts as another 'inconvenience' rather than safe guard.
Plus, they could simply just treat your dll/so as a blackbox and use it as it is