0
\$\begingroup\$

I know there are similar questions but my question but my question is about taking some files (like png spritesheets, txt data) and put them in one archive file in general.

If I'm correct then I just have to read the files then open a new file with a custom format like ".mytar" than in a specific order write the binary data of the png and txts into it.

I have to specify a header and a "separator" to know where the next file starts.

I'm asking of something like the .wad file in Doom, they contained the sprites, level data all in one.

I didn't find any good tutorial or "guide" about how to design an uncompressed archive.

I know it would be simplier to store it in a "known" file format like .tar instead of creating my own but I want to learn and develop my skills, also I would love to feel that I create that file format :)

I don't know if I'm right...and I'm begging for some help :)

(Sorry if my Englis is a bit wrong... :) )

\$\endgroup\$
  • \$\begingroup\$ What's the question/what is the problem you're encountering? \$\endgroup\$ – Mikael Jun 4 '18 at 10:40
  • \$\begingroup\$ You would need to de-serialize the original files (your jpg's etc...) read it into whatever engine you are using. Within the engine you can make a class with all your jpg's and what not, then serialize this again with a custom extension. Serialize is the key-word here and you should be able to use it toghether with the task you are trying to perform plus the game-engine or what it is you are using to find specific tutorials. \$\endgroup\$ – Dennis Jun 4 '18 at 10:56
  • 1
    \$\begingroup\$ It sounds like you already have a plan: write a header with information about where each file begins/ends, then write each component file in order. Have you had any trouble implementing this plan? What part do you need help with? \$\endgroup\$ – DMGregory Jun 4 '18 at 12:00
  • \$\begingroup\$ A blueprint is a gift and a curse. If you want to do it on your own, do it on your own. You can always ask when you hit a wall. \$\endgroup\$ – Theraot Jun 4 '18 at 14:10
  • \$\begingroup\$ Serialization seems to be a good point for files, thx :) But it's not 100% what I'm looking for. ".wad" files contained the images, sounds, everything about the map in binary format with headers and so on. I think it's a kind of archive like .tar or an uncompressed .zip. So I could say I would like to serialize a group of files into one to store them in one unit then load eg. the level XXA from the XXA.mytar acessing al the images. Theraot: Thanks :) DMGregory: I thought it could be bad thinkink to do that. I'm going tor try it. I ask if I got lost. \$\endgroup\$ – atanii Jun 4 '18 at 17:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.