Sign in to follow this  
Phil123

External Dependencies and my .exe file

Recommended Posts

I have a C++ large project (well, large relative to everything else I've done) that I eventually will want to give to people to test or try out and whatnot. The only problem is I have several external dependencies (such as .wav files and .txt files) that are required for the program to function properly. I can always include these files and give them to said people in a zip file (in addition to the .exe of course), but I'm wondering if there's an alternative.

So, is there someway to...include these files in the .exe itself? I don't want to simply zip the .wav files and .txt files along with the .exe and hand it over to someone because I don't want the players to be able to mess with the .txt files (which has save info, monster stats, info stats, world map info, etc).

Any input/ideas would be greatly appreciated. (I use the IDE: Microsoft Visual Studio 2010 Professional)

Share this post


Link to post
Share on other sites
Please, do not store them in the .exe. Nobody likes a 80MB executable and it makes upgrading a pain if you ever make patches. Now here's something that you probably won't like to hear, but here goes: you cannot prevent a player from modifying data that is located on his computer, by definition. Even if it is encrypted deep in the bowels of your project's directory structure, hidden in zip files with exotic names, anyone desperate enough will find it. There is no alternative.

That said, you can use some simple tricks to prevent people from easily modifying game files. This could be as simple as storing data in binary format instead of text (this'll deter most non-programmers trying to modify their character's skill points), or applying some basic obfuscation such as XORing every byte in your game files with some constant. You can get crafty but don't go overkill because as I said, no amount of tricks will stop a determined person, so don't worry too much about it. If it bothers you that much, use a simple trick as above to block out 99% of people, and call it a day.

Though I have to ask - if it is a single player game, why don't you want the player to modify his stuff? Maybe he likes to mod the game to make it more interesting, change some textures, make enemies harder, increase respawn rate, etc... why deprive him of that? If he is careful he made backups of the "good" files anyway.

If you are instead worried that the player might delete them by accident, it's probably enough to put them in a "data" folder, nobody deletes those. And add a line in your readme that says "The data folder contains important game files and assets, do not delete". Basically, it's not your fault if the player screws up his installation. Really.

Share this post


Link to post
Share on other sites
Thanks for the response.

[quote]Though I have to ask - if it is a single player game, why don't you want the player to modify his stuff?[/quote]

Mainly for the purposes of learning. I was curious what my options were for this stuff.

[quote]Though I have to ask - if it is a single player game, why don't you want the player to modify his stuff? Maybe he likes to mod the game to make it more interesting, change some textures, make enemies harder, increase respawn rate, etc... why deprive him of that? If he is careful he made backups of the "good" files anyway.[/quote]

Hmm, I think you just convinced me to leave it as is. [img]http://public.gamedev.net//public/style_emoticons/default/biggrin.png[/img]

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