🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

Package files.

Published August 01, 2006
Advertisement
I've got an exciting entry for you guys today ;-)

Over the last few years I've been through several iterations of my custom package format [.pkg]. It acts just like a .zip, or .pak file, and is just used to archive all of my data files into a single file.

There are several reasons for this, obviously this will make theft of my assets a little more difficult, but the main reason is that I'm obligated to not have some of these files just sitting on the hard drive [commercial textures, sounds, etc.]. And this will satisfy that requirement.

Today I pretty much rewrote the format [it's pretty simple], and I'm much happier with the results. Before I would just load the entire package into memory right off the hard drive, which was fine for packages with < 200 files. But now I just load the package's header information and use that data to seek to the file's start inside the package. I'm working with over 1500 assets in the game right now [not including configs, text, etc. that still sit on the HD in their respective folders...obviously so the end user can modify them easily].

I've also created a simple utility to help me manage the package files. Until today I had to handle that type of stuff through the in-game console which was a slightly annoying. Also I would find myself in a race before each build deadline to resolve the issues that would ALWAYS come up, dealing with the package system. Hopefully that will be a thing of the past, as the new format is much more robust.

All asset loading code [textures, models, shaders, sounds, etc.] goes through the CPackage class. The package class first tries to load "File X" off the hard-drive. If it can't be found, it then searches the main package for the file, and if it still can't be found...it gives an error.

Screenshots of the simple package utility I created...




Some code showing how I seek to each file...instead of just loading the whole 350MB file into memory. I stand by the C style file functions. It's just so much easier for me. Though most of my college professors always bitched at me for using printf and not cout, etc. I just prefer the old C style with most things...and by using a style I'm more comfortable with I'm saving myself precious debug time later :-)

bool CPackage::ExportFile(char *pFileName, char *pDestFileName){ FILE *pFileStream; FILE *pPackageStream; void *pFileData = NULL; int Index = 0; //Open package & Destination output file. if((pFileStream = fopen(pDestFileName, "wb")) == NULL || (pPackageStream = fopen(m_FileName, "rb")) == NULL) {      //Couldn't open the package or create destination file...  //Insert error message here.  return false; } //end of if else {  //Get numerical index of desired file, inside package.  Index = GetFileIndex(pFileName);   //Determine offset into the package.  //NOTE: This could be computed and stored in a look-up table.  //      It's not really worth it though, since this only gets   //      executed at load time.    long int FileOffset = 0;  for(int i = 0; i < Index; i++)   FileOffset+=m_PackageElements->m_FileSize;    //Seek to start of desired file [in package].  fseek(pPackageStream, m_EndOfPackageHeader+FileOffset, SEEK_SET);  //Allocate temp memory for file.  pFileData = malloc(m_PackageElements[Index]->m_FileSize);  if(pFileData)  {   //Read file from package.   fread(pFileData, m_PackageElements[Index]->m_FileSize, 1, pPackageStream);   //Write destination file.   fwrite(pFileData, m_PackageElements[Index]->m_FileSize, 1, pFileStream);     //Delete temp memory.   free(pFileData);  } //end of if } // end of else //Close file streams fclose(pFileStream); fclose(pPackageStream); return true;} // end of ExportFile function


For all you masochistic types out there here is a list of all the assets currently stored in the main package file...This is what I deal with every day. I can't believe the game has over 1500 data files associated with it. [and still growing].

Package 'pack001.pkg' CONTENTS [1506 files]----------------------------------------------------- 0: [ ActorImposters.bmp ] [786488 Bytes] 1: [ Alley1.bmp ] [786488 Bytes] 2: [ BigBuildings1.tga ] [1048620 Bytes] 3: [ BlankOverlay.bmp ] [196664 Bytes] 4: [ Bridge.bmp ] [786488 Bytes] 5: [ Buildings1.bmp ] [786488 Bytes] 6: [ Waves.dds ] [43832 Bytes] 7: [ WaterBump.bmp ] [196664 Bytes] 8: [ Waterbump2.bmp ] [786488 Bytes] 9: [ FactoryA.tga ] [773201 Bytes] 10: [ Buildings1_window.bmp ] [196664 Bytes] 11: [ Default_window.bmp ] [824 Bytes] 12: [ Buildings2_window.bmp ] [196664 Bytes] 13: [ Buildings2.bmp ] [786488 Bytes] 14: [ Buildings3.bmp ] [786488 Bytes] 15: [ Buildings4.bmp ] [786488 Bytes] 16: [ Buildings5.bmp ] [786488 Bytes] 17: [ Default_window_white.bmp ] [824 Bytes] 18: [ Buildings4_window.bmp ] [196664 Bytes] 19: [ Buildings5_window.bmp ] [786488 Bytes] 20: [ Buildings3_window.bmp ] [196664 Bytes] 21: [ Clouds.tga ] [1048620 Bytes] 22: [ Divider.bmp ] [786488 Bytes] 23: [ Skyscrapers1.tga ] [1048620 Bytes] 24: [ Explosion1.bmp ] [786486 Bytes] 25: [ Extras.tga ] [1048620 Bytes] 26: [ Jail.tga ] [676822 Bytes] 27: [ GasStation.bmp ] [786488 Bytes] 28: [ WaterImposter.bmp ] [786488 Bytes] 29: [ CellPhone.tga ] [16298 Bytes] 30: [ PlazaDirt.tga ] [197156 Bytes] 31: [ Thumbs.db ] [349184 Bytes] 32: [ ArrowTex.tga ] [1667 Bytes] 33: [ Textures14.bmp ] [786488 Bytes] 34: [ Interior1.bmp ] [786488 Bytes] 35: [ Interior2.bmp ] [786488 Bytes] 36: [ Interior3.bmp ] [786488 Bytes] 37: [ Interior4.bmp ] [786488 Bytes] 38: [ Intersection1.bmp ] [786488 Bytes] 39: [ Intersection2.bmp ] [786488 Bytes] 40: [ Bridge.tga ] [754348 Bytes] 41: [ Tree2.tga ] [702646 Bytes] 42: [ TreeBase.tga ] [262188 Bytes] 43: [ Bark2.tga ] [196714 Bytes] 44: [ LensFlares.tga ] [262188 Bytes] 45: [ Skyscrapers1_window.bmp ] [196664 Bytes] 46: [ FactoryA_window.bmp ] [196664 Bytes] 47: [ GasStation_window.bmp ] [196664 Bytes] 48: [ ServiceStation_window.bmp ] [196664 Bytes] 49: [ BigBuildings1_window.bmp ] [196664 Bytes] 50: [ Road3_window.bmp ] [49208 Bytes] 51: [ MiniMap.bmp ] [30056 Bytes] 52: [ RPGRound.tga ] [12332 Bytes] 53: [ 40mmRound.tga ] [6173 Bytes] 54: [ Road3.bmp ] [786488 Bytes] 55: [ Overlay.bmp ] [786488 Bytes] 56: [ ParkingLot.bmp ] [786488 Bytes] 57: [ Interior5.bmp ] [786488 Bytes] 58: [ Reference.bmp ] [60 Bytes] 59: [ Road-3.bmp ] [786488 Bytes] 60: [ Road1.bmp ] [786488 Bytes] 61: [ Road2.bmp ] [786488 Bytes] 62: [ Textures14_window.bmp ] [786488 Bytes] 63: [ SportSUV1_Luminance.tga ] [49196 Bytes] 64: [ PoliceCar_Luminance.tga ] [49196 Bytes] 65: [ Taxi_Luminance.tga ] [2401 Bytes] 66: [ MuscleCar1_Luminance.tga ] [49196 Bytes] 67: [ MuscleCar2_Luminance.tga ] [1825 Bytes] 68: [ Slider.bmp ] [824 Bytes] 69: [ SpeechBubble.bmp ] [196664 Bytes] 70: [ Sunset.bmp ] [49208 Bytes] 71: [ ServiceStation.tga ] [1048620 Bytes] 72: [ Ticker.bmp ] [24632 Bytes] 73: [ Trees2.bmp ] [786488 Bytes] 74: [ Water.bmp ] [196664 Bytes] 75: [ WaterStuff.bmp ] [786488 Bytes] 76: [ Italian_B.tga ] [786476 Bytes] 77: [ Italian_A.tga ] [786476 Bytes] 78: [ Civ_Male_A.tga ] [786476 Bytes] 79: [ Black_C.tga ] [786476 Bytes] 80: [ Black_B.tga ] [786476 Bytes] 81: [ Black_A.tga ] [786476 Bytes] 82: [ Glass.tga ] [65580 Bytes] 83: [ Park1.bmp ] [786488 Bytes] 84: [ Dumpster.tga ] [393260 Bytes] 85: [ Barricade.tga ] [196652 Bytes] 86: [ WoodPallet.tga ] [131116 Bytes] 87: [ WoodCrate.tga ] [196652 Bytes] 88: [ BoxA.tga ] [196652 Bytes] 89: [ BoxB.tga ] [196652 Bytes] 90: [ TrafficCone.tga ] [98348 Bytes] 91: [ PlasticDrumA.tga ] [196652 Bytes] 92: [ PlasticDrumB.tga ] [196652 Bytes] 93: [ TireB.tga ] [262188 Bytes] 94: [ TireA.tga ] [262188 Bytes] 95: [ NewsPaperA.tga ] [196652 Bytes] 96: [ PostalBox.tga ] [262188 Bytes] 97: [ TrashCan.tga ] [262188 Bytes] 98: [ PhoneBooth.tga ] [196652 Bytes] 99: [ ParkingMeter.tga ] [98348 Bytes] 100: [ Bark1.tga ] [196652 Bytes] 101: [ FenceWireA.tga ] [65580 Bytes] 102: [ FenceLinkA.tga ] [65580 Bytes] 103: [ FenceEdgeA.tga ] [32812 Bytes] 104: [ FenceA.tga ] [262188 Bytes] 105: [ NewsPaperC.tga ] [196652 Bytes] 106: [ NewsPaperB.tga ] [196652 Bytes] 107: [ Mp5.tga ] [52452 Bytes] 108: [ TestTexture.tga ] [2454073 Bytes] 109: [ Tree1.tga ] [736839 Bytes] 110: [ SportSUV2_Luminance.tga ] [1626 Bytes] 111: [ LeadSled2_Luminance.tga ] [1400 Bytes] 112: [ Policeman.tga ] [863302 Bytes] 113: [ RPG.tga ] [93232 Bytes] 114: [ AK47.tga ] [34378 Bytes] 115: [ Knife.tga ] [48236 Bytes] 116: [ Colt45.tga ] [44005 Bytes] 117: [ Uzi.tga ] [196652 Bytes] 118: [ Glock.tga ] [196652 Bytes] 119: [ 38Revolver.tga ] [25916 Bytes] 120: [ Cleaver.tga ] [35808 Bytes] 121: [ Magnum.tga ] [97172 Bytes] 122: [ Spas.tga ] [75727 Bytes] 123: [ Dirt.tga ] [641878 Bytes] 124: [ Trailer.tga ] [660562 Bytes] 125: [ Dirt_Tile.tga ] [788498 Bytes] 126: [ Dumpster_Big.tga ] [704942 Bytes] 127: [ BrickStack.tga ] [170579 Bytes] 128: [ Generator.tga ] [165256 Bytes] 129: [ ConcretePipe.tga ] [779887 Bytes] 130: [ Civ_Female_A.tga ] [512137 Bytes] 131: [ LeadSled1_Luminance.tga ] [1400 Bytes] 132: [ Tecnec2_Luminance.tga ] [49196 Bytes] 133: [ Stairs.tga ] [196942 Bytes] 134: [ Transformer.tga ] [196652 Bytes] 135: [ Spool.tga ] [196652 Bytes] 136: [ M24.tga ] [98348 Bytes] 137: [ Plaza_Tile.tga ] [788439 Bytes] 138: [ Latin_B.tga ] [786476 Bytes] 139: [ Latin_A.tga ] [786476 Bytes] 140: [ Tecnec1_Luminance.tga ] [49196 Bytes] 141: [ House1Brick.tga ] [45291 Bytes] 142: [ House1Roof.tga ] [103879 Bytes] 143: [ Grass_Tile.tga ] [788509 Bytes] 144: [ GW_EM_G.tga ] [1048620 Bytes] 145: [ GW_EM_S.tga ] [1048620 Bytes] 146: [ ArmouredTruck.tga ] [1048620 Bytes] 147: [ GW_SUX_C.tga ] [1048620 Bytes] 148: [ GW_SUX_S.tga ] [1048620 Bytes] 149: [ Hammer2_Luminance.tga ] [2697 Bytes] 150: [ Hammer1_Luminance.tga ] [49196 Bytes] 151: [ LuxSUV2_Luminance.tga ] [2018 Bytes] 152: [ LeadSled_B.tga ] [1048620 Bytes] 153: [ LeadSled_P.tga ] [1048620 Bytes] 154: [ GW_SUV_B.tga ] [1048620 Bytes] 155: [ GW_SUV_M.tga ] [1048620 Bytes] 156: [ MuscleCar_Y.tga ] [1048620 Bytes] 157: [ MuscleCar_B.tga ] [1048620 Bytes] 158: [ LuxSUV1_Luminance.tga ] [49196 Bytes] 159: [ PoliceCar.tga ] [840009 Bytes] 160: [ Van1_Luminance.tga ] [49196 Bytes] 161: [ ArmouredCar_Luminance.tga ] [49196 Bytes] 162: [ GW_TSR_T.tga ] [1048620 Bytes] 163: [ GW_TSR_R.tga ] [1048620 Bytes] 164: [ GW_SPD_Y.tga ] [1048620 Bytes] 165: [ GW_SPD_R.tga ] [1048620 Bytes] 166: [ GW_SLN_G.tga ] [1048620 Bytes] 167: [ GW_SLN_B.tga ] [1048620 Bytes] 168: [ GW_SBX_Y.tga ] [1048620 Bytes] 169: [ GW_SBX_G.tga ] [1048620 Bytes] 170: [ Van2_Luminance.tga ] [1691 Bytes] 171: [ EuroCruiser1_Luminance.tga ] [49196 Bytes] 172: [ EuroCruiser2_Luminance.tga ] [2067 Bytes] 173: [ YellowCab.tga ] [936984 Bytes] 174: [ SportSUV_S.tga ] [1048620 Bytes] 175: [ SportSUV_Y.tga ] [1048620 Bytes] 176: [ GW_PT_B.tga ] [1048620 Bytes] 177: [ GW_PT_R.tga ] [1048620 Bytes] 178: [ EuroMuscle1_Luminance.tga ] [49196 Bytes] 179: [ EuroMuscle2_Luminance.tga ] [2687 Bytes] 180: [ Civ_Male_B.tga ] [630651 Bytes] 181: [ Truck1_Luminance.tga ] [2501 Bytes] 182: [ Truck2_Luminance.tga ] [2501 Bytes] 183: [ SBXTurbo1_Luminance.tga ] [49196 Bytes] 184: [ SBXTurbo2_Luminance.tga ] [49196 Bytes] 185: [ Civ_Male_C.tga ] [609106 Bytes] 186: [ Saloon1_Luminance.tga ] [49196 Bytes] 187: [ Saloon2_Luminance.tga ] [2265 Bytes] 188: [ Civ_Male_D.tga ] [626092 Bytes] 189: [ Speedster1_Luminance.tga ] [49196 Bytes] 190: [ Speedster2_Luminance.tga ] [2060 Bytes] 191: [ Civ_Female_D.tga ] [511420 Bytes] 192: [ GW_DV_B.tga ] [1048620 Bytes] 193: [ GW_DV_W.tga ] [1048620 Bytes] 194: [ Buildings6.bmp ] [786488 Bytes] 195: [ Buildings6_window.bmp ] [49208 Bytes] 196: [ OutputCube.dds ] [1572992 Bytes] 197: [ NightCube.dds ] [6291584 Bytes] 198: [ Reference.dds ] [393344 Bytes] 199: [ NewSkyscraper1.tga ] [1048620 Bytes] 200: [ NewSkyscraper2.tga ] [1048620 Bytes] 201: [ NewSkyscraper4.tga ] [551973 Bytes] 202: [ CubeMap.dds ] [1572992 Bytes] 203: [ NewSkyscraper3.tga ] [588693 Bytes] 204: [ Money.tga ] [40092 Bytes] 205: [ Bat.tga ] [12459 Bytes] 206: [ Civ_Female_B.tga ] [511347 Bytes] 207: [ Civ_Female_C.tga ] [489816 Bytes] 208: [ SelectionBox.tga ] [262188 Bytes] 209: [ GW_EC_W.tga ] [1048620 Bytes] 210: [ GW_EC_B.tga ] [1048620 Bytes] 211: [ House1Base.tga ] [786476 Bytes] 212: [ FogOfWar.tga ] [24620 Bytes] 213: [ Particles.tga ] [1048620 Bytes] 214: [ Grenade.tga ] [98348 Bytes] 215: [ Bomb.tga ] [129219 Bytes] 216: [ GrenadeLauncher.tga ] [43191 Bytes] 217: [ M4.tga ] [80882 Bytes] 218: [ Sig552.tga ] [85973 Bytes] 219: [ Beretta.tga ] [50623 Bytes] 220: [ Sig220.tga ] [60884 Bytes] 221: [ WaltherP22.tga ] [66106 Bytes] 222: [ DesertEagle.tga ] [42702 Bytes] 223: [ Uzi2.tga ] [125682 Bytes] 224: [ Combined.ms3d ] [741510 Bytes] 225: [ vAK47.tga ] [130281 Bytes] 226: [ FlagTexture.tga ] [114477 Bytes] 227: [ CharacterBlood.tga ] [490514 Bytes] 228: [ bloodtest.tga ] [686169 Bytes] 229: [ Vest.tga ] [126270 Bytes] 230: [ ocean6.dds ] [393344 Bytes] 231: [ ocean6.bmp ] [393272 Bytes] 232: [ oceangradient.bmp ] [24888 Bytes] 233: [ Waterbump3.bmp ] [263224 Bytes] 234: [ Sprites.tga ] [420969 Bytes] 235: [ depreciated-------Sprites.bmp ] [786488 Bytes] 236: [ Baggie.tga ] [139724 Bytes] 237: [ caust0.bmp ] [12342 Bytes] 238: [ caust1.bmp ] [12342 Bytes] 239: [ caust10.bmp ] [12342 Bytes] 240: [ caust11.bmp ] [12342 Bytes] 241: [ caust12.bmp ] [12342 Bytes] 242: [ caust13.bmp ] [12342 Bytes] 243: [ caust14.bmp ] [12342 Bytes] 244: [ caust15.bmp ] [12342 Bytes] 245: [ caust16.bmp ] [12342 Bytes] 246: [ caust17.bmp ] [12342 Bytes] 247: [ caust18.bmp ] [12342 Bytes] 248: [ caust19.bmp ] [12342 Bytes] 249: [ caust2.bmp ] [12342 Bytes] 250: [ caust20.bmp ] [12342 Bytes] 251: [ caust21.bmp ] [12342 Bytes] 252: [ caust22.bmp ] [12342 Bytes] 253: [ caust23.bmp ] [12342 Bytes] 254: [ caust24.bmp ] [12342 Bytes] 255: [ caust25.bmp ] [12342 Bytes] 256: [ caust26.bmp ] [12342 Bytes] 257: [ caust27.bmp ] [12342 Bytes] 258: [ caust28.bmp ] [12342 Bytes] 259: [ caust29.bmp ] [12342 Bytes] 260: [ caust3.bmp ] [12342 Bytes] 261: [ caust30.bmp ] [12342 Bytes] 262: [ caust31.bmp ] [12342 Bytes] 263: [ caust4.bmp ] [12342 Bytes] 264: [ caust5.bmp ] [12342 Bytes] 265: [ caust6.bmp ] [12342 Bytes] 266: [ caust7.bmp ] [12342 Bytes] 267: [ caust8.bmp ] [12342 Bytes] 268: [ caust9.bmp ] [12342 Bytes] 269: [ Thumbs.db ] [78848 Bytes] 270: [ Background1.bmp ] [196664 Bytes] 271: [ Background2.bmp ] [196664 Bytes] 272: [ Background3.bmp ] [196664 Bytes] 273: [ Background4.bmp ] [196664 Bytes] 274: [ Background5.bmp ] [196664 Bytes] 275: [ Background6.bmp ] [196664 Bytes] 276: [ BlackSelect.tga ] [262188 Bytes] 277: [ BootIcon.tga ] [4140 Bytes] 278: [ BuildingImages.bmp ] [786488 Bytes] 279: [ Crosshair.bmp ] [3128 Bytes] 280: [ Desktop1.bmp ] [196664 Bytes] 281: [ Desktop2.bmp ] [196664 Bytes] 282: [ Desktop3.bmp ] [196664 Bytes] 283: [ Desktop4.bmp ] [196664 Bytes] 284: [ EmptyMapTex.bmp ] [49208 Bytes] 285: [ GameOver.bmp ] [786488 Bytes] 286: [ Health.bmp ] [3128 Bytes] 287: [ IllegalBusiness.bmp ] [196664 Bytes] 288: [ ItalianSelect.tga ] [262188 Bytes] 289: [ LatinoSelect.tga ] [262188 Bytes] 290: [ Message.bmp ] [3128 Bytes] 291: [ Test.bmp ] [786488 Bytes] 292: [ Victory.bmp ] [786488 Bytes] 293: [ Window1.bmp ] [393272 Bytes] 294: [ Window3.bmp ] [393272 Bytes] 295: [ Window4.bmp ] [393272 Bytes] 296: [ Commands.bmp ] [49208 Bytes] 297: [ Mp3Playback.bmp ] [49208 Bytes] 298: [ Mp3Playback.tga ] [29262 Bytes] 299: [ Mp3PlaybackOver.tga ] [29037 Bytes] 300: [ SpeechBubble.bmp ] [196664 Bytes] 301: [ ActorIcon.tga ] [477 Bytes] 302: [ old-Window2.bmp ] [393272 Bytes] 303: [ Window2.bmp ] [393272 Bytes] 304: [ GUI_Overlays.tga ] [1048620 Bytes] 305: [ RadialMenuBase.tga ] [57428 Bytes] 306: [ RadialMenu.tga ] [49455 Bytes] 307: [ CircleCrosshair.bmp ] [3128 Bytes] 308: [ FlagIcon.tga ] [4140 Bytes] 309: [ ArCarIcon.tga ] [4140 Bytes] 310: [ SpeechBubbleR.bmp ] [196664 Bytes] 311: [ SpeechBubbleL.bmp ] [196664 Bytes] 312: [ Cocaine.tga ] [8370 Bytes] 313: [ Crack.tga ] [7884 Bytes] 314: [ Meth.tga ] [6314 Bytes] 315: [ Scale.tga ] [79059 Bytes] 316: [ Weed.tga ] [16428 Bytes] 317: [ Opium.tga ] [16428 Bytes] 318: [ Heroin.tga ] [9702 Bytes] 319: [ Ecstasy.tga ] [16428 Bytes] 320: [ ItemSprites.bmp ] [786488 Bytes] 321: [ Diplomacy.tga ] [50468 Bytes] 322: [ Tabs.tga ] [10548 Bytes] 323: [ OrderMarker.tga ] [55953 Bytes] 324: [ Bitmaps.bmp ] [786488 Bytes] 325: [ StreetSign.tga ] [19331 Bytes] 326: [ Tiles.bmp ] [786488 Bytes] 327: [ OrderRadius.tga ] [1048620 Bytes] 328: [ MiniMapFOV.tga ] [16428 Bytes] 329: [ Sniper.tga ] [1048620 Bytes] 330: [ OrderOverlay.tga ] [3788 Bytes] 331: [ Thumbs.db ] [7168 Bytes] 332: [ Window5.bmp ] [393272 Bytes] 333: [ ProgressBar.psd ] [305245 Bytes] 334: [ ProgressBar.tga ] [93820 Bytes] 335: [ QuickStatus.tga ] [48760 Bytes] 336: [ ResourceOverlay.tga ] [5917 Bytes] 337: [ Loading.bmp ] [196664 Bytes] 338: [ Thumbs.db ] [5632 Bytes] 339: [ -Spotlight.tga ] [142368 Bytes] 340: [ Thumbs.db ] [5632 Bytes] 341: [ Headlights2.tga ] [351778 Bytes] 342: [ Headlights.tga ] [786476 Bytes] 343: [ Spotlight.tga ] [262188 Bytes] 344: [ Clouds.tga ] [1048620 Bytes] 345: [ Sun.tga ] [1048620 Bytes] 346: [ CloudColor.tga ] [16428 Bytes] 347: [ FogColor.tga ] [16428 Bytes] 348: [ Sky.tga ] [262188 Bytes] 349: [ FallbackAmbientColor.tga ] [16428 Bytes] 350: [ AmbientColor.tga ] [16428 Bytes] 351: [ Thumbs.db ] [6144 Bytes] 352: [ ActorMarker.ms3d ] [750 Bytes] 353: [ ActorShadow.ms3d ] [750 Bytes] 354: [ ArmouredCar_Damage.ms3d ] [155997 Bytes] 355: [ ArmouredCar_High.ms3d ] [120543 Bytes] 356: [ ArmouredCar_Low.ms3d ] [22239 Bytes] 357: [ Bird1.ms3d ] [12875 Bytes] 358: [ BlackA.ms3d ] [106200 Bytes] 359: [ BlackA_Ragdoll.ms3d ] [104061 Bytes] 360: [ BlackB.ms3d ] [110013 Bytes] 361: [ BlackC.ms3d ] [111483 Bytes] 362: [ Camera.ms3d ] [1530 Bytes] 363: [ CivFemale1.ms3d ] [110193 Bytes] 364: [ CivFemale2.ms3d ] [110193 Bytes] 365: [ CivFemale3.ms3d ] [110193 Bytes] 366: [ CivFemale4.ms3d ] [110193 Bytes] 367: [ CivMale1.ms3d ] [104355 Bytes] 368: [ CivMale2.ms3d ] [104355 Bytes] 369: [ CivMale3.ms3d ] [104355 Bytes] 370: [ CivMale4.ms3d ] [104355 Bytes] 371: [ EuroCruiser1_Damage.ms3d ] [123174 Bytes] 372: [ EuroCruiser1_High.ms3d ] [125829 Bytes] 373: [ EuroCruiser1_Low.ms3d ] [16398 Bytes] 374: [ EuroCruiser2_Damage.ms3d ] [152940 Bytes] 375: [ EuroCruiser2_High.ms3d ] [162537 Bytes] 376: [ EuroCruiser2_Low.ms3d ] [16398 Bytes] 377: [ EuroMuscle1_Damage.ms3d ] [129504 Bytes] 378: [ EuroMuscle1_High.ms3d ] [131289 Bytes] 379: [ EuroMuscle1_Low.ms3d ] [18330 Bytes] 380: [ EuroMuscle2_Damage.ms3d ] [157932 Bytes] 381: [ EuroMuscle2_High.ms3d ] [167709 Bytes] 382: [ EuroMuscle2_Low.ms3d ] [18330 Bytes] 383: [ Hammer1_Damage.ms3d ] [142719 Bytes] 384: [ Hammer1_High.ms3d ] [141105 Bytes] 385: [ Hammer1_Low.ms3d ] [15645 Bytes] 386: [ Hammer2_Damage.ms3d ] [170472 Bytes] 387: [ Hammer2_High.ms3d ] [180525 Bytes] 388: [ Hammer2_Low.ms3d ] [15645 Bytes] 389: [ Headlights.ms3d ] [3564 Bytes] 390: [ Helicopter1.ms3d ] [89953 Bytes] 391: [ ItalianA.ms3d ] [109140 Bytes] 392: [ ItalianB.ms3d ] [106020 Bytes] 393: [ ItalianC.ms3d ] [104511 Bytes] 394: [ LatinoA.ms3d ] [122220 Bytes] 395: [ LatinoB.ms3d ] [108930 Bytes] 396: [ LatinoC.ms3d ] [103572 Bytes] 397: [ LeadSled1_Damage.ms3d ] [109539 Bytes] 398: [ LeadSled1_High.ms3d ] [110376 Bytes] 399: [ LeadSled1_Low.ms3d ] [16158 Bytes] 400: [ LeadSled2_Damage.ms3d ] [159996 Bytes] 401: [ LeadSled2_High.ms3d ] [151113 Bytes] 402: [ LeadSled2_Low.ms3d ] [17523 Bytes] 403: [ LuxSUV1_Damage.ms3d ] [133287 Bytes] 404: [ LuxSUV1_High.ms3d ] [134589 Bytes] 405: [ LuxSUV1_Low.ms3d ] [25992 Bytes] 406: [ LuxSUV2_Damage.ms3d ] [161139 Bytes] 407: [ LuxSUV2_High.ms3d ] [171249 Bytes] 408: [ LuxSUV2_Low.ms3d ] [25992 Bytes] 409: [ MuscleCar1_Damage.ms3d ] [104505 Bytes] 410: [ MuscleCar1_High.ms3d ] [100047 Bytes] 411: [ MuscleCar1_Low.ms3d ] [16296 Bytes] 412: [ MuscleCar2_Damage.ms3d ] [156780 Bytes] 413: [ MuscleCar2_High.ms3d ] [157617 Bytes] 414: [ MuscleCar2_Low.ms3d ] [16296 Bytes] 415: [ NightSkybox.ms3d ] [3154 Bytes] 416: [ PoliceCar_Damage.ms3d ] [98700 Bytes] 417: [ PoliceCar_High.ms3d ] [108348 Bytes] 418: [ PoliceCar_Low.ms3d ] [23565 Bytes] 419: [ Policeman.ms3d ] [125478 Bytes] 420: [ Ragdoll.ms3d ] [104061 Bytes] 421: [ Ragdoll2.ms3d ] [86589 Bytes] 422: [ ReferenceBox.ms3d ] [1510 Bytes] 423: [ ReferenceSphere.ms3d ] [10096 Bytes] 424: [ Saloon1_Damage.ms3d ] [141192 Bytes] 425: [ Saloon1_High.ms3d ] [143253 Bytes] 426: [ Saloon1_Low.ms3d ] [18870 Bytes] 427: [ Saloon2_Damage.ms3d ] [169074 Bytes] 428: [ Saloon2_High.ms3d ] [179127 Bytes] 429: [ Saloon2_Low.ms3d ] [18870 Bytes] 430: [ SBXTurbo1_Damage.ms3d ] [143142 Bytes] 431: [ SBXTurbo1_High.ms3d ] [141813 Bytes] 432: [ SBXTurbo1_Low.ms3d ] [13335 Bytes] 433: [ SBXTurbo2_Damage.ms3d ] [171954 Bytes] 434: [ SBXTurbo2_High.ms3d ] [178617 Bytes] 435: [ SBXTurbo2_Low.ms3d ] [13335 Bytes] 436: [ Siren.ms3d ] [2037 Bytes] 437: [ Skydome.ms3d ] [21853 Bytes] 438: [ Speedster1_Damage.ms3d ] [123147 Bytes] 439: [ Speedster1_High.ms3d ] [130332 Bytes] 440: [ Speedster1_Low.ms3d ] [19065 Bytes] 441: [ Speedster2_Damage.ms3d ] [156870 Bytes] 442: [ Speedster2_High.ms3d ] [166410 Bytes] 443: [ Speedster2_Low.ms3d ] [19065 Bytes] 444: [ SportSUV1_Damage.ms3d ] [97209 Bytes] 445: [ SportSUV1_High.ms3d ] [106095 Bytes] 446: [ SportSUV1_Low.ms3d ] [25992 Bytes] 447: [ SportSUV2_Damage.ms3d ] [130140 Bytes] 448: [ SportSUV2_High.ms3d ] [125073 Bytes] 449: [ SportSUV2_Low.ms3d ] [25992 Bytes] 450: [ Sprite.ms3d ] [730 Bytes] 451: [ Taxi_Damage.ms3d ] [94368 Bytes] 452: [ Taxi_High.ms3d ] [95598 Bytes] 453: [ Taxi_Low.ms3d ] [21990 Bytes] 454: [ Tecnec1_Damage.ms3d ] [138558 Bytes] 455: [ Tecnec1_High.ms3d ] [139989 Bytes] 456: [ Tecnec1_Low.ms3d ] [13365 Bytes] 457: [ Tecnec2_Damage.ms3d ] [167592 Bytes] 458: [ Tecnec2_High.ms3d ] [177015 Bytes] 459: [ Tecnec2_Low.ms3d ] [13365 Bytes] 460: [ Truck1_Damage.ms3d ] [135015 Bytes] 461: [ Truck1_High.ms3d ] [136071 Bytes] 462: [ Truck1_Low.ms3d ] [14475 Bytes] 463: [ Truck2_Damage.ms3d ] [163740 Bytes] 464: [ Truck2_High.ms3d ] [172788 Bytes] 465: [ Truck2_Low.ms3d ] [14475 Bytes] 466: [ Van1_Damage.ms3d ] [133887 Bytes] 467: [ Van1_High.ms3d ] [135573 Bytes] 468: [ Van1_Low.ms3d ] [13890 Bytes] 469: [ Van2_Damage.ms3d ] [159450 Bytes] 470: [ Van2_High.ms3d ] [169128 Bytes] 471: [ Van2_Low.ms3d ] [13890 Bytes] 472: [ VehicleShadow.ms3d ] [954 Bytes] 473: [ TestMesh.x ] [846959 Bytes] 474: [ EuroCruiser_Wheel.ms3d ] [8157 Bytes] 475: [ PoliceCar_High2.ms3d ] [149529 Bytes] 476: [ Taxi2_High.ms3d ] [142827 Bytes] 477: [ SelectionBox.x ] [12989 Bytes] 478: [ TerritoryRadius.ms3d ] [12276 Bytes] 479: [ DrugBag.ms3d ] [7171 Bytes] 480: [ Arrow.x ] [3052 Bytes] 481: [ OrderRadius.ms3d ] [750 Bytes] 482: [ TerritoryRadiusOriginal.ms3d ] [17157 Bytes] 483: [ CollectionRadius.ms3d ] [17157 Bytes] 484: [ PoliceCar_Col.ms3d ] [16905 Bytes] 485: [ ArmouredCar_Col.ms3d ] [11943 Bytes] 486: [ EuroCruiser1_Col.ms3d ] [9738 Bytes] 487: [ EuroCruiser2_Col.ms3d ] [9738 Bytes] 488: [ EuroMuscle1_Col.ms3d ] [11670 Bytes] 489: [ EuroMuscle2_Col.ms3d ] [11670 Bytes] 490: [ Hammer1_Col.ms3d ] [11505 Bytes] 491: [ Hammer2_Col.ms3d ] [11505 Bytes] 492: [ LeadSled1_Col.ms3d ] [11436 Bytes] 493: [ LeadSled2_Col.ms3d ] [12801 Bytes] 494: [ LuxSUV1_Col.ms3d ] [19332 Bytes] 495: [ LuxSUV2_Col.ms3d ] [19332 Bytes] 496: [ MuscleCar1_Col.ms3d ] [9636 Bytes] 497: [ MuscleCar2_Col.ms3d ] [9636 Bytes] 498: [ Saloon1_Col.ms3d ] [12210 Bytes] 499: [ Saloon2_Col.ms3d ] [12210 Bytes] 500: [ SBXTurbo1_Col.ms3d ] [9255 Bytes] 501: [ SBXTurbo2_Col.ms3d ] [9255 Bytes] 502: [ Speedster1_Col.ms3d ] [12405 Bytes] 503: [ Speedster2_Col.ms3d ] [12405 Bytes] 504: [ SportSUV1_Col.ms3d ] [19332 Bytes] 505: [ SportSUV2_Col.ms3d ] [19332 Bytes] 506: [ Taxi_Col.ms3d ] [15330 Bytes] 507: [ Tecnec1_Col.ms3d ] [9285 Bytes] 508: [ Tecnec2_Col.ms3d ] [9285 Bytes] 509: [ Truck1_Col.ms3d ] [10395 Bytes] 510: [ Truck2_Col.ms3d ] [10395 Bytes] 511: [ Van1_Col.ms3d ] [9750 Bytes] 512: [ Van2_Col.ms3d ] [9750 Bytes] 513: [ 3x3ref.ms3d ] [3582 Bytes] 514: [ Alley1.ms3d ] [1158 Bytes] 515: [ backup.ms3d ] [14410 Bytes] 516: [ Bank.ms3d ] [136514 Bytes] 517: [ Bankbackup.ms3d ] [67542 Bytes] 518: [ BuildingOverlay.ms3d ] [1470 Bytes] 519: [ BuildingShadow.ms3d ] [1470 Bytes] 520: [ BuildingShadow2.ms3d ] [1470 Bytes] 521: [ Curve1.ms3d ] [28831 Bytes] 522: [ Empty.ms3d ] [510 Bytes] 523: [ GasStation.ms3d ] [137876 Bytes] 524: [ GasStationbackup.ms3d ] [108410 Bytes] 525: [ good-Tile3.ms3d ] [37254 Bytes] 526: [ HD.ms3d ] [7054 Bytes] 527: [ InteriorShoes.ms3d ] [7308 Bytes] 528: [ InteriorTemp.ms3d ] [5208 Bytes] 529: [ Lightmap.ms3d ] [27117 Bytes] 530: [ old-watertile.ms3d ] [990 Bytes] 531: [ Overpass.ms3d ] [228852 Bytes] 532: [ Park1.ms3d ] [136902 Bytes] 533: [ StreetLight.ms3d ] [2874 Bytes] 534: [ temp.ms3d ] [119262 Bytes] 535: [ TerritoryOverlay.ms3d ] [4718 Bytes] 536: [ TerritoryOverlay2.ms3d ] [5421 Bytes] 537: [ TerritoryOverlay3.ms3d ] [1470 Bytes] 538: [ test.3ds ] [39151 Bytes] 539: [ Tile1.ms3d ] [1230 Bytes] 540: [ Tile10.ms3d ] [76652 Bytes] 541: [ Tile11.ms3d ] [76532 Bytes] 542: [ Tile12.ms3d ] [5631 Bytes] 543: [ Tile13.ms3d ] [7086 Bytes] 544: [ Tile14.ms3d ] [4970 Bytes] 545: [ Tile15.ms3d ] [20583 Bytes] 546: [ Tile16.ms3d ] [17361 Bytes] 547: [ Tile17.ms3d ] [1236 Bytes] 548: [ Tile18.ms3d ] [2349 Bytes] 549: [ Tile19.ms3d ] [41057 Bytes] 550: [ Tile2.ms3d ] [17502 Bytes] 551: [ Tile20.ms3d ] [41057 Bytes] 552: [ Tile21.ms3d ] [186083 Bytes] 553: [ Tile22.ms3d ] [194651 Bytes] 554: [ Tile23.ms3d ] [2558 Bytes] 555: [ Tile24.ms3d ] [1802


Previous Entry Update
0 likes 6 comments

Comments

ildave1
Oblivion will own your time for awhile. ;) Better tame that damn monster.

Wow, the development of this packaging asset is off the wall. Outstanding work on putting it together.

Keep up the great work as usual!

Regards,
-Dave
August 02, 2006 12:07 AM
Gaheris
I always want to code up some nice resource managing scheme but I always succeed in preventing myself from doing it, because I know I would over engineer it.
Kudos to you for creating a relatively simple, but robust one.
August 02, 2006 03:02 AM
MarijnStevens
Strange, I also made a console app lately:
  static void Main(string[] args)
        {
            string text = "";
            int megabyte = 0;

            using (StreamReader sr = new StreamReader(args[0])) {
                text = sr.ReadToEnd();
            }
            string[] lines = text.Split('\r','\n');
            
            foreach (string line in lines)
            {
                try
                {
                    string[] word = line.Split(' ');
                    megabyte += Convert.ToInt32(word[5].Remove(0, 1));
                }
                catch { }             
            }
            Console.WriteLine("Total bytes: {0}", megabyte);
            megabyte /= 1024;
            Console.WriteLine("Total Megabyte: {0}", megabyte);
            megabyte /= 1024;
            Console.WriteLine("Total Gigabyte: {0}", megabyte);
         }

and this is the output:
Total bytes: 352644952
Total Megabyte: 344379
Total Gigabyte: 336

Where is my mistake ?

August 04, 2006 01:10 AM
roel
This is the wrong place to ask questions like this. And you should also learn how to formulate your questions if you need help (like: stating what your program is supposed to do and what the actual problem is. nobody likes to read code to figure out what your intention is.). Besides that, a megabyte is 1024^2 bytes, a kilobyte is 1024 bytes. You forgot one divide, and now you are displaying the size in kilobytes as if it were megabytes, and mega for giga.
August 04, 2006 03:50 AM
Rob Loach
Another one to give notice to is PhysFS. [wink]
August 04, 2006 09:24 AM
MarijnStevens
Quote: Original post by roel
This is the wrong place to ask questions like this. And you should also learn how to formulate your questions if you need help (like: stating what your program is supposed to do and what the actual problem is. nobody likes to read code to figure out what your intention is.). Besides that, a megabyte is 1024^2 bytes, a kilobyte is 1024 bytes. You forgot one divide, and now you are displaying the size in kilobytes as if it were megabytes, and mega for giga.


aaah.. thanks. I made this program for that log, because I want to know how many space the game cost on that moment, i found it a bit.. related. Anyway, nice package system, remind me of quake and max payne :)
August 04, 2006 11:18 AM
You must log in to join the conversation.
Don't have a GameDev.net account? Sign up!
Advertisement