Page 1 of 5 123 ... LastLast
Results 1 to 10 of 47

Thread: Pak Files?

  1. #1

    Pak Files?

    Ok, you guys know how some games use .pak files to store all their game resources? From images to sounds... scripts to maps.... Well i was wondering if there's maybe already a way out there to do this with delphi. I'd like to compile all my games content into 1 .pak file and just read all the stuff out of that.
    I have a 2005 CRF 250 so <^>(>&lt<^>
    <br />http://www.gtrpg.com/

  2. #2
    Co-Founder / PGD Elder WILL's Avatar
    Join Date
    Apr 2003
    Location
    Canada
    Posts
    6,107
    Blog Entries
    25

    Pak Files?

    I think your looking at making a game engine. In essence your game executuable will be running the .pak file of yours and all you'd need to do then would be to make tools that create and modify new .pak files.

    I'd reccomend looking into how games like Doom and Quake were designed. Also compression and file and memory stream functions would be of possitive use to you in this.

    I hope that at least has given you some ideas where to look. Sorry I couldn't be more helpful at the moment.
    Jason McMillen
    Pascal Game Development
    Co-Founder





  3. #3

    Pak Files?

    You're looking for resource managament in a game engine . A google search will probably give you some generall ideas on what to do in case you want some in-depth theory on how to write efficient managers with cache etc.

    For a way to pack files in delphi, check out this thread: http://terraqueous.f2o.org/dgdev/viewtopic.php?t=148&

    It's not hard to pack all your files into one file, but it can be hard to do this efficient. I tried searching around a bit, but couldn't find anything special. I believe www.gamedev.net has a few articles on the subject, but I couldn't find them right now. Anyway, I suggest you search around.
    BK - we.create (tm)

  4. #4

    Pak Files?

    Thanks alot guys, i'll have a look. And this IS a game engine im developing
    I have a 2005 CRF 250 so &lt;^&gt;(&gt;&lt&lt;^&gt;
    <br />http://www.gtrpg.com/

  5. #5

    Pak Files?

    I've been searching the internet and google for some information but am coming up short. FileStreams... MemoryStreams... are the weakest link in my coding abilities. So im tryin my best. Alimonster apparently had some kind of example on how to do this, but the download is gone... It was posted over 2 years ago... I wish i could get a hold of that one.

    What information would i need about each file in the header? FileOffset, FileSize, FileName, FileType? And how do i store how many headers i need to read?
    I have a 2005 CRF 250 so &lt;^&gt;(&gt;&lt&lt;^&gt;
    <br />http://www.gtrpg.com/

  6. #6

    Pak Files?

    [quote="xGTx"]I've been searching the internet and google for some information but am coming up short. FileStreams... MemoryStreams... are the weakest ]
    I'll grab the tutorial and code from home tonight (if my floppy disc holds up...) and will try to email it to you tomorrow or on the weekend.
    "All paid jobs absorb and degrade the mind."
    <br />-- Aristotle

  7. #7

    Pak Files?

    I posted this before, maybe I forgot to press submit or something :

    You might want to check out the Package Editor/package loader tool/unit that comes with xcess. It's pretty straightforward and you don't need to use the other xcess components in order to be able to use the package editor and loader.
    Ask me about the xcess game development kit

  8. #8

    Pak Files?

    Would creating a class with data objects in it and using WriteComponentRes be a good way to accomplish this.. Is this how you did it harry hunt? I still wants to see alimonster's way though.
    I have a 2005 CRF 250 so &lt;^&gt;(&gt;&lt&lt;^&gt;
    <br />http://www.gtrpg.com/

  9. #9

    Pak Files?

    I only used WriteComponentRes to save the package-file index because I was too lazy to use records (which would've been the more elegant way of doing it). In that index I store information about the number of files and the size of each file as well as the file names, etc.
    From the file size I can then calculate the position of each file in the package by simply summing up the sizes (Storing an offset in the index table is more effective though).
    Ask me about the xcess game development kit

  10. #10

    Pak Files?

    How do you accomplish reading and writing to a table?
    I have a 2005 CRF 250 so &lt;^&gt;(&gt;&lt&lt;^&gt;
    <br />http://www.gtrpg.com/

Page 1 of 5 123 ... LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •