GRDTOGRF:Converts graphic sets in EXE/GRD files to GRF 0.4.1

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

Patchman
Tycoon
Tycoon
Posts: 7575
Joined: 02 Oct 2002 18:57
Location: Ithaca, New York
Contact:

Post by Patchman »

How would that make it unreadable? I'd find it easier to read if a series of sprites that belong together are in the same action A.
User avatar
George
Tycoon
Tycoon
Posts: 4362
Joined: 16 Apr 2003 16:09
Skype: george-vb
Location: Varna, Bulgaria
Contact:

Post by George »

eis_os wrote:Current Status / Feature list:
Coverts exe and grd to grf files,
can convert files that patches more than one file aswell.
Maps the sprite numbers from trg(1)c.grf (arctic) and trg(1)h.grf automaticly to the right sprites, adds a action 7 for climate...
I will write the map data for toyland soon too.
What it doesn't do and aren't planed is that the Action A gets packed so it doesn't write a seperate action a for each sprite.
Maybe I find a easy way to do this...
A little beta testing shouldn't harm, so pm please if you have something (prefered windows stuff) or want to beta test
I'm ready to test it!
Suggestion:
Could it get a parameter - GRFID?
User avatar
eis_os
TTDPatch Developer
TTDPatch Developer
Posts: 3603
Joined: 07 Mar 2003 13:10
Location: Germany
Contact:

Post by eis_os »

My GRF Routine already loads the complete data of one GRD file in memory. So I need to write some lookahead function so it will pack the sprite numbers, and to recalc the right size of sprites written to the file ...

Hmm, GRFID, currently I use a dummy not counted grfid FF FF so all versions of TTDPatch should load it.
This will get a little complicate if there are more than grd file in a diff exe.

I think I could add a option to add a changeable action 8, have to rewrite the option parser than...

Like this -g OE 20
will create action 8 that starts with number 20 and then count up...
Maybe -c and -d for copyright and description string

Screendump of my current version:

Code: Select all

bash-2.05b$ ./grdtogrf.exe EuropeanRoadset_v111DOS.exe
GRDTOGRF version 0.2 - Copyright (C) 2003 by Oskar Eisemuth
Generated from: trg1.grf
Reading GRD Data
Number of Sprites: 183
 100% [=========================]
Writing temporary file grdtogrf.tmp
 100% [=========================]
Flushing Data
Renaming grdtogrf.tmp to EuropeanRoadset_v111DOS.grf

Done
Generated from: trgc.grf
Using mapdata for: trgc
Reading GRD Data
Number of Sprites: 45
 100% [=========================]
Writing temporary file grdtogrf.tmp
 100% [=========================]
Flushing Data
Renaming grdtogrf.tmp to EuropeanRoadset_v111DOS1.grf

Done
Generated from: trgh.grf
Using mapdata for: trgh
Reading GRD Data
Number of Sprites: 82
 100% [=========================]
Writing temporary file grdtogrf.tmp
 100% [=========================]
Flushing Data
Renaming grdtogrf.tmp to EuropeanRoadset_v111DOS2.grf

Done
bash-2.05b$

User avatar
eis_os
TTDPatch Developer
TTDPatch Developer
Posts: 3603
Joined: 07 Mar 2003 13:10
Location: Germany
Contact:

Post by eis_os »

Ok I have made the first public release,
you can find it on my site for ttdpatch. :D
It's the first offical version, don't expect a lot docs, simple try -h as commandline switch.

Version 0.3.1:
map all sprite numbers for the three extra climates
should make a proper climate action

write a GRFID number and/or description & copyright string.
(thats not well done currently, but sometimes it works)

-g OE 1 -i "A Testfile" "no copyright"

packs action A entrys, maybe I will make it as an default option so you can disable it if you like...
TTDPatch dev in retirement ... Search a grf, try Grf Crawler 0.9 - now with even faster details view and new features...
Image
BobXP
Tycoon
Tycoon
Posts: 2720
Joined: 04 May 2003 11:00
Location: Torquay, England
Contact:

Post by BobXP »

-g OE 1 -i "A Testfile" "no copyright"
Er I don't really understand that can you give me an example please? :?

Sounds useful; would be very useful for my maglev-roads (to work both with people using trafficset and with people who aren't)
<!-- End Of Post !-->
Image
User avatar
eis_os
TTDPatch Developer
TTDPatch Developer
Posts: 3603
Joined: 07 Mar 2003 13:10
Location: Germany
Contact:

Post by eis_os »

Have you ever read some action code specifc?
Action 8: Define GRF ID

Data is <08> <version> <grf-id> <description> <copyright>
The <grf-id> is four bytes long, the first two bytes you should use your initials. The next two are versions or project id. -> switch -g <initials> <number> (the number can be given as hex aswell: 0xaabb, beware they will be reversed)
-i fills description and copyright.

If you don't use these switch my tool will write a dummy Action 8 with a description "Created by grdtogrf" and a dummy GRFID
TTDPatch dev in retirement ... Search a grf, try Grf Crawler 0.9 - now with even faster details view and new features...
Image
User avatar
troopper5
Tycoon
Tycoon
Posts: 1480
Joined: 18 Oct 2002 04:56
Location: Oulu, Finland

Post by troopper5 »

After thinking this a little bit, I assume that this isn't useless spamming post...

That is it now possible to convert ALL .exe files that are released this far to .grf files and to be added to newgrf[w].grf file? So you can control what graphics you can use in game?
Prof. Frink
Tycoon
Tycoon
Posts: 3849
Joined: 20 Jan 2003 14:51
Location: Broadstone, Dorset
Contact:

Post by Prof. Frink »

If you use newGRF versions, they'll take up extra sprite memory, however you'll be able to toggle them on/off as you feel.

If there's something you really like, use the GRD/EXE to incorporate into the appropriate file to save sprite memory.

This will be useful for testing new graphics...
User avatar
Hyronymus
Tycoon
Tycoon
Posts: 13233
Joined: 03 Dec 2002 10:36
Location: The Netherlands
Contact:

Post by Hyronymus »

Great tool, Oskar but I have a few question. I copied what you did with my European Roadset and I did get the grf's. I thought well, why not put them in <Dir> newgrf and put them in newgrf.cfg as well. Might work... But it doesn't, it says 'Error opening file...'. Is this becasue TTDPatch has to be told to look for these new files or is it something else?
Second thing is I can't get the -i switch to work. If I place it before the exe to be grf'ed your tool says 'No GRD specified'. Putting it behind it gives me the help screen :( . I bet it is something I do wrong, me and the DOS command line never liked eachother (I'm a GUI-centered person).
Prof. Frink
Tycoon
Tycoon
Posts: 3849
Joined: 20 Jan 2003 14:51
Location: Broadstone, Dorset
Contact:

Post by Prof. Frink »

Maybe Andrex will make a GRD2GRF wizard like GRF wizard...
User avatar
eis_os
TTDPatch Developer
TTDPatch Developer
Posts: 3603
Joined: 07 Mar 2003 13:10
Location: Germany
Contact:

Post by eis_os »

The limit isn't so much trouble ...

A complete action a replacement of a climate would eat around 5000 Sprites, you have 11484.

Since 2.0 beta 5 Changelog:
" - allow 11484 *active* real sprites, and unlimited (I think...) pseudo-sprites or inactive sprites, only available memory is the limit"
You can't use two sets the same time, would be very useless, so I don't think you will get the maximum soon. The only big reason could be memory problems.
Prof. Frink wrote:Maybe Andrex will make a GRD2GRF wizard like GRF wizard...
Read the license..., if he don't hide the copyright message it's ok...
Hyronymus wrote:Great tool, Oskar but I have a few question. I copied what you did with my European Roadset and I did get the grf's. I thought well, why not put them in <Dir> newgrf and put them in newgrf.cfg as well. Might work... But it doesn't, it says 'Error opening file...'. Is this becasue TTDPatch has to be told to look for these new files or is it something else?
Second thing is I can't get the -i switch to work. If I place it before the exe to be grf'ed your tool says 'No GRD specified'. Putting it behind it gives me the help screen :( . I bet it is something I do wrong, me and the DOS command line never liked eachother (I'm a GUI-centered person).
I had no problems with a converted Europeanset but one Depot is screwy -> Dos Palette

Second question: you have to use two parameters like this with quotes:

-i "Description" "Copyright"

Post your exact commandline if it doesn't work...
Ohh and before I forget, tell me which TTDPatch Version you use ...
and relook the filenames:
EuropeanRoadset_v111DOS.grf
I have in my cfg, because it's simple in the main ttd folder.

(The dos version can't use long filenames if I am right)
User avatar
Hyronymus
Tycoon
Tycoon
Posts: 13233
Joined: 03 Dec 2002 10:36
Location: The Netherlands
Contact:

Post by Hyronymus »

Long file names... I'm gonna hit my head against a wall some day.
User avatar
troopper5
Tycoon
Tycoon
Posts: 1480
Joined: 18 Oct 2002 04:56
Location: Oulu, Finland

Post by troopper5 »

Right click -> change name :roll:
Patchman
Tycoon
Tycoon
Posts: 7575
Joined: 02 Oct 2002 18:57
Location: Ithaca, New York
Contact:

Post by Patchman »

eis_os wrote:The limit isn't so much trouble ...

A complete action a replacement of a climate would eat around 5000 Sprites, you have 11484.
The limit doesn't even apply to action A, only action 1 and 5. So all you're limited by is available memory.
User avatar
eis_os
TTDPatch Developer
TTDPatch Developer
Posts: 3603
Joined: 07 Mar 2003 13:10
Location: Germany
Contact:

Post by eis_os »

If you have because of some reasons problems with the produced grf files, don't delete the file! Write as much possible information and send the broken file.

That means:
What EXE file you used (link)
The command line you used
The crashing grf file produced by the tool...
BobXP
Tycoon
Tycoon
Posts: 2720
Joined: 04 May 2003 11:00
Location: Torquay, England
Contact:

Post by BobXP »

I really don't want to send this off topic, but I couldn't help noticing:
Attachments
coincidence.PNG
coincidence.PNG (150.89 KiB) Viewed 748 times
<!-- End Of Post !-->
Image
User avatar
eis_os
TTDPatch Developer
TTDPatch Developer
Posts: 3603
Joined: 07 Mar 2003 13:10
Location: Germany
Contact:

Post by eis_os »

Ohh and it would be nice to get some feedback if you used the tool ...

It's hard to improve if you only hear silence...
User avatar
eis_os
TTDPatch Developer
TTDPatch Developer
Posts: 3603
Joined: 07 Mar 2003 13:10
Location: Germany
Contact:

Post by eis_os »

Don't use -d with sets for other climates or you know what you want.

It will disable the sprite mapping and then these Sprites could break TTD because some special sprites like Font, Recolor Table will be overwritten.
User avatar
troopper5
Tycoon
Tycoon
Posts: 1480
Joined: 18 Oct 2002 04:56
Location: Oulu, Finland

Post by troopper5 »

That's the problem? To this day, I've been thinking that -* command has been needed to convert grfs....

Well, I've already installed new grfs, and I don't think I'm going to reinstall TTD now. Maybe when I get bored to new town grfs... :roll:
User avatar
eis_os
TTDPatch Developer
TTDPatch Developer
Posts: 3603
Joined: 07 Mar 2003 13:10
Location: Germany
Contact:

Post by eis_os »

Reinstalling TTD?

Ok, back to the topic, the next release will possible allow you to:
create grf's from trgi diffs ;)
fine tune the grf id better
write non packed action A codes.

Maybe I will write some short introduction
Post Reply

Return to “Graphics Development”

Who is online

Users browsing this forum: Google [Bot] and 28 guests