Sign in to follow this  

PAK Files

This topic is 4812 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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!

Share this post


Link to post
Share on other sites
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?

Share this post


Link to post
Share on other sites
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 ?

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites

This topic is 4812 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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

Sign in to follow this