Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

I'm working on a new game, and its related level editor, based on Ogre3D. I was thinking about how i could manage the game files, knowing that Ogre use .mesh files for models, .material for materials/texture information etc... . At first i thought about a common .zip folder decompressed at runtime (the same way Torchlight and Ogre samples do). But this way the game assets become a monolithic archive, loading takes time, and could be difficult to eventually patch them. So, let's say i have a game object named "Cube" i want to load in my program. Going for modularity, what if i create a compressed file (using zlib compression routines) named Cube.extname, containing its sub-files Cube.mesh, Cube.material and so on ? Are there any alternatives or should i stick with compressed objects?

PS: Just to clear things, the answer is unrelated to my program code, at the moment i'm using "resources.cfg" pointing to the OgreSDK media directory.

share|improve this question
add comment

1 Answer

up vote 5 down vote accepted

You can have the assets of the game organized with any structure. Ogre only needs to know a parent directory or more ( this depends if you separate the assets to use on different nivels or to load at different times ), this information is written to the file "resources.cfg".

This is a valid approach, but package the files in a zip archive has some advantages:

  1. It's open format.
  2. The virtual files within a ZIP archive "remember" their relative path.
  3. ZIP archives may be compressed: less space
  4. ZIP archives are modular: useful for localization, for example.

Obviously is faster decompress a large chunk of bytes that multiples small chunks. You should use streaming decompression and use a loading bar at first of a level.

You can see more about Resource Managers at the book:

Title: "Game Engine Architecture"
Author: Jason Gregory
Chapter: 6. Resources and the File System

share|improve this answer
    
Ok, you' ve got a point about the monolithic zip approach, loading all the files at startup is better than loading them at the moment. But what about modding and/or patching? –  Tibor Mar 7 '11 at 14:15
    
Related to modding or modify assets on development, it would be a good approach give these tasks to the editor. Because the editor is the responsible of keep the resources management, the assets not necessarily have to be in a zip file when the editor uses them. You add a new resource on the editor and before to launch the game, it can pack the resources in a zip file. A patch can be a program that unzip the .pak with the assets, do the correct modifications and back to create the zip. –  momboco Mar 7 '11 at 14:33
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.