Sign in to follow this  
ukdeveloper

.pak files

Recommended Posts

Hi, My Pong clone is just about done (other than the dodgy AI in single player mode, it's getting there fast), but at the current time I've got all my files in a folder called /data. They're in their raw form as .bmp and .wav files, which means that people can put in their own files with the same name. However, for my next game, I'd like to try something a little different. In professional games (and also in some of the Showcase entries), people include a file called something like Data.pak, and it includes all the audio, graphics etc. How would I do that myself, and how would I load it and get the data from it? Would I just use fstream and open it as ios::binary, and once it's opened, how do I extract, say, car.bmp from it and load it as a texture surface? I'm using SDL at the moment, but I'm sure the same principles apply for everything. Hope you can help, ukdeveloper.

Share this post


Link to post
Share on other sites
There are a few articles about it but I remember that being the best. You just need to write your own file format similar to the one described there, and then write your own functions to load entries in your pak file into memory so you can use them in your game.

Share this post


Link to post
Share on other sites

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