Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

I am working on a small multiplayer game with a whole bunch of scripting components.

I know I can't store my files in plaintext otherwise anyone would be able to change the functionality of core parts of the game.

What is the best way to go about preventing this sort of "hacking?"

Would it just be best to develop the program using the script files then just copy the files into strings that are hardcoded in the program?

share|improve this question
    

1 Answer 1

up vote 3 down vote accepted

If you store the script files on the client, in any form where you can eventually read them on the client, you can't "protect" them. They will always be open to exploitation, even when hard-coded into the game's executable or "encrypted" (as they must be decrypted to run).

You can prevent casual exploration by packing the files in some non-obvious format, but that isn't security against hacking either.

To prevent players from exploiting by altering scripts (or any other data), you have avoid placing trust in the client. Store everything you can on the server, transmitting commands to the clients (for scripts; this is how scripts in Guild Wars 2 work, for example). What you can't do exclusively on the server, make sure to verify on the server at least.

If you are making a peer-to-peer game, this is harder. Typically you'll want to employ "gossip"-based verification, where every connected peer (or some subset at random thereof) verifies actions and the results are compared to ensure they agree. You usually need to tune the heuristics involved to get a good play experience.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.