Page 1 of 1

New Feature: .tar support

Posted: 14 Sep 2007 22:30
by TrueBrain
As of tomorrows nightly you can enjoy .tar support in OpenTTD.

This feature is mostly meant for 32bpp PNGs and to allow GRF-packs, like for the coop guys. It works very simple:

Put which ever files you want packed in a dir, say: data_pack/, and put in it the dir-structure you need, like if it was in the root of your data/ dir. Remember: it doesn't matter WHERE the .tar file is, it works relative from the data/ dir. So putting it in data/tar/ doesn't change a thing.

Run, in the data_pack dir: tar cf ../data/mypack.tar *

Now start OpenTTD, and your files will be loaded like they were unpacked in the data/ dir. Simple, efficient, easy ;) Of course you need *nix, or mingw to use 'tar' like that, but you get the point ;)

Compression formats will _not_ be supported, as they are very slow. '.tar' is a container format, meaning it stores the files byte-by-byte (without any compression) in the file, keeping a header with the data.

If there are any bugs or questions, feel free to post them here.

Re: New Feature: .tar support

Posted: 15 Sep 2007 05:59
by Wolf01
for windows users: there is also 7zip which allow to create tar archives, simply select the folder/files you want -> right click on the selection -> 7z add to archive and select tar from the dropdown list (you can chose between zip, 7z and tar)

Re: New Feature: .tar support

Posted: 15 Sep 2007 09:09
by thgergo
I have a question, will newgrf actions be supported in tar files someday?

Re: New Feature: .tar support

Posted: 15 Sep 2007 09:16
by Wolf01
you already can use a newgrf with the actions and the external sprites in 32bpp in the folder with the same name of the newgrf (but the grf should have the sprites in it, i think is enough a blank sprite, as you can only replace them with the external ones in 32bpp, like the standard ones)

Re: New Feature: .tar support

Posted: 15 Sep 2007 13:31
by glx
Wolf01 wrote:for windows users: there is also 7zip which allow to create tar archives, simply select the folder/files you want -> right click on the selection -> 7z add to archive and select tar from the dropdown list (you can chose between zip, 7z and tar)
For now, tar files are not supported by windows versions of openttd.
And tar made using 7z are not "valid" tar for openttd.

Re: New Feature: .tar support

Posted: 15 Sep 2007 16:02
by TrueBrain
And the time flies when you are having fun: the latest revision now also support 'old' tar format (read: 7z tars), and has a bunch of small fixes (like win32 support) :)

Re: New Feature: .tar support

Posted: 15 Sep 2007 16:41
by dannys9
Still doesn't work for me an win32. The files get loaded correctly but are not used in game.

I've placed a file gui.tar into the data directory.
Within the tar I've files like "sprites\trg1r\680.png"
I run openttd -b 32bpp-anim.

So, what am I doing wrong? I tried it with 7-zip and GNU tar 1.15.1 files.

Re: New Feature: .tar support

Posted: 15 Sep 2007 17:09
by glx
Using a >=r11116 win32 build?

Re: New Feature: .tar support

Posted: 15 Sep 2007 17:25
by dannys9
Erm, of course...

Re: New Feature: .tar support

Posted: 15 Sep 2007 17:26
by TrueBrain
Please post your .tar, so we can take a look at it.

Re: New Feature: .tar support

Posted: 15 Sep 2007 17:31
by dannys9
It's attached...

edit: File removed, it was meant for testing purposes only and a collection I just made for myself

Re: New Feature: .tar support

Posted: 15 Sep 2007 17:37
by TrueBrain
Okay, tnx. This is a Windows only problem, as on Linux it runs just fine. We are looking into this problem. Tnx for the report!

Re: New Feature: .tar support

Posted: 16 Sep 2007 08:28
by Grolsch
"Gui.tar" :lol:

Re: New Feature: .tar support

Posted: 16 Sep 2007 18:11
by TrueBrain
In tomorrows nightly (and latest revision) the .tar problems for Windows are fixed.

Re: New Feature: .tar support

Posted: 16 Sep 2007 18:26
by dannys9
Now everything's fine :D Tnx TrueLight!