grfcodec oddities

Discuss, get help with, or post new graphics for TTDPatch and OpenTTD, using the NewGRF system, here. Graphics for plain TTD also acceptable here.

Moderator: Graphics Moderators

Post Reply
iNVERTED
Route Supervisor
Route Supervisor
Posts: 387
Joined: 24 Apr 2005 21:21
Location: Torquay, England
Contact:

grfcodec oddities

Post by iNVERTED »

So I finally got bored of having all but Temperate corrupted by my ancient grf hacks, not to mention OTTD complaining about my grf files being wrong.

So I downloaded the grfcodec utilities and the original grf files. I ran grfdiff originals\trg1r.grf legacy\trg1r.grf (legacy being the folder with my grfs in) and the same for c and t (h and i were unchanged), and ended up with three .grd files... but the thing is, they are 13MB (1), 9MB (c) and 17MB (t), which surely can't be right.

When I used grd2grf, it went painfully slow on 1, and on c, it got stuck at 97%, so I tried to use grfcodec -d trg1r.grf, and it gave an error saying "Not enough input data for decompression".

What am I doing wrong? It's been absolutely ages since I last edited the original grf files so I'm not sure if I'm using the commands right. If anyone else wants to try obtaining newgrfs from my differences, the three changed files are at http://var.projectnanako.com/junk/legacy/ (please don't edit the resultant files, I know there is a lot of corruption in them but I'd rather sort that out myself).

I'd be thankful if someone could help me get the utilities to work or convert the grfs for me.
User avatar
eis_os
TTDPatch Developer
TTDPatch Developer
Posts: 3603
Joined: 07 Mar 2003 13:10
Location: Germany
Contact:

Re: grfcodec oddities

Post by eis_os »

Grdtogrf uses an own decompression routine that seems to fail miserably, your grf file is fundamental broken.

Painfully slow = tries to decode and the result gets bigger and bigger until it won't fit in ram anymore
Stuck = decoding loop

Warning: If you try to decompress or diff a broken file the decoders can create garbage files.
iNVERTED
Route Supervisor
Route Supervisor
Posts: 387
Joined: 24 Apr 2005 21:21
Location: Torquay, England
Contact:

Re: grfcodec oddities

Post by iNVERTED »

Well, I just tried using grfcodec to decode and then re-encode trg1r.grf, and I get the same result on the newly encoded file, except now the grd is even bigger than it was (14MB).

I can read the PCX file though, so I guess I can just manually look for all the changes, but it's odd that even a re-encoded file is apparently broken.
User avatar
planetmaker
OpenTTD Developer
OpenTTD Developer
Posts: 9432
Joined: 07 Nov 2007 22:44
Location: Sol d

Re: grfcodec oddities

Post by planetmaker »

You might want to try whether your attempts work with an unmodified grf.
iNVERTED
Route Supervisor
Route Supervisor
Posts: 387
Joined: 24 Apr 2005 21:21
Location: Torquay, England
Contact:

Re: grfcodec oddities

Post by iNVERTED »

Well if you do that, you get a <1 kB grd file and grfdiff tells you that the file has no differences. I haven't tried running grdtogrf on that file though...
Post Reply

Return to “Graphics Development”

Who is online

Users browsing this forum: No registered users and 9 guests