Public Group

# How to pack game resources?

This topic is 2117 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

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 on other sites
For this kind of thing I use PhysFS. Basically everything goes in a zip file that I rename with a different extension.

##### Share on other sites

For this kind of thing I use PhysFS. Basically everything goes in a zip file that I rename with a different extension.

I wanted to use PhysFS too initially, but I've been struggling forever to install it. could you check out this question? It would help a lot if an actual PhysFS user would pop a good answer for me. Thanks in advance Edited by Octav

##### Share on other sites
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.

##### Share on other sites

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.

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 on other sites
You would not if you have the references right.

LoadFromFile("Images\\myImage.jpg")
LoadFromFile("Sounds\\mySound.wav")
etc.

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

##### Share on other sites
As mentioned just organize them into files then set your references correctly in your code to point to the different folders like sounds,images etc..

##### Share on other sites
As mentioned just organize them into files then set your references correctly in your code to point to the different folders like sounds,images etc..

1. 1
2. 2
Rutin
22
3. 3
JoeJ
18
4. 4
5. 5

• 17
• 40
• 23
• 13
• 13
• ### Forum Statistics

• Total Topics
631726
• Total Posts
3001910
×