Skip to main content
GameDev.net gamedev.net
🔒 Locked

Storing Game Data in Data File?

Started by Computercodemonkey Aug 22, 2011 at 8:22 PM 14 replies 3.4k views
Original Post
Computercodemonkey
Computercodemonkey
ok i tried asking on a irc and they went all DRM nazi on me.....

all i want to know is

i want to pack my data files gfx,sound,fonts,etc.. into a single file

what will work with SDL ,image,ttf,mixer that is

1. transparent or nearly so
2. fast
3. memory efficient
4. encryptable
5. not picky about file extensions

apparently this means i hate my un-trust-able users and im a bad DRM nazi in some places.... i hope this isent one of them
Splinter of Chaos
Splinter of Chaos
I suppose the question of your intents is to be expected. For most games, this would make things unnecessary complex since you could otherwise just load the file you need and not even have to deal with this "problem". Or maybe you think this would make it easier to load it all at once? But this also means that if someone liked the music in your game (for an example), they wouldn't be able to copy it. It could only be heard from in your game, when the player is in that specific part where the music is played.

IMO: if it's on the user's computer, the he or she has a right to copy and modify it and hiding it from the user is a violation of their rights. Maybe that's why they went all DRM-people-who-killed-millions-of-ethnic-minorities. (In case you can't tell, i'm a little offended by the casual use of "Nazi" to refer to people one doesn't agree with.)

But it's not anyone's job to pry into why you want to do this.

Why don't you just compress it to a zip file?
Computercodemonkey
Computercodemonkey

(In case you can't tell, i'm a little offended by the casual use of "Nazi" to refer to people one doesn't agree with.)


totaly agree with you it was a quote from the irc. they clled me the DRM Nazi

but my point is im making a commercial game and since im having to pay people for art nd sound i should have the right to lock it up so it doesn't get ripped for people to put in crappy flash games

and yes i know i cant make it totaly inaccessible all im after is a toolkit sdk whatever it wants to be called to be a data manager to keep it as a zip or a rar or a (insert compression format here)
partly to shrink size but mainly to keep the files in 1 place that the users cant fiddle with

and zip would be fine i just need the name of the SDK for it
Splinter of Chaos
Splinter of Chaos
You don't need a System Development Kit to open a zip file.

http://www.google.co...250l493l2-2l2l0

That's not the library, but the first link is an example using SDL and zlib. Not being my specialty or interest, i don't know about encryption or opening a password protected zip. On the other hand, the program 7-zip is open source and you could try and figure out how they do it.

[font="arial, verdana, tahoma, sans-serif"]

but my point is im making a commercial game and since im having to pay people for art nd sound i should have the right to lock it up so it doesn't get ripped for people to put in crappy flash games


[/font]You might not realize it, but that's a political statement. Users have rights too (my political statement). Whatever you payed your artist, Lady Ga Ga's label payed a lot more, but that wouldn't stop me from using an mp3 of hers (for comedic affect, i assure you!) in a free non-profit project that only a few people would see.

The logic you're using is the same that DRM-big cats use all the time: that one use of our product that we don't want is bad so all legitimate uses should be disabled as well. With EA, it's making backup copies, which is perfectly legal, but they fear you might distribute them. You're so concerned that someone might use what you payed for in other games for free that you're entirely ignoring millions of other legitimate and legal uses that users have a right to! The law enforces EA's right to prevent people from making copies of their games by letting them use invasive and destructive software. The law does not enforce the rights of users. Users get very upset when their rights are violated. I'm only giving you this long winded rant so you understand why people are (very rightly so) disturbed. Not to change your opinion.

As for protecting the files from being used in other works: It's called copyright, or preferably creative commons, a more flexible copyright. There's nothing wrong with letting people use those files for personal use. You have to make it legally clear that they can't be used any other way. Even AAA titles like Oblivion and Fallout don't go through any measures to thwart users from copying the art files, but i bet you'd get in trouble if you used their resources in your commercial game.

And don't think that by hiding those files, you don't have to worry about copyright. You have do it either way, you're protected either way, why bother?

(Note: i'm not a good person to take legal advice from. This is more a topic for the business section of the forums.)
Computercodemonkey
Computercodemonkey

You don't need a System Development Kit to open a zip file.

http://www.google.co...250l493l2-2l2l0

That's not the library, but the first link is an example using SDL and zlib. Not being my specialty or interest, i don't know about encryption or opening a password protected zip. On the other hand, the program 7-zip is open source and you could try and figure out how they do it.

[font="arial, verdana, tahoma, sans-serif"][quote name='Computercodemonkey' timestamp='1314049946' post='4852531']
but my point is im making a commercial game and since im having to pay people for art nd sound i should have the right to lock it up so it doesn't get ripped for people to put in crappy flash games


[/font]You might not realize it, but that's a political statement. Users have rights too (my political statement). Whatever you payed your artist, Lady Ga Ga's label payed a lot more, but that wouldn't stop me from using an mp3 of hers (for comedic affect, i assure you!) in a free non-profit project that only a few people would see.

The logic you're using is the same that DRM-big cats use all the time: that one use of our product that we don't want is bad so all legitimate uses should be disabled as well. With EA, it's making backup copies, which is perfectly legal, but they fear you might distribute them. You're so concerned that someone might use what you payed for in other games for free that you're entirely ignoring millions of other legitimate and legal uses that users have a right to! The law enforces EA's right to prevent people from making copies of their games by letting them use invasive and destructive software. The law does not enforce the rights of users. Users get very upset when their rights are violated. I'm only giving you this long winded rant so you understand why people are (very rightly so) disturbed. Not to change your opinion.

As for protecting the files from being used in other works: It's called copyright, or preferably creative commons, a more flexible copyright. There's nothing wrong with letting people use those files for personal use. You have to make it legally clear that they can't be used any other way. Even AAA titles like Oblivion and Fallout don't go through any measures to thwart users from copying the art files, but i bet you'd get in trouble if you used their resources in your commercial game.

And don't think that by hiding those files, you don't have to worry about copyright. You have do it either way, you're protected either way, why bother?

(Note: i'm not a good person to take legal advice from. This is more a topic for the business section of the forums.)
[/quote]

no i thank you for you opinion. i also want the 1 big data file so i can store non static data like game scripts and item values etc etc its more to keep people out of things they shouldent be in as well as making them put forth the effort to take the files if they are going to use them and honestly a simple little game for a group of 5-10 people is not what im concerned about its someone making a lot of money and getting a fancy lawyer and screwing me out of the money i paid the artists for the work they put into the game.

and once the game is more mature and thru few patches (there will be patches im not a fool lol) i planned on opening up the mod api im going to put in for people to make expansions/extra content /ect...
krez
krez
PhysicsFS might help you out here. It allows you to pack up your files in a few different ways (e.g. zip), but also allows you to store files out in the open (and handles it all for you, which is great for development and modding). So you can just have the files laying around in sub-directories during development, and pack them into an archive for release, and allow users to mod the game just by dropping some "updated" files in the right spot while not messing with your originals.

I'm not sure if it handles encryption. It doesn't matter much anyway though, because if your program decrypts anything the key is discoverable, and anybody can rip it out with a bit of work. Then your only choices are to sue them or get over it (whether it actually hurts your business or not).

Are you enough of a DRM Nazi to go after self righteous entitled hippies? Personally I do not buy games that come with stupid evil DRM... but I also don't complain, they just don't get my money. I also do not consider packing files to be invasive DRM.
--- krez ([email="krez_AT_optonline_DOT_net"]krez_AT_optonline_DOT_net[/email])
Computercodemonkey
Computercodemonkey

PhysicsFS might help you out here. It allows you to pack up your files in a few different ways (e.g. zip), but also allows you to store files out in the open (and handles it all for you, which is great for development and modding). So you can just have the files laying around in sub-directories during development, and pack them into an archive for release, and allow users to mod the game just by dropping some "updated" files in the right spot while not messing with your originals.

I'm not sure if it handles encryption. It doesn't matter much anyway though, because if your program decrypts anything the key is discoverable, and anybody can rip it out with a bit of work. Then your only choices are to sue them or get over it (whether it actually hurts your business or not).

Are you enough of a DRM Nazi to go after self righteous entitled hippies? Personally I do not buy games that come with stupid evil DRM... but I also don't complain, they just don't get my money. I also do not consider packing files to be invasive DRM.


thank you for the enlightened outlook and thanks for the info on PhysicsFS

and do you think requiring a serial code is invasive? because that was going to be my "anti-piracy" method
Postie
Postie
Splinter of Chaos, I'd hardly equate the OP's attempt to safeguard the non-licensed use of his game assets to EA or other big software company's DRM. I disagree strongly with the statement you made that anything installed on a user's computer becomes their property and they can do whatever they want with it. If you check most license agreements that come with games, they grant you limited rights to use the software and normally expressly forbid reverse engineering or wholesale ripping and reuse of their assets. There's a certain element of "fair use", for parody and such, but if you manage to make money off it somewhere (even if it just a few ads on a youtube channel), be prepared for a takedown notice or legal action.

When it comes down to it, the law isn't on your side when it comes to taking other people's work without just compensation.

For the game project I'm currently working on, I'm planning to make the majority of the data files readily accessible and modifiable, as I believe the project will be more of a success if I can foster an open community around it.

Edit: oops.. wrong person in title
[size="2"]Currently working on an open world survival RPG - For info check out my Development blog:[size="2"] ByteWrangler
Computercodemonkey
Computercodemonkey


For the game project I'm currently working on, I'm planning to make the majority of the data files readily accessible and modifiable, as I believe the project will be more of a success if I can foster an open community around it.




this is more or less my plan After im sure all the ugly bugs are gone
Splinter of Chaos
Splinter of Chaos

Splinter of Chaos, I'd hardly equate the OP's attempt to safeguard the non-licensed use of his game assets to EA or other big software company's DRM.


mellow.gif That's not what i said at all. I said it that the OP was using the same form of reasoning: I don't want people doing X, so i'll doing something that inadvertently prevents Y and Z. I was merely explaining why i thought it was reasonable that people on the IRC, and possibly others, would be disturbed by the OP's choice. I was not equating the OP and EA, but was relating them. If i came out harsh on the OP, that wasn't my intent and i apologize, but s/he didn't seem offended.

I disagree strongly with the statement you made that anything installed on a user's computer becomes their property and they can do whatever they want with it.[/quote]

You don't have to agree. Besides, i was speaking little of the fact it's installed and more of how the art assets and stuff are actually on the harddrive, and the user should have access, like how hackers certainly will. It being installed is irrelevant. But there's no reason for you to agree, It's just an opinion.

When it comes down to it, the law isn't on your side when it comes to taking other people's work without just compensation.[/quote]

I never said anything to the contrary! I said that there are perfectly legal and legitimate uses of the assets that don't imply stealing someone else's works (in much different words). For example, what if i wanted to make a picture in the game my desktop background? Does that infringe on the developer's ability to make money?

*sigh* I knew i'd have to make a post like this if i said that shit... That post was so directed at me that i wonder why you didn't just PM your list of complaints.
Hodgman
Hodgman
So much silliness. Every game ships it's data in some kind of archive format... so I've no idea why archive formats are a political topic here.

Most commercial games would create their own file system using zlib or the LZMA SDK, but if you don't want to waste time on the details, then you can use an existing solution like PhysFS above (which might internally use zlib IIRC).
Postie
Postie
Splinter of Chaos, the reason I didn't respond in a PM is that it wouldn't add anything to the discussion if it was behind closed doors. My post wasn't intended as a personal attack, I was merely stating my opinion on the matter and attempting to bring an alternate viewpoint to the table.

Hodgman, I'm not sure how it became so political either, however based on the OP's statement that they called him a DRM nazi when he raised the topic on IRC, it seems like a hot topic?

Re: the OP's question, there's always going to be an overhead associated with accessing files that are virtualised in an archive, as there's an index lookup, a possible decompression/decryption phase and the inevitable complexity if there needs to be a writeback mechanism (rewriting the index, adding additional filedata to the end). Though that said, compression/decryption is very fast these days, disk reads are also pretty speedy, so the overall impact is not going to be too severe unless you're using a lot of tiny files imho.

The best way to determine if there will be a performance issue though is to do some benchmarking.
[size="2"]Currently working on an open world survival RPG - For info check out my Development blog:[size="2"] ByteWrangler
Computercodemonkey
Computercodemonkey
more or less my aim is private alpha discounted beta full price retail somewhat like minecraft has done and untill mid-late beta i dont want people fiddling with files until i open up a moding api or more correctly uncover it as well as support things like runtime mod switching etc but the base game needs fully tested and debugged in beta before i open that bit up PhysicsFS would do that excellently from what i can tell down to the part where i simply drop in a file to "enable" modding and its total content would be something like modrun = 1 granted it will most likely also include the mod directory as a listing as well as other data
such as the location of individual mods so they wouldn't necessarily even have to be in the same folder but this is a long way down the road


and Splinter of Chaos
I was offended especially when my indie game is going to cost me upwards of $50k in artist fees (seriously thinking of different artists) as well as royalties
but me raging back at you will provide what? make other people reading the thread think im a childish idiot that thinks capslocking you to death will prove something?
thats why i more or less ignored you and just corrected your supposition that i was slinging the word Nazi around instead of it having been used on me
ive got APIs to investigate and code to comment and debug i dont have time to participate in a forum flame war


Edit: and buy a new damned keyboard this sometimes working >A< key thing is getting old fast and generating a lot of compiler errors
Postie
Postie
The minecraft release model seems pretty good, I've looked at it as a possible way to structure the release of my own project.

If your game becomes popular, (and I wish you good luck in that regard) the community will develop its own ways of accessing the files before your "proper" modding support is in place. If you want to have any measure of control over the way modding happens, you'll want to provide mechanisms for modding to take place early. There's nothing stopping you from refining it over time but if you delay too long there's the potential for community made workarounds or hacks that allow modding to become prevalent, and if you make changes to the codebase that break these 3rd party workarounds you risk alienating users.
[size="2"]Currently working on an open world survival RPG - For info check out my Development blog:[size="2"] ByteWrangler
Splinter of Chaos
Splinter of Chaos
Geese, all i was trying to do was give some background on why the IRC people were upset! But i didn't do it in the right way, so i made my bed and it's time to lie down. I just hope to quench this fire quick so we can stay on-topic and get off this DRM-wannabe discussion. I knew there'd be a little whiplash, but i didn't expect every subsequent post to have something about it. Plus, i haven't had anything to add since my second post, so i'm trying to get out of the discussion, myself.

[font="arial, verdana, tahoma, sans-serif"]

so I've no idea why archive formats are a political topic here.

Data hiding is the political topic. Whether or not one agrees with my opinion. Most people think it isn't because it's the norm. People with GNU influences, especially ones ties to open-source and free software ideologies will feel one way about the issue. [/font]
[font="arial, verdana, tahoma, sans-serif"] [/font][font="arial, verdana, tahoma, sans-serif"]

Splinter of Chaos, the reason I didn't respond in a PM is that it wouldn't add anything to the discussion if it was behind closed doors. My post wasn't intended as a personal attack, I was merely stating my opinion on the matter and attempting to bring an alternate viewpoint to the table.


I see. I respect adding to the conversation. What made me feel that way was that you started your post by saying my name and didn't write anything on-topic until the end. That and the fact i felt victim to a straw man attack.
[/font]
[font="arial, verdana, tahoma, sans-serif"]

and Splinter of Chaos
I was offended especially when my indie game is going to cost me upwards of $50k in artist fees (seriously thinking of different artists) as well as royalties
but me raging back at you will provide what? make other people reading the thread think im a childish idiot that thinks capslocking you to death will prove something?
thats why i more or less ignored you and just corrected your supposition that i was slinging the word Nazi around instead of it having been used on me
ive got APIs to investigate and code to comment and debug i dont have time to participate in a forum flame war


[/font][font="arial, verdana, tahoma, sans-serif"]I'm really sorry to hear that! You should have at least said i offended you, but perhaps it seemed deliberate. You don't have to "rag" on someone to let them know they hurt you. I understood originally that it was the IRC people who said nazi; i was trying to make a comment on them in sympathy. The real crux of my argument was really just the last part, which seemed to have been ignored:[/font][color="#1C2837"]"And don't think that by hiding those files, you don't have to worry about copyright. You have do it either way, you're protected either way, why bother? "

All i was really trying to say is that you need to worry about copyright no matter what. Someone could stream the audio out of your game using a legal and free program and then use it in their game. Or a hacker could decrypt your file. You can make it harder on the hacker, but if it's worth to do, they will. Even EA cannot thwart hackers.

I'm gonna stop watching this discussion and won't dare start any more fires here. Re-reading my second post, the language really was pretty harsh and it really didn't help me state my opinion peacefully. Sorry for upsetting you, Computercodemonkey, and for derailing the discussion, and for not having had much useful to say on it.
0x3a
0x3a
What I've done is read in whatever files I need and output it exactly as it is was in memory. This way I could read it in exactly as I need too. For storing it all together I wrote it all in one file and just kept the offsets hardcoded for every file. Just wrote a small tool to parse all the files into one file straight out of memory. Don't know about efficiency but this was the easiest way to do it quickly without people being able to steal my assets.
If I've helped you in any way please push the reputation button, thanks!

Abstraction is my choice of words.
Portfolio: http://www.0x3a.com/
Blog: http://blog.0x3a.com/

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.