How to protect your gamefiles? (sound/images)

Started by
11 comments, last by empirical2 14 years, 4 months ago
Hi Doing an freeware game, but I dont want the user to be able to browse all files such as maps, spritesheets (so they can see all units that is in the game in advance...) and sounds. It totally destroys the suprise and feeling of immersion if you can see all the files... Any easy way to put them into packages or something? I simply want them to be tucked away so the user cannot see them. Just renaming fileextension seems a bit to easy to crack:) I must be able to edit them myself (i guess you make another build that you release...) Any good suggestions? Thanks Erik
Advertisement
Just ZIP them up and rename the ZIP extension. In the end, all resources can be ripped at runtime when your app opens them, so there's no use in trying to prevent the user from manually accessing them.
It's a popular question. A quick search gives some relevant threads, and a better one would probably find more:

1 2 3

The popular opinion is basically summed up as "do something simple", or even "don't bother".
Yes, you can put all your files in 1 file. You could use tar or zip, but here is a good library designed for what you want to do. It can read zip files, 7Z files, Quake and Doom packs, etc. So you can simply put all your artwork in a zip-file or 7zip-file and then you can read the files with PhysicsFS. For example, if you have two zip-files: pack1.zip which contains 'data/song.mp3', and pack2.zip which contains 'data/texture.jpg', you can just register the two zip-files so PhysicsFS can read them, and if you need to load data/texture.jpg at some point, PhysicsFS automatically opens pack2.zip and loads that file.
Most people don't go searching through your gamefiles to look for anything that has something to do with the plot. Just put them in folders, put the game executable in the 'root' folder, so they will start that up first.

If you really want to:
- pack a couple of files in a single file (home-made, zip file, whatever)
- rename the file extensions so they're not easy to interpret
- create some sort of 'codename' for your files, so, instead of: mission1-killguy.mission, mission1-createbase.mission, mission1-defeatsatan.mission, you could do: mis1-submis1.mission, mis1-submis2.mission, mis1-submis3.mission
Couldnt one just put everything in a zip and use a password for it? Then (i dont know really how but) you could load from your game. That would be sufficant protection for me. Can it be done? And i dont mind if someone CAN code a program to extract data, i just want to make it a little less easy.

Erik
No one is going to steal your art.
A lot of older commercial games used to have big folders with all the graphics sitting right there.
After playing literally hundreds of shareware and freeware games in-depth, I've NEVER seen copied graphics at all.

If you're that worried about it though, make them resources inside a dll file.
Quote:Original post by suliman
i just want to make it a little less easy.


Just renaming the file will probably stop 95% of your users from looking at your files. The other 5% won't be stopped even if you stream the content live from your server encrypted with five methods over a secured connection, so you might as well not try. Like 99% of all statistics, these ones were made up on the spot :)

A lot of pople bother to come here and tell me the same thing, just trust me when i say i want to hide it.

1. Would the password-protected zip/rar method work?

2. What do you mean to make the resources into a dll file? How would this work?

Thanks for the help
Erik
Quote:Original post by suliman
A lot of pople bother to come here and tell me the same thing, just trust me when i say i want to hide it.


Why? When you seem not to trust the people here when they say that your time would be better spent making your game better?

Quote:
1. Would the password-protected zip/rar method work?


Define work. Renaming a zip file to .pak or something is enough to deter a good number of the people casually looking for files (which is already a skimpy portion of an average userbase). I imagine the common zip apis will allow passwording, though that in and of itself will deter next to nobody more than just renaming the file.

Nothing you can do can prevent a determined person from writing an app to trivially extract the content you wish to hide. Hell, nothing you're going to be able to do is going to make it beyond trivially difficult for a skilled person from writing an app to trivially extract the content. So in that context of 'work'... no.

This topic is closed to new replies.

Advertisement