Sign in to follow this  
jalex

Do you obfuscate your game code and what are the benefits of that?

Recommended Posts

I have already minified my Javascript code for a 2D game I make, mainly to make it smaller and fit in just one file. I'm now thinking of obfuscating it as well, but started wondering what the purpose of that would be for a game? The game itself does not contain any secret algorithms that need protection, and if someone wants to steal my game and put it on his or hers website then I guess obfuscating the code won't help (unless parts of it are on a server), since it is just to copy the code and uploading all the images and sounds. Also isn't there a risk the game becomes slower if obfuscating it?

How do you do it? Do you obfuscate your code, or do you just let the code be there as it is?

Share this post


Link to post
Share on other sites

Well one thing to consider would be if your game is sitelocked, then obfuscating the code is going to make it much more difficult to remove the site lock.

Obfuscating generally does make the game slower. Not only you end up with more instructions, but you often end up with a program that's harder to optimize at JIT compile time. But if you only obfuscate the high-level logic only and not the low-level (framework) code, than you should be alright in most cases.

Personally I use either my own framework or Wade for my games. The latter comes with a script to auto-obfuscate your games (or at least it did, I'm not sure about newer versions). The framework that you are using may have some feature like that built in.

Share this post


Link to post
Share on other sites
On 11/5/2018 at 12:53 PM, vamos said:

Well one thing to consider would be if your game is sitelocked, then obfuscating the code is going to make it much more difficult to remove the site lock.

Obfuscating generally does make the game slower. Not only you end up with more instructions, but you often end up with a program that's harder to optimize at JIT compile time. But if you only obfuscate the high-level logic only and not the low-level (framework) code, than you should be alright in most cases.

Personally I use either my own framework or Wade for my games. The latter comes with a script to auto-obfuscate your games (or at least it did, I'm not sure about newer versions). The framework that you are using may have some feature like that built in.

Thanks for the answer!

No my game is not sitelocked. I use my own framework, and I managed to obfuscate my code online (some of the sites generated an error), but it is an extra step to do every time I'm updating my game, so I'm considering skipping it.

Share this post


Link to post
Share on other sites

I have a WebGL game that handles encrypted 3D models, and I apply obfuscation on the code part that does the decryption. Yeah I know JavaScript obfuscation is not 100% safe, but at least it is enough to protect such models from being stolen by some script kiddies. Since just a small part of the code is obfuscated, the performance impact is minimal.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.