Adding new vehicle graphics

Get help, info, news and advice about the Transport Tycoon Deluxe patch.

Moderator: TTDPatch Moderators

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

Adding new vehicle graphics

Post by Patchman »

TOPIC BROKEN: New topic is here. Please lock and unstick this.

----------------------------------------

** Updated January 14 2003 **

Since TTDPatch 1.9.1 alpha 6, it is possible to add new vehicle graphics to the game, similar to the new ships by Michael Blunck, but now also possible for trains, road vehicles and planes.

Unlike simply changing the existing graphics, adding new ones is a bit more complicated.

I wrote a very technical explanation which is part of the source code .zip file, and I'll also attach the current version here.

I'm attaching three example files as well, one for each vehicle type, which you can decode with GRFCodec, and try to understand how they work after reading the newgrf.txt file.

Here's a very brief summary:
  1. Copy the lines from the TRG1.NFO file for the vehicle type you want to modify. Pick a vehicle that's closest in size and shape to what you want to add.
  2. Paste these into a new .NFO file; perhaps a copy of one of the example .NFO files attached here.
  3. Add the first special sprites, don't worry about the numbers yet
  4. Add an action 0 to at least set that vehicle's sprite to FD for trains or FF for everything else
  5. Add an action 1, after which you paste the copied .NFO strings from trg1.nfo
  6. Add one or more action 2 entries
  7. Add one action 3 entry for each different vehicle
  8. Run renum.pl on it, or count the sprites yourself
  9. Encode it with GRFCodec
  10. Copy it to the newgrf folder in your TTD directory
  11. add the line "newgrf/yourfile.grf" to newgrf.txt, where "yourfile" is your .grf file name
  12. Try it! Hopefully it works...
Oh, and you also need to turn on "newtrains" (-T), "newrvs" (-XR) and/or "newplanes" (-XP) to enable new graphics for these vehicle types.

Update on January 13 2003:

I have changed the format of the new graphics files slightly, to allow for random graphics and variational graphics (which are like random graphics but deterministic). These changes apply to alpha 13 and higher. In alpha 12, the format of action 0 changed slightly; for trains, a missing property has been inserted ( 18 ), which changed the numbers for properties for sound/graphics effect type to 19, and sorting to 1A.

Please read the changes in action 2 and 3 if you want to use randomized or variational graphics, as well as wagon overrides.

Randomized graphics means a wagon for example will have several different graphics set, and one set will be chosen randomly. At your option, the graphics will be randomized again when the wagon is receives the next load and/or enters a depot.

Variational graphics are graphics that depend on variables, such as current date/year or the vehicle age or speed. These are a set of different graphics like random graphics, but they aren't chosen randomly, and instead determined by the variables.

Finally, wagon override means that you can specify graphics for certain wagons, which will only be used when attached to a specific engine. For example, you could make an ICE engine that forces the regular passenger wagon to look like an ICE wagon, but only when actually connected to the ICE engine.

Please have a look at the attached files to see how all of this works.

Update on January 14 2003:
I had to change the definition of random cargo ID lists, please insert one byte, according to the updated newgrf.txt.

Oh and could someone please fix this topic? I can't write replies (topic_notify error), only edit this existing post.
Last edited by Patchman on 23 Jan 2003 06:17, edited 3 times in total.
Josef Drexler

TTDPatch main | alpha/beta | nightly | manual | FAQ | tracker
No private messages please, you'll only get the answering machine there. Send email instead.
User avatar
Nem
Engineer
Engineer
Posts: 53
Joined: 01 Dec 2002 10:26
Location: Toscana (Tuscany), Italy

Re: Adding new vehicle graphics

Post by Nem »

Hi,
I've some problems creating a new Goods Wagon. My purpose is to add, not replace, a second goods wagon (Train) with a new graphic.
As I said there are some problems, but the most important are:

1) Perl remove my 13th line (action 4 - new name of the wagon) from the generated .nfo file

2) The TTDpatch crash using that .NFO files

Of course there will be some other errors, but I'd like to fix this 2 first.
If someone could help me that would be a great Xmas gift.
I'm not asking a complete debug, just a couple of hints.

Here you can read my .NFO file and the .NFO file generated by Perl

---------------------------------------------------------------------
My original .NFO file
---------------------------------------------------------------------

// Automatically generated by GRFCODEC. Do not modify!
// (Info version 4)
// Format: spritenum pcxfile xpos ypos compression ysize xsize xrel yrel

0 * 4 0E 00 00 00

1 * 8 00 12 FD 14 80 15 15 05

// Action 0
// 00 - Train
// 12 FD - 12 is the sprite ID for train (new graphic)
// 14 80 - Capacity
// 15 05 - Goods
// 16 ?? - weight - removed
// 17 ?? - cost factor - removed

2 * 3 00 02 04

// Action 1
// 00 - Train
// 02 - number of set of sprites (2, empty & full)
// 04 - number of images for each set (4 because the wagon is simmetric)

3 C:\Giochi\TTWin95\SPRITES\trg1r004.PCX 738 584 01 18 8 -3 -10
4 C:\Giochi\TTWin95\SPRITES\trg1r004.PCX 754 584 09 16 22 -15 -7
5 C:\Giochi\TTWin95\SPRITES\trg1r004.PCX 786 584 01 12 28 -14 -6
6 C:\Giochi\TTWin95\SPRITES\trg1r004.PCX 818 584 09 16 22 -5 -8
7 C:\Giochi\TTWin95\SPRITES\trg1r004.PCX 1410 584 01 18 8 -3 -10
8 C:\Giochi\TTWin95\SPRITES\trg1r004.PCX 1426 584 09 15 22 -15 -6
9 C:\Giochi\TTWin95\SPRITES\trg1r004.PCX 1458 584 01 12 28 -14 -6
10 C:\Giochi\TTWin95\SPRITES\trg1r004.PCX 1490 584 09 16 22 -5 -8

11 * 4 00 00 02 02

// Action 2
// 00 - Train
// 00 - Cargo ID
// 02 - Number of images while the cargo is in movement (2, empty & full)
// 02 - Number of images while the cargo loading (2, empty & full)

12 * 5 00 01 01 05 00

// Action 3
// 00 - Train
// 01 - This definition is for only one Wagon
// 01 - First vehicle using the definition
// 05 - goods
// 00 - cargo ID

13 * 14 00 01 01 Nem Goods Wagon0

// Action 4
// 00 - Train
// 01 - only one vehicle take this name
// 01 - First Vehicle using the given name
// Nem Goods Wagon0 - name
---------------------------------------------------------------------------

Using Perl the result is:

---------------------------------------------------------------------------
// Automatically generated by GRFCODEC. Do not modify!
// (Info version 4)
// Format: spritenum pcxfile xpos ypos compression ysize xsize xrel yrel
0 * 4 17 00 00 00
1 * 8 00 12 FD 14 80 15 15 05
2 * 3 00 02 04
3 C:\Giochi\TTWin95\SPRITES\trg1r004.PCX 738 584 01 18 8 -3 -10
4 C:\Giochi\TTWin95\SPRITES\trg1r004.PCX 754 584 09 16 22 -15 -7
5 C:\Giochi\TTWin95\SPRITES\trg1r004.PCX 786 584 01 12 28 -14 -6
6 C:\Giochi\TTWin95\SPRITES\trg1r004.PCX 818 584 09 16 22 -5 -8
7 C:\Giochi\TTWin95\SPRITES\trg1r004.PCX 1410 584 01 18 8 -3 -10
8 C:\Giochi\TTWin95\SPRITES\trg1r004.PCX 1426 584 09 15 22 -15 -6
9 C:\Giochi\TTWin95\SPRITES\trg1r004.PCX 1458 584 01 12 28 -14 -6
10 C:\Giochi\TTWin95\SPRITES\trg1r004.PCX 1490 584 09 16 22 -5 -8
11 * 4 00 00 02 02
12 * 5 00 01 01 05 00

---------------------------------------------------------------------------

As you can see action 4 (13th line) was missing.

Thanks in advance and Merry Christmas
Bye
Patchman
Tycoon
Tycoon
Posts: 7575
Joined: 02 Oct 2002 18:57
Location: Ithaca, New York
Contact:

Re: Adding new vehicle graphics

Post by Patchman »

Here are some comments on your .nfo file:
Nem wrote: 0 * 4 0E 00 00 00
This line is correct.
1 * 8 00 12 FD 14 80 15 15 05
Here you're missing the actual action number. The action number is not determined by sprite sprite number; you have to specify it explicitly. Also you need to specify the number of properties and vehicles you're changing. Please read newgrf.txt again :)
Format: <action> <veh-type> <num-props> <num-vehs> <first-veh> <prop-data>

Code: Select all

1 * 9   00 00 03 01 00 12 FD 14 80 15 15
2 * 3 00 02 04
Again missing the action number; should be 2 * 4 01 00 02 04

The lines for the PCX files seem to be correct.
11 * 4 00 00 02 02
Again missing the action number, as well as the actual sprite numbers. Format should be <action> <veh-type> <cargo-id> <num-loadtypes> <num-loadingtypes> <loadtypes...>:

Code: Select all

11 * 9   02 00 00 02 02 00 00 01 00 00 00 01 00
02=action; 00=trains; 00=cargo ID 0; 02 02=two different load statusses each for moving and loading; 00 00 and 01 00 = sprite sets 0 and 1 are the sprites to use
12 * 5 00 01 01 05 00
Again missing the action number. Here you're setting the new cargo ID to be used for train vehicle "1", where you were setting the new sprite to FD for train vehicle "0" above in action 0. That doesn't match... it should be:

Code: Select all

12 * 7     03 00 01 00 00 00 00
03=action; 00=trains; 01=one train vehicle; 00=train vehicle "0"; 00=no cargo-specific sprites, only default; 00 00=use cargo ID 0 as default
13 * 14 00 01 01 Nem Goods Wagon0
Aside from not specifying the sprite number, you can't give the name as actual text, you have to use the ASCII codes in hexadecimal, e.g. "A"=41 in hex, and "f"=66 in hex.

Hope that helps...

And I haven't actually tested any of this because I'm on vacation :)
Josef Drexler

TTDPatch main | alpha/beta | nightly | manual | FAQ | tracker
No private messages please, you'll only get the answering machine there. Send email instead.
iSteve
Engineer
Engineer
Posts: 26
Joined: 12 Dec 2002 14:36

Post by iSteve »

Hopefully somebody will make a lamah-friendly client for that, too :oops: :lol: :lol: :oops:
User avatar
spaceman-spiff
Retired Moderator
Retired Moderator
Posts: 20634
Joined: 28 Jul 2002 07:08
Location: Belgium
Contact:

Re: Adding new vehicle graphics

Post by spaceman-spiff »

Patchman wrote:And I haven't actually tested any of this because I'm on vacation :)
Diagnostic: I think you're sick :cry:
Cure: play some TTD :D
Well, back to work, lot's of it in the near future
User avatar
Nem
Engineer
Engineer
Posts: 53
Joined: 01 Dec 2002 10:26
Location: Toscana (Tuscany), Italy

Re: Adding new vehicle graphics

Post by Nem »

Patchman wrote:Here are some comments on your .nfo file .......
:D Thank you very much for the explanation, in the next days I'll try to fix my .NFO file.

Merry Christmas to everyone.

Nem
User avatar
Mad Dog McKill
President
President
Posts: 911
Joined: 13 Nov 2002 10:24
Location: Singapore but originally Moscow

Post by Mad Dog McKill »

Err...what must I do after I changed the graphics in the pcx for that chimera in the trntest to make it a grf again? I am not very good with these kinds of things...could you please you explain it to me...It should be easier to do then to create a new train or smth...
Last edited by Mad Dog McKill on 22 Dec 2002 04:25, edited 1 time in total.
OT: By FIREMARK: "Limitation disturbs me very sprites. Goes it throw out limitation?"
My Last.fm Profile
My Facebook Profile
User avatar
Raichase
Moderizzle
Moderizzle
Posts: 11509
Joined: 15 Dec 2002 00:58
Location: Sydney, Australia. Usually at work in the underground railway station...
Contact:

Post by Raichase »

Is that what i'm doing wrong? I'm changing the .pcx file, but not changing the .NFO file...

Oh nvm, i think i'll leave it up to the experts :P
Posted by Raichase. Visit my Flickr! Gallery, Blog (get a feed of everyone at once at Planet TT-Forums).
Raichase - Perfect timing, all the time: [13:37] * Now talking in #tycoon
ImageImage
Official TT-Dave Worley Fan Club
Official TT-Andel-in-a-pink-hat Fan Club
spacy
Engineer
Engineer
Posts: 102
Joined: 06 Dec 2002 09:30
Location: Assen, Netherlands
Contact:

Post by spacy »

Thank patchman, i used your maglev example,
and got some help from Michael

i created the most used diesel/passenger engine we use here in the Netherlands, and our powerful electric loc 1800

download it here: http://members.home.nl/rolandj/ttd/

below a screenshot of a first version of that DM'90 Buffel diesel engine,
not it already looks better ;)
Attachments
nsdiesel.jpg
nsdiesel.jpg (36.8 KiB) Viewed 9409 times
Last edited by spacy on 27 Dec 2002 10:53, edited 4 times in total.
NS Trains for patched TTDX -- Fears no Evil ---- Get A Real Life
User avatar
cmd_srui
Traffic Manager
Traffic Manager
Posts: 189
Joined: 16 Dec 2002 02:34
Location: Lisbon, Portugal
Contact:

a little problem

Post by cmd_srui »

Hi!

I tried to make a loco of my own... problem is, when I go to a raildepot, I do not have any locomotive for buying. Neither the one I have done, nor the default ones... What could be wrong?
User avatar
cmd_srui
Traffic Manager
Traffic Manager
Posts: 189
Joined: 16 Dec 2002 02:34
Location: Lisbon, Portugal
Contact:

Post by cmd_srui »

Sorry :( it just keept giving me an error message. I thought it did not post the message.... until I gave up and saw this

sorry guys.
Live long and Prosper
User avatar
Nem
Engineer
Engineer
Posts: 53
Joined: 01 Dec 2002 10:26
Location: Toscana (Tuscany), Italy

Post by Nem »

cmd_srui wrote:Sorry :( it just keept giving me an error message. I thought it did not post the message....
Hi,
if you want you can remove your posts using the EDIT button (near the QUOTE button). Except the original one, of course.
Bye
User avatar
spaceman-spiff
Retired Moderator
Retired Moderator
Posts: 20634
Joined: 28 Jul 2002 07:08
Location: Belgium
Contact:

Post by spaceman-spiff »

I removed them, but now strangely enough, your postcount is 0 :cry:

Btw. i got this error: Could not find email template file topic_notify
If you get this one, just ignore it , your post has been done
Last edited by spaceman-spiff on 30 Dec 2002 08:03, edited 1 time in total.
Well, back to work, lot's of it in the near future
spacy
Engineer
Engineer
Posts: 102
Joined: 06 Dec 2002 09:30
Location: Assen, Netherlands
Contact:

Re: a little problem

Post by spacy »

cmd_srui wrote:Hi!

I tried to make a loco of my own... problem is, when I go to a raildepot, I do not have any locomotive for buying. Neither the one I have done, nor the default ones... What could be wrong?
upload or post your created grf file somewhere so we can look to it.
NS Trains for patched TTDX -- Fears no Evil ---- Get A Real Life
spacy
Engineer
Engineer
Posts: 102
Joined: 06 Dec 2002 09:30
Location: Assen, Netherlands
Contact:

Post by spacy »

spaceman-spiff wrote:I removed them, but now strangely enough, your postcount is 0 :cry:

Btw. i got this error: Could not find email template file topic_notify
If you get this one, just ignore it , your post has been done
me to, i guess josef or some other turned the option notify my with email if somebody react on this topic on,
so i guess the admin of this forum should look if there isnt some file missing orso
NS Trains for patched TTDX -- Fears no Evil ---- Get A Real Life
User avatar
heavyjoost
Engineer
Engineer
Posts: 26
Joined: 19 Dec 2002 14:00
Location: Canada
Contact:

Post by heavyjoost »

spacy wrote:Thank patchman, i used your maglev example,
and got some help from Michael

i created the most used diesel/passenger engine we use here in the Netherlands, and our powerful electric loc 1800

download it here: http://members.home.nl/rolandj/ttd/

below a screenshot of a first version of that DM'90 Buffel diesel engine,
not it already looks better ;)
cool train!! those ones are here too :D (Groningen, Winschoten)
User avatar
cmd_srui
Traffic Manager
Traffic Manager
Posts: 189
Joined: 16 Dec 2002 02:34
Location: Lisbon, Portugal
Contact:

My PCX File

Post by cmd_srui »

This is the Locomotive graphics I want to add...
Attachments
cp2600.zip
(1.89 KiB) Downloaded 248 times
Last edited by cmd_srui on 01 Jan 2003 23:49, edited 1 time in total.
Live long and Prosper
User avatar
cmd_srui
Traffic Manager
Traffic Manager
Posts: 189
Joined: 16 Dec 2002 02:34
Location: Lisbon, Portugal
Contact:

some doubts...

Post by cmd_srui »

I believe that although i have been through all txt files and expalnation, i am just not understanding anything about creating new graphics...

I really wanted to create all the locomotives , cars and wagons of my national railway companie, whitout having to substitute the original the original graphics... :( it seems I am not going to be able to do it now can't I?

I s it possible to have all rolling stock of my country in one huge pcx file?
Live long and Prosper
SHADOW-XIII
Tycoon
Tycoon
Posts: 14275
Joined: 09 Jan 2003 08:37

Post by SHADOW-XIII »

Micheal Blunck released new graphics on his page ... take a look, it's beautifull: http://www.patagonia.de.vu/ttd
Katana
Transport Coordinator
Transport Coordinator
Posts: 259
Joined: 08 Jan 2003 16:42
Location: The Netherlands

Post by Katana »

how do you activate the new trains, i dont no :oops:
patchman said "newtrains (-T). i'd just make a new line in the ttdpatchw.cfg, but it did not work :(
Last edited by Katana on 09 Jan 2003 22:51, edited 1 time in total.
Locked

Return to “General TTDPatch”

Who is online

Users browsing this forum: No registered users and 3 guests