DOS Graphics

Forum for technical discussions regarding development. If you have a general suggestion, problem or comment, please use one of the other forums.

Moderator: OpenTTD Developers

Post Reply
Wizarth
Engineer
Engineer
Posts: 4
Joined: 08 Nov 2004 08:08
Location: Australia
Contact:

DOS Graphics

Post by Wizarth »

Is there a particular reason why OpenTTD uses only the Windows version of the GRF files? From running the game it appears to be a palette difference, but as we know apparences can be deceptive.

If the reason it doesn't work is either A) No-one has done it yet, or B) None of the dev's have the DOS version, then I'm looking to take it on. I really love the original TTD and would love to play a version with all the features I'd wished it had.
Prof. Frink
Tycoon
Tycoon
Posts: 3849
Joined: 20 Jan 2003 14:51
Location: Broadstone, Dorset
Contact:

Post by Prof. Frink »

There's always TTDPatch.
That adds lots of features to both Win and Dos versions.


Or, you could download the Win version from the link in my sig
User avatar
Darkvater
Tycoon
Tycoon
Posts: 3053
Joined: 24 Feb 2003 18:45
Location: Hong Kong

Re: DOS Graphics

Post by Darkvater »

Wizarth wrote:Is there a particular reason why OpenTTD uses only the Windows version of the GRF files? From running the game it appears to be a palette difference, but as we know apparences can be deceptive.

If the reason it doesn't work is either A) No-one has done it yet, or B) None of the dev's have the DOS version, then I'm looking to take it on. I really love the original TTD and would love to play a version with all the features I'd wished it had.
A) There have been two attempts that I know of. One from Pasky and the other from Tron. If I remember correctly there were some problems with the palette animations, and thus it didn't work perfectly.

You can of course give it a try. Best thing to do though is to use grfcodec to convert the DOS graphics to WIN graphics, or obtain the windows version of ttdlx.
TrueLight: "Did you bother to read any of the replies, or you just pressed 'Reply' and started typing?"
<@[R-Dk]FoRbiDDeN> "HELP, this litte arrow thing keeps following my mouse, and I can't make it go away."
User avatar
Darkvater
Tycoon
Tycoon
Posts: 3053
Joined: 24 Feb 2003 18:45
Location: Hong Kong

Post by Darkvater »

I have had a look around for the DOS graphics. The best thing to would be to use a modified grfcodec ( http://www.ttdpatch.net/grfcodec/ ) to convert the DOS files to WINDOWS files. Most of the functionality is already present there. Decode the files with "grfcodec -d <file>", then encode them (and converting to windows) with "grfcodec -e -m0 <file>". The file is not yet fully working because grfcodec doesn't convert the company palettes. Thus:
  • TRG1.GRF: fails!
  • TRGC.GRF: works
  • TRGH.GRF: works
  • TRGI.GRF: works
  • TRGT.GRF: fails! (toyland crap).
You can check if it works by renaming the newly encoded file to its ...R.GRF equivalent and use that as the graphic file for running ottd. If it doesn't crash or produce weird colours, it works. If you are working on *nix, you can try these patches, which make it compatible for *nix: http://pasky.or.cz/~pasky/dev/openttd/g ... nix2.patch Good luck!
TrueLight: "Did you bother to read any of the replies, or you just pressed 'Reply' and started typing?"
<@[R-Dk]FoRbiDDeN> "HELP, this litte arrow thing keeps following my mouse, and I can't make it go away."
SHADOW-XIII
Tycoon
Tycoon
Posts: 14275
Joined: 09 Jan 2003 08:37

Post by SHADOW-XIII »

I will give more info ....
you should decode WIN files like that:

decode it this way:
grfcodec.exe -p 2 -d win_version_of_a_file.grf

encode it this way:
grfcodec.exe -p 1 -e dos_version_of_a_file.grf

more info: grfcodec -p ?
what are you looking at? it's a signature!
Wizarth
Engineer
Engineer
Posts: 4
Joined: 08 Nov 2004 08:08
Location: Australia
Contact:

Post by Wizarth »

Thanks for the advice guys. I played with TTDPatch, but since I'm having to emulate DOS (I'm using Linux or WinXP) ttdpatch tends to crash a little too much. OpenTTD runs native to Linux, so I'm happier with that.

With grfcodec, I got it to compile (your patch file was missing a few things, want the diff's?) and it appears to sucessfully convert most of the files, except TRGI(R).GRF. Running this through the converter caused OpenTTD to crash.. Unfortauntely, my GUI text is all the same color as whatever its on (or all the text is transparent? Except for the Euro sign).

So if no-one objects I think I'll look into grfcodec and see if I can't improve it some.
User avatar
Darkvater
Tycoon
Tycoon
Posts: 3053
Joined: 24 Feb 2003 18:45
Location: Hong Kong

Post by Darkvater »

Wizarth wrote:So if no-one objects I think I'll look into grfcodec and see if I can't improve it some.
Yes, grfcodec screws up cause it was not meant for all the special stuff that's in trgr1.grf. You have to somehow fix the colour of the letters, since they are all transparent now.
TrueLight: "Did you bother to read any of the replies, or you just pressed 'Reply' and started typing?"
<@[R-Dk]FoRbiDDeN> "HELP, this litte arrow thing keeps following my mouse, and I can't make it go away."
Mek
TTDPatch Developer
TTDPatch Developer
Posts: 417
Joined: 13 Apr 2004 13:35
Location: Eindhoven, Netherlands
Contact:

Post by Mek »

Wizarth wrote:Thanks for the advice guys. I played with TTDPatch, but since I'm having to emulate DOS (I'm using Linux or WinXP) ttdpatch tends to crash a little too much. OpenTTD runs native to Linux, so I'm happier with that.
With WinXP you can just run ttdpatch natively if you enable support for win2k (and use the windows version of ttd)...
Wizarth
Engineer
Engineer
Posts: 4
Joined: 08 Nov 2004 08:08
Location: Australia
Contact:

Post by Wizarth »

Thanks Mek, but the whole basis of this thread is that I have the DOS version, and not the Windows version.

Is there a CVS/etc for grfcodec, where I can submit patches etc?
User avatar
Darkvater
Tycoon
Tycoon
Posts: 3053
Joined: 24 Feb 2003 18:45
Location: Hong Kong

Post by Darkvater »

No, grfcodec was made for ttdpatch. So any changes you make are your own changes :). If it works perfectly it will probably be included in ottd as a seperate executable so that dos people can convert their graphics to windows format.
TrueLight: "Did you bother to read any of the replies, or you just pressed 'Reply' and started typing?"
<@[R-Dk]FoRbiDDeN> "HELP, this litte arrow thing keeps following my mouse, and I can't make it go away."
nilsi
Transport Coordinator
Transport Coordinator
Posts: 268
Joined: 20 Nov 2002 16:20
Location: Dresden, Germany

Post by nilsi »

@Darkvater
What does the grfcodec patch change (besides \ vs. / issues and makefiles) ?
I doubt it is a good idea to have different versions floating around,
at least not at the moment.
Are your changes to the nfo format documented, or only in the patch?
(I refer to info.cc "inforeader" with "quoted byte"
and writing nfo version 5)
I fear the moment patchman uses version 5 in an incompatible way

Having a completely new grf format for OTTD in the future
a completely independent tool will of course be necessary.

When I have time I plan to take a look at reintegrating grfcodec.
Wizarth
Engineer
Engineer
Posts: 4
Joined: 08 Nov 2004 08:08
Location: Australia
Contact:

Post by Wizarth »

Well, I got it so that it works, it still needs work (at the moment it's a special build just for TRG1.GRF, needs to be an option). And I've changed the palette OpenTTD is using slightly (the first 15 or so colors from hot-pink to the DOS greyscale). The changed palette was to make the windows (option etc) and toolbar show up right, I couldn't find their graphics to convert/re-map them.

My alterations after the patch fixed an error with an anonymous union containing struct's (gcc didn't like that) and with a missing lib in the Makefile (stdc++). I didn't examine what the patch I was given did though, only enough to realise I had to change the line endings before it would apply.
Post Reply

Return to “OpenTTD Development”

Who is online

Users browsing this forum: Auge and 13 guests