Storing Game Data in Data File?

Started by
14 comments, last by 0x3a 12 years, 8 months ago
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).
Advertisement
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
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
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
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.
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/

This topic is closed to new replies.

Advertisement