Sign in to follow this  
Octav

How to pack game resources?

Recommended Posts

Octav    159
I've only recently gotten into game programming, but one thing is bothering me a lot. The way I'm packaging my games is desgusting to say the least, everything is in 1 folder, it's like a file soup.

I want to get this question out there, with hope that a very experienced game developer will supply me with a sollution. What I want to do is, pack all the game assets in 1 file which I can very easily read from and add to. I was thinking of using a ZIP archive for this, or ideally use a .PAK archive where I simply add all my assets and map files there.

How can I do this? If you will suggest a framework/API please also tell me how to use it, I'm a total beginner with library linking and library building, I've never done it.

Share this post


Link to post
Share on other sites
SiCrane    11839
For this kind of thing I use [url=http://icculus.org/physfs/]PhysFS[/url]. Basically everything goes in a zip file that I rename with a different extension.

Share this post


Link to post
Share on other sites
Octav    159
[quote name='SiCrane' timestamp='1348939109' post='4985106']
For this kind of thing I use [url="http://icculus.org/physfs/"]PhysFS[/url]. Basically everything goes in a zip file that I rename with a different extension.
[/quote]
I wanted to use PhysFS too initially, but I've been struggling forever to install it. could you check out [url="http://www.gamedev.net/topic/632008-how-can-i-use-physfs/"]this question[/url]? It would help a lot if an actual PhysFS user would pop a good answer for me. Thanks in advance [img]http://public.gamedev.net//public/style_emoticons/default/smile.png[/img] Edited by Octav

Share this post


Link to post
Share on other sites
Octav    159
[quote name='Goran Milovanovic' timestamp='1348946737' post='4985125']
Why is it necessary to pack everything into a single file? You could simply organize your resources into their appropriate directories. Sounds should be in sounds, images in images, fonts in fonts, etc.
[/quote]

Well first of all I'd have to put the executable where the images are, second of all in an archive they are compressed & organized (fonts in fonts, images in images, etc) second of all because I haven't seen any games except LDW games that leave their resources to the open eye in 10 years of gaming and I simply consider it unprofessional to do so, but then again it's simply my oppinion, a zip file is like a folder structure, it's very organised but instead is cleaner, and the game can be modded just as easy. :)

Share this post


Link to post
Share on other sites
Dragonsoulj    3212
You would not if you have the references right.

[code]LoadFromFile("Images\\myImage.jpg")[/code]
[code]LoadFromFile("Sounds\\mySound.wav")[/code]
etc.

[b]Edit[/b] Lots of games potentially reveal their resources, just in formats you aren't used to seeing. Edited by Dragonsoulj

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