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 think the title is quite self-explaining, still this is a big area I think, so let me drop a few words:

I've got a simple experiment game project going, and I want to make sure, that the user isn't messing with the game assets like player skin etc.

In my opinion the best way would be that on production I would merge all the assets into one file and the application would check the hash of that file, so it could detect the corrupted data.

Is this an acceptable practice? There must be sum libraries / applications which are targeting this problem, could you guide me on this?

Project details: unix/linux, c++, sdl

share|improve this question
1  
So, you want to hide or protect resources/assets? –  Miro Oct 21 '12 at 15:08
1  
Yes, both hide and protect, in the sense that hiding is merging into one file and maybe pack/zip it, and protecting is achieved trough hash code controlling. –  burninggramma Oct 21 '12 at 16:01
4  
possible duplicate of How can I protect my save data from casual hacking? –  Josh Petrie Oct 21 '12 at 16:15
3  
I think this is a duplicate because the fundamental techniques are the same, and the "casual hacking" point is relevant because the data is on the end-user's machines and thus can be accessed with enough effort. –  Josh Petrie Oct 21 '12 at 16:16
1  
@JoshPetrie It's not really a question of "enough effort" - since we're talking about games it's more like "no effort". There are general purpose OpenGL and DirectX debuggers that can simply read any texture from graphics memory and save it to disk. If it can be displayed then it can be accessed. Actually, the same tools can modify the images post-loading, so checking the hash isn't a good technique for protection ;) –  Liosan Oct 21 '12 at 18:50

2 Answers 2

up vote 0 down vote accepted

My answer to this question won't be complete, because there is no real good way to achieve what you want.

Assume you would pack all your assets in one zip file and compute the hashes. This leads to the problem that you need to recompile your project if you hardcode your expected hashes. However if you save the hash in another external location, you would need to protect that, too.

One method to protect your assets I often rely on is using PhysicsFS to pack my assets in different packed zip files. In order to protect them, you could use some kind of symmetric encryption to secure your archives. If you do not plan any AAA-game this should be fairly enough to protect everything. But keep in mind, too much encryption etc. won't be useful and eventually decrease performance if you load your assets on-the-fly.

share|improve this answer

Don't make it too easy for hackers by putting each individual image in its own file or whatever, but don't bother with encryption because the determined ones will just break it, and pushing it to slow them down will just slow down your game and its development.

Blizzard's MPQ format has encryption, and it has been cracked.

The big name games tend to use some variation of a well-indexed propietary archive file format with maybe basic compression.

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.