Creating a packed binary representation of a file set?

So, I'm trying to work on my little 3D game. Now I am more or less doing this to learn C #. I was wondering what is the best methodology for packaging assets such as textures / scripts?

Actually, what I was thinking about is:

[header]
[number of records]
[Offset to Record 1 from End of header]
[Offset to Record 2 from end of Record 1]
.
.
[Offset to record N from Record N-1]
[record 1]
[256 bytes represent the filename]
[32 byte size]
[binary data]
[record 2]
.
.

Now I just want it to store simple pictures and text files. I looked around a bit, and the best I really found was an old example of how a crazy piece is stored.

Does anyone have any experience?

+3
source share
5 answers

. , . (, , memmap ), , , .

, .zip,.jar,.pak(quake format) ( ) , ( , ). , , . truezip Java. Apache Commons , , w/.NET( C, ). ZipFS zip .NET, .

, , , DotNetZip

+3

.

SharpZipLib .net. .

+1

, , 32 , 32 !

, , , . (, , ), , , , .

, , - :

[HEADER]
[Miscellaneous header stuff]
[Offset to index from start of file]
[Number of entries in index]
[RECORD 1]
[Asset data]
[RECORD 2]
[Asset data]
.
.
[RECORD N]
[Asset data]
[INDEX]
[ID or filename of asset 1]
[Size of asset 1]
[Offset to asset 1 from start of file]
[Other asset 1 flags or whatever]
[ID or filename of asset 2]
[Size of asset 2]
[Offset to asset 2 from start of file]
[Other asset 2 flags or whatever]
.
.

, ( ), ( ). , - .

, , , . .


: ...

, , , , , . , .

, "TankTexture.png". , :

  • .
  • .
  • .
  • .
  • ( , ).
  • "TankTexture.png".
  • .
  • .
  • , .

, 6-9.

, , . , .

+1

, WAD - . , chunked.
, (, , TOC ..), , , . , , , , , , - , .

32- "flags" TOC, - , , ..

,

0

, - . . , , 3 , , . . , .

, (.. script , ) (, ? . , , .)

, - . , . . , , UNLOAD .

0
source

Source: https://habr.com/ru/post/1717535/


All Articles