• Create Account

## How to pack game resources?

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

7 replies to this topic

### #1Octav  Members

Posted 29 September 2012 - 11:05 AM

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.

### #2SiCrane  Moderators

Posted 29 September 2012 - 11:18 AM

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

### #3Octav  Members

Posted 29 September 2012 - 11:49 AM

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, 29 September 2012 - 11:50 AM.

### #4Goran Milovanovic  Members

Posted 29 September 2012 - 01:25 PM

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.

+---------------------------------------------------------------------+

| Game Dev video tutorials  ->   http://www.youtube.com/goranmilovano |
+---------------------------------------------------------------------+

### #5Octav  Members

Posted 29 September 2012 - 01:30 PM

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.

### #6Dragonsoulj  Members

Posted 29 September 2012 - 09:05 PM

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, 29 September 2012 - 09:06 PM.

### #7GameC++Expert93  Members

Posted 29 September 2012 - 10:24 PM

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..

### #8GameC++Expert93  Members

Posted 29 September 2012 - 10:26 PM

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..

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.