Jump to content
  • Advertisement
Sign in to follow this  
  • entries
  • comments
  • views

Its a little better.

Sign in to follow this  


Looking back, it makes sence that the data blocks are compressed. I was able to get SharpZipLib to do exactly what I wanted, and in minimal code. Really just a function call to the inflater and deflater, check the return code for errors and all was good.

Extracting a file out of the archive is working great. I decided to move the decompression function into the class that reads and parses the file. I also added a place to store the datablock in the FileItem class. I think this will help when I finish the import routine, because I will need to rewrite the file, I will have to recalculate the offsets. Ok, so that does not really explain why.. but I will have the output routine in the class that has the ArrayList of FileItems, so it can write out the file index, and because the file uses an offset that starts at the end of the index I don't need to calculate it. It should go something like this, item.offset = sum_of_all_previous_items_lengths. The first index always has an offset of 0, this is handy.

Anyways, I'm not much of a writer so I'll just get on to coding today. I hope I can finish the importing this morning.

I came up with a funny question...
When dealing with compressed files that are being read off of a hard disk, is it faster (with modern processors) to read in 9,000 bytes and decompress it in to memory, or read in the uncompressed 900,000 bytes stright in to memory? I know that the HDD is the slowest deice in the system, but 900,000 bytes isn't alot. I do think it is faster to decompress the chunk in memory, but I want to write a feature for this program that will rearchive the file with lower compression, to see if I am wrong. To see if the game actually loads faster because of the reduced compression. Too bad I probally will not be able to actually measure the difference. I can't think of anything other than my wrist watch that will be able to time the length of the loading screens for the game.

Until next time.
Sign in to follow this  


Recommended Comments

There are no comments to display.

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
  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!