Support for TTDPatch (NFOid) GRF files

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

pasky
OpenTTD Developer
OpenTTD Developer
Posts: 90
Joined: 25 Apr 2004 15:14
Location: Czech Republic
Contact:

Support for TTDPatch (NFOid) GRF files

Post by pasky » 16 May 2004 22:09

Just FYI, there is some progress! :)

The latest patchy snapshot of my work is always available at
http://pasky.or.cz/~pasky/dev/openttd/grfspecials.patch , however it tends to
get synced with SVN frequently. Currently it contains some preliminary support
for custom waypoints/checkpoints graphics (MB's newstatsw.grf).

So far it handles the less complex train vehicle sets fine - arcticset and
temperate set and even most of the BRSet. It also handles newships fine. Now
the main focus is to get the other vehicle sets to work
- long road vehicles and planeset. Then I plan to move to tropicset (which is
already relatively complex) and the final target for now is dbsetxl.

I will update this topic as the work goes on.

How to use the GRF files? Add something like this to your openttd.cfg:

Code: Select all

[newgrf]
0 = arcticsetw.grf
1 = tempsetpw.grf
2 = newshipsw.grf

What works so far:
  • Arcticset - complete, without tweaks; Dm3 middle wagon doesn't work (it just
    does not exist for OTTD), but they say it does not work with TTDPatch properly
    neither.
  • Temperate set - complete, without tweaks; no known problems.
  • BRSet - Some engines change their sprites depending on in which year were
    they built. That doesn't work in OTTD yet.
  • New ships - complete, without tweaks; no known problems
Most important things to do now:
  • Long road vehicles support. (Inspired by George.)
  • Some GRF files infrastructure - list of already loaded GRF file ids,
    configurable which GRFs to load, maybe also some TTDPatch-like GUI. I do not
    yet have much clear idea how would I implement GRF files unloading, though. It
    would (will?) be annoying to implement, but it is probably quite important to
    have. Well, we'll see yet.
Now I'm going to do planeset or long vehicles, in no set order.

My current long-term graphics plans:
  • I'll first focus on having the smaller pieces working and then I will move
    on to a bigger target (not directly to the huge dbset beast, though; I think I
    will do tropicset first, which is also already pretty advanced).
  • I would like to do support for custom stations as well, not sure if it will
    be reasonably doable.
  • When support for custom GRFs will be reasonable complete, we plan to ditch
    GRF format and invent own one, better, more flexible and uncluttered. Currently
    we aim at PNG with user chunks + some tool to manipulate it (especially the
    user chunks containing the game data but also maybe support for splitting it to
    PNG-per-real-sprite etc.).
(Note that I'm not sure how many time will I have for continuing to work on
this at all. I do not guarantee on continuing to work on it but hopefully the
code is easy to work with enough for someone else to pick it up.)

(Also please note that this topic is heavily moderated, only informative posts
are kept. Problem reports are deleted after they are solved - there's nothing
personal in that, I just want to keep this topic uncluttered and easy to browse
for actual information. If you want your problem reports to stay around
forever, don't be afraid to open a topic in the OpenTTD Problems forum.)
Last edited by pasky on 12 Jun 2004 23:08, edited 10 times in total.
The flush toilet is the basis of Western civilization. -- Alan Coult

pasky
OpenTTD Developer
OpenTTD Developer
Posts: 90
Joined: 25 Apr 2004 15:14
Location: Czech Republic
Contact:

Changelog

Post by pasky » 17 May 2004 20:51

Uploaded a new version of the patch.
The most important change is that it supports custom multihead trains properly now. (As long as it doesn't contain any pitfall like a middle wagon like the (in)famous DM3 engine.)

The other minor changes include some trivial preparation work for introducing custom vehicles other than trains and custom engines headed in a proper direction in the Build train menu.
The flush toilet is the basis of Western civilization. -- Alan Coult

pasky
OpenTTD Developer
OpenTTD Developer
Posts: 90
Joined: 25 Apr 2004 15:14
Location: Czech Republic
Contact:

Changelog

Post by pasky » 18 May 2004 20:41

Uploaded a new version of the patch.

Now it generates proper effects (visual [smoke, sparks] as well as sound) for each engine class (steam, diesel, electric), before it used the maglevel effects for all engines.

Minor changes are various cleanups and enhancements of my code. (Plus some suggestions by ludde; the code is now endian-safe so you OSX strangers can try it out too!)
The flush toilet is the basis of Western civilization. -- Alan Coult

pasky
OpenTTD Developer
OpenTTD Developer
Posts: 90
Joined: 25 Apr 2004 15:14
Location: Czech Republic
Contact:

Changelog

Post by pasky » 19 May 2004 21:31

Uploaded a new version of the patch.

After two days of debugging (I omitted '*3' from one equation) basic sprite supersets actually work. That implies several things - first, only minimal changes are required to use Arcticset now. There is only one problem - wagon overrides do not work yet, but the GRF file sets spritenum to custom sprite for the wagons, therefore it crashes. So you need to find any 00 blocks in the NFO containing '01 1B' or '02 1B' and remove them. Also, the middle DM3 wagon still does not work, change its 03 block's '02 00' at the end to '00 00'.

It also includes some further minor cleanups, nothing interesting IIRC.
The flush toilet is the basis of Western civilization. -- Alan Coult

User avatar
Darkvater
Tycoon
Tycoon
Posts: 3053
Joined: 24 Feb 2003 18:45
Location: Hong Kong

Post by Darkvater » 21 May 2004 09:04

  • [00:07:07]  pasky: BTW, http://pasky.or.cz/~pasky/dev/openttd/grfspecials.patch contains the last and best version of the TTDPatch GRF codec. It runs Temperate set and Arctic set w/o any modifications required.
  • [00:07:23]  pasky: My next target will be probably either new ships or long vehicles support.
A hard-working developer :D
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."

pasky
OpenTTD Developer
OpenTTD Developer
Posts: 90
Joined: 25 Apr 2004 15:14
Location: Czech Republic
Contact:

Changelog

Post by pasky » 21 May 2004 19:48

Uploaded a new version of the patch (yesterday, but the forums were down).

As Darkvater already said, with that version you can just load the temperateset and arcticset there and it will work, no bugs known. Currently there is no good mechanism to choose which GRFs to load, though, so keep the both GRF files in your data/ directory. You need the windows version, however rename it so it contains 'o' instead of the trailing 'w'.

Plethora of changes done. Wagon override, fixed some multihead problems, code cleanup and workaround for the arcane Dm3 middle wagon definition. And many more tiny lil' things. Have fun.
The flush toilet is the basis of Western civilization. -- Alan Coult

pasky
OpenTTD Developer
OpenTTD Developer
Posts: 90
Joined: 25 Apr 2004 15:14
Location: Czech Republic
Contact:

Changelog

Post by pasky » 05 Jun 2004 10:12

Uploaded for now the last version of the patch.

It features full support for custom ships (newships.grf now work), support for cargo-specific graphics, works with BRSet and contains large amount of cleanups etc.

It won't grow more until this part will be merged to SVN, the delta is already very huge and I want to prevent it to draft too far apart. We already work with ludde on merging it :).
The flush toilet is the basis of Western civilization. -- Alan Coult

pasky
OpenTTD Developer
OpenTTD Developer
Posts: 90
Joined: 25 Apr 2004 15:14
Location: Czech Republic
Contact:

SVN merge

Post by pasky » 06 Jun 2004 22:38

FYI, the latest snapshot has been merged to SVN, with some changes by ludde. There are some possible glitches created by these modifications but they aren't major (I think they shouldn't affect any of the officially supported sets) and they should be fixed hopefully soon enough.

To enable custom GRF files of your choice, put them to the data/ directory and add something like this to openttd.cfg :

Code: Select all

[newgrf]
0 = tempsetpw.grf
1 = newshipsw.grf
2 = arcticsetw.grf
...

(You need the Windows versions of GRF files, not DOS versions.)
The flush toilet is the basis of Western civilization. -- Alan Coult

Steve2k4
Engineer
Engineer
Posts: 12
Joined: 10 May 2004 21:18
Contact:

Grf Files and Appz...

Post by Steve2k4 » 10 Jun 2004 14:12

Now, here's a concept to get everyone's attention on OTTD. Make a seperate program that will make compatible .grf files for the game. Something like a scenario editor but for Trains, Planes, and Automobiles! (i love that movie), and ships of course.

Stuff like importing .gif's for sprites, editing vehicle speeds, acceleration, weight, etc.. Also, a preview pane would be nice. Maybe even add support/updating old .grf files to work with OTTD (via a small database file and array matching).

This, in my opinion, would make this great game more expandable. Just think, if everyone had access to a decent .grf application that was reverse compatible with TTD and OTTD, we would have some serious creativity popping up around the world.

Just an idea that would take more time to implement than I have to code it out.

pasky
OpenTTD Developer
OpenTTD Developer
Posts: 90
Joined: 25 Apr 2004 15:14
Location: Czech Republic
Contact:

Re: Grf Files and Appz...

Post by pasky » 10 Jun 2004 15:13

Steve2k4 wrote:Just an idea that would take more time to implement than I have to code it out.
Others had this idea too. Noone without this last "but", though ;-).
The flush toilet is the basis of Western civilization. -- Alan Coult

User avatar
Darkvater
Tycoon
Tycoon
Posts: 3053
Joined: 24 Feb 2003 18:45
Location: Hong Kong

Post by Darkvater » 10 Jun 2004 17:29

Akalamanaia wrote:Hmmm is there version of this thing in Nightly builds so i could play with Temperate Set?It seems it isnt implemented officially or something cause enabling tempsetw.grf crashes OTTD right on startup. It loads the slope graphics but doesnt use em..but temp set etc cause trouble.
You need to add this to your openttd.cfg

Code: Select all

[newgrf]
0 = tempsetpw.grf
1 = newshipsw.grf
2 = arcticsetw.grf
Of course you need the files from the ttdpatch website. And as you can see someone started working on such an editor: http://ttforums.owenrudge.net/viewtopic.php?t=5849

I highly doubt OpenTTD will ever build such an editor. Mainly because the format is a pain in the ass to work with, we were thinking about a simpler system. It would be a waste of time and manpower to make this program for the old format. It is much more likely that a converter will be made available.
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."

adolph58
Engineer
Engineer
Posts: 12
Joined: 09 Jun 2004 09:28
Location: Canada

Post by adolph58 » 21 Jun 2004 06:32

Nice! :D This new grf loading system works perfectly! Great works! :P

MT3269
Engineer
Engineer
Posts: 126
Joined: 04 May 2004 05:44
Location: Australia

Post by MT3269 » 28 Jun 2004 10:16

How do you apply the "patch" into openttd?

User avatar
Wolf01
Tycoon
Tycoon
Posts: 2013
Joined: 24 Apr 2004 10:43
Location: Venezia - Italia
Contact:

Post by Wolf01 » 28 Jun 2004 11:01

Darkvater wrote:
Akalamanaia wrote:Hmmm is there version of this thing in Nightly builds so i could play with Temperate Set?It seems it isnt implemented officially or something cause enabling tempsetw.grf crashes OTTD right on startup. It loads the slope graphics but doesnt use em..but temp set etc cause trouble.
You need to add this to your openttd.cfg

Code: Select all

[newgrf]
0 = tempsetpw.grf
1 = newshipsw.grf
2 = arcticsetw.grf
Of course you need the files from the ttdpatch website. And as you can see someone started working on such an editor: http://ttforums.owenrudge.net/viewtopic.php?t=5849

I highly doubt OpenTTD will ever build such an editor. Mainly because the format is a pain in the ass to work with, we were thinking about a simpler system. It would be a waste of time and manpower to make this program for the old format. It is much more likely that a converter will be made available.
i added these lines in openttd.cfg, the game started like every time, but i can't see differences, i have to start a new game?

edit: why "tempsetPw.grf" instead "tempsetw.grf"?

User avatar
Raven
Director
Director
Posts: 615
Joined: 13 May 2004 18:45
Location: Madrid - Main Recio's HQ
Contact:

Post by Raven » 28 Jun 2004 16:29

mainly tempsetpw uses player colours while the tempsetw has original liveryes (or the whole way around), the same that you could have clearly read in the manual though... :wink:
6th Member of the Reciox - The Inner Circle
Image

pak96 Simutrans Depot
http://www.raven.simutrans.com

User avatar
Wolf01
Tycoon
Tycoon
Posts: 2013
Joined: 24 Apr 2004 10:43
Location: Venezia - Italia
Contact:

Post by Wolf01 » 01 Jul 2004 07:55

but, why i can't build any set trains?

MT3269
Engineer
Engineer
Posts: 126
Joined: 04 May 2004 05:44
Location: Australia

Post by MT3269 » 01 Jul 2004 09:38

I've got the files and I added those lines ,yet I see no difference in game play.

What do I gotta do with the files?

Is adding those lines to oopenttd cfg gonna automatically load em into the game?

I wanna use em with big maps if possible cos I ain't building electric trains without the wires ,not realistic!

User avatar
Darkvater
Tycoon
Tycoon
Posts: 3053
Joined: 24 Feb 2003 18:45
Location: Hong Kong

Post by Darkvater » 01 Jul 2004 10:08

Trainskier1406 wrote:I've got the files and I added those lines ,yet I see no difference in game play.

What do I gotta do with the files?

Is adding those lines to oopenttd cfg gonna automatically load em into the game?

I wanna use em with big maps if possible cos I ain't building electric trains without the wires ,not realistic!
I don't think any bigger maps version has support for custom graphics files. Also, there is no electric-track implemented yet.
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
Korenn
Tycoon
Tycoon
Posts: 1628
Joined: 26 Mar 2004 01:27
Location: Netherlands, Enschede
Contact:

Post by Korenn » 01 Jul 2004 10:55

Darkvater wrote:I don't think any bigger maps version has support for custom graphics files. Also, there is no electric-track implemented yet.
Truelight made a bigger maps patch for the SVN version.
Creator of the Openttd Challenge Spinoff, Town Demand patch
The path to riches, a report on playing on a daylength server on ultra hard mode.

MT3269
Engineer
Engineer
Posts: 126
Joined: 04 May 2004 05:44
Location: Australia

Post by MT3269 » 01 Jul 2004 14:34

What's the svn version?

And does anyone have the url for their site?

Post Reply

Return to “OpenTTD Development”

Who is online

Users browsing this forum: No registered users and 4 guests