PAK Files

Started by
7 comments, last by The Lion King 19 years, 6 months ago
With reference to the article posted here on PAK Files [http://www.gamedev.net/reference/articles/article1991.asp]. The article was really great and I studied it (the source code too) and created a PAK compiler of my own. However, I made a few modifications to the header. Anyway ... when I compiled a folder filled with graphics and sound stuff ... it was created successfully. There were 10 files in total in the directory. When I extracted them ... I faced two problems. 1 - Sometimes lsat two were missing or the same last two files were unaccessible. 2 - Another problem was that I have an image in the folder thats like 1500x1500. Half of it was shown. So ... I tried to test it with the compiler provided by the author ... problem 2 was solved ... however problem 1 still exists. And it sometimes gives error. Something wrong with it or are there a few complications / bugs within it? Please help ... :! I would really love to know if is it me that is doing wrong or there is something I should know that is missing in the article. Thanks!
Advertisement
Impossible to help you unless you tell how you modified the header. Make sure that you are using correct data types and are reading/writing the correct number of bytes to the file. When you compile, make various asserts to ensure that the file is being created successfully.

You say that the last two are missing sometimes. Well, when they are missing, what did you do defferent than when they were not missing? Are you using a cipher value of 2? are you even using the cipher?
everything that was in the tutorial source code is the same. I only modified the header :(

I am using the cipher value of 82.

I didnt made a lot of changes. I increased Sibnature from 6 to 8. And I didn't store the cipher value in the file. I kept in the exe so that only I know what to use.

And overall ... the cipher value is not random from 256 ... I chose 82 and neither the ID is a random. I used one of my owns. And I changed the unique ID from char to DWORD.

Does all that makes any difference ?
Anyone ? It works fine in some cases. Like files with small size ... but file with bigger size ... thats where the compliaction starts :(
Help me, my program crashes when I run it. I click ok and it crashes. I added a few extra buttons here and there, changed some variables, and now it just doesn't work.

Please reply. Thanks.
Do any of the files you are compiling in to the PAK have long filenames? The filename value in the file table entry structure imposes a 30 character limit... if you exceed that I could see problems.
Quote:Original post by __Daedalus__
Do any of the files you are compiling in to the PAK have long filenames? The filename value in the file table entry structure imposes a 30 character limit... if you exceed that I could see problems.

No! The file names are short. I checked for that when I faced the error first time. It works perfectly with small files :( ... the files are in *.png
The only thing I can recommend is to start fresh. Create a small console program that will use the original source to create a pak file, print the results, then read the pak file and print the results. This is how I test stuff before placing it in my engine.

Once its up and running, modify one thing at a time and then run the program again and read the results. When you are done, simply take the pak file code and place it in your engine source. If you have any problems from there, the problem is in your engine's source code.
Thank You Daedalus ... for solving my problem.

I did make a blunder mistake in between and the owner of the PAK File article corrected it.

Thank you.

Points up for him ;)

THANKS AGAIN :)

This topic is closed to new replies.

Advertisement