Page 1 of 4

Support for TTDPatch (NFOid) GRF files

Posted: 16 May 2004 22:09
by pasky
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.)

Changelog

Posted: 17 May 2004 20:51
by pasky
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.

Changelog

Posted: 18 May 2004 20:41
by pasky
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!)

Changelog

Posted: 19 May 2004 21:31
by pasky
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.

Posted: 21 May 2004 09:04
by Darkvater
  • [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

Changelog

Posted: 21 May 2004 19:48
by pasky
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.

Changelog

Posted: 05 Jun 2004 10:12
by pasky
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 :).

SVN merge

Posted: 06 Jun 2004 22:38
by pasky
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.)

Grf Files and Appz...

Posted: 10 Jun 2004 14:12
by Steve2k4
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.

Re: Grf Files and Appz...

Posted: 10 Jun 2004 15:13
by pasky
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 ;-).

Posted: 10 Jun 2004 17:29
by Darkvater
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.

Posted: 21 Jun 2004 06:32
by adolph58
Nice! :D This new grf loading system works perfectly! Great works! :P

Posted: 28 Jun 2004 10:16
by MT3269
How do you apply the "patch" into openttd?

Posted: 28 Jun 2004 11:01
by Wolf01
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"?

Posted: 28 Jun 2004 16:29
by Raven
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:

Posted: 01 Jul 2004 07:55
by Wolf01
but, why i can't build any set trains?

Posted: 01 Jul 2004 09:38
by MT3269
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!

Posted: 01 Jul 2004 10:08
by Darkvater
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.

Posted: 01 Jul 2004 10:55
by Korenn
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.

Posted: 01 Jul 2004 14:34
by MT3269
What's the svn version?

And does anyone have the url for their site?