Engine (code) Safety

Community Forums/General Help/Engine (code) Safety

Steve Elliott(Posted 2015) [#1]
Say you've written a games engine that you want to sell, want to keep the code from prying eyes and prevent others making changes - thus causing inconsistency in your system. What's the best way to do it?

Have to say I've no experience of this anti-piracy approach. Perhaps you put the engine routines into a dll...What's to prevent somebody from accessing the routines from C++? Because they know how to pass the required data to the required engine function - and therefore not have to purchase your engine.

Perhaps a pre-compiled header approach is better? The GCC Compiler doesn't spit out machine code here, but seems pretty much gibberish.

Note:
I don't want this thread to turn into a free vs paid for engine debate. Thanks all.


Yasha(Posted 2015) [#2]
Perhaps a pre-compiled header approach is better?


Don't get what you're suggesting here - you either have to distribute machine code, or something that can be compiled to machine code and then be accessed from C++. An intermediate format that's hard to read doesn't help with that; all it does is force people to use the same version of GCC as you (this isn't even a secret, since you have to tell them so they can use it at all).


You cannot stop people from using your engine from C++ (or any language with similar low-level operations). Literally can't be done. Once code is on the other person's machine, they can inspect it and manipulate it and so on to whatever end they like. There is no technological way to prevent this. I have to restate this for emphasis: there is no way to prevent someone looking at code once it's on their machine. The difference between closed- and open-source binaries is not in what the user can do, but strictly in what you've given them permission to do - they can do anything they want, in either case.

Which is why the way you stop people using your product without permission is with a licence agreement, making the permissions on usage explicit, and binding. This is the only strategy that works. If someone redistributes your code without sticking to the agreement (either making changes, or pirating), you C&D them. If they aren't redistributing the code, there's nothing to worry about (what people do in their own homes is their own business).

If your engine is actually intended more for casual "play-about" users than game developers, then you need to target the unauthorized download sources so the end users come to you; if your engine is intended primarily for developers, then this is a non-issue because only a complete lunatic would release a commercial game using a pirated engine.


RemiD(Posted 2015) [#3]
You could obfuscate the code that you distribute (replace variable names with something which is not understandable, remove indentations, remove spaces (only where they can be removed), make your procedures long and hard to understand or to debug)

But also consider that even for a good programmer it is sometimes difficult to understand another programmer's code, so most users will probably not have the level or the patience to try to understand and to reuse your code... Also most users will probably not care about understanding/reusing your code, they just want to use your engine to make tools/games with it...
Maybe some hackers will, but should you care if it does not impact your image and your sales ? Probably not...


Steve Elliott(Posted 2015) [#4]
lol I think we confused each other a little there Yasha.


you either have to distribute machine code, or something that can be compiled to machine code and then be accessed from C++



From a purely engine point of view, using C++ you would compile your program and access the engine with an include. But I'm not wanting to supply the engine in a pure C++ form - because it can easily be manipulated...Just looking at alternatives.

Licence agreement...ok.


most users will probably not care about understanding/reusing your code, they just want to use your engine to make tools/games with it...



Interesting statement RemiD.