Jump to content
  • 0
canditw

Compact Option in GRF Editor

Question

Hi, I was wondering if anyone has used the Compact Option under File > Save advanced > Compact (redirect indexes) inside the GRF Editor? I noticed that it did significantly reduce my file size but was wondering if theres any issues with such a large compression from 200mb to 130mb. Are there any side effects to it? 

Share this post


Link to post
Share on other sites

3 answers to this question

Recommended Posts

  • 0

Here's what the modes do:

  • File > Save > Somewhat similar to what a patcher would do; it will write the new files in empty spaces or compact the data to make space and then write the data in there. If you only add new files, it will append to the GRF and not repack anything. If there's too much fragmentation it will repack instead though.
  • File > Save advanced > Defragment > This is the common repack option you'd expect. It used to be the default saving method of GRFE for a long time and it simply writes a new GRF by packing the entries' data one next to the other. This is rather quick and should result in no 'dead space' within the GRF.
  • File > Repack (recompress) > This option decompresses and then recompresses all the files in your GRF (and packs the data one next to the other, so no space left either). This is mostly useful for repacking a GRF with the LZMA compression and vice versa.
  • File > Compact (redirect indexes) > This option removes duplicate data and redirect the indexes in the file table to the same data instead. This is very useful for palette GRFs since most of them are just copies of one another. If you save such a GRF again (using any of the methods above), you will regain your original size of 200 MB. But you can shrink down palettes from ~200 MB down to 5 MB  using such a method and this will not have any impact. Thor Patcher does this as well to compress its content even more.
Edited by Tokeiburu

Share this post


Link to post
Share on other sites
  • 0

That's actually called repacking, it will reduce the grf size, because while patching, some files might get reduced size(and remaining memory location filled by NUL or allocate bigger memory location)

So doing compact save(repack), it properly arranges the file and deletes off unused locations.

 

In short, there isn't any side effects

Share this post


Link to post
Share on other sites
  • 0

Not sure about other patchers out there, but generally (ex. the official patcher) new patches are appended to the archive and the item entry is updated to point to that location, so the data in original location becomes "waste".

 

GRF before patching:

[            ][     mapnametable.txt     ][              ]
GRF after patching:
[            ][no longer referenced=waste][              ][new mapnametable.txt]
GRF after repacking (in theory, as file order may change during repacking):
[            ][              ][new mapnametable.txt]

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.