Graphics Tutorial (Almost Finished)

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

User avatar
Dinges
Tycoon
Tycoon
Posts: 2865
Joined: 07 Jan 2003 18:00
Location: Fryslân Boppe!
Contact:

Graphics Tutorial (Almost Finished)

Post by Dinges »

The Graphics Tutorial Written by Marcel Koonstra (Dinges)

The start...
First decide what you are going to draw, how should it look, how do you want to do it and what do you need to draw it in :?:
  1. What do I need :?:
  2. GRFcodec and GRFdiff, get them here: http://www.ttdpatch.net/grfcodec/
  3. A tool to edit PCX files, suggested is i.mage (free) or Paint Shop Pro (trial)
    It must support palletes, paint doesn't :!:
  4. (optional) GRFWizard
  5. Your drawing skills
  • Decoding the files
    First seek what file you need to decode, here are some files:
  • trg1[r].grf > Almost everything is in here
  • trgh[r].grf > Desert Climate Stuff (addition to trg1r.grf)
  • trgc[r].grf > Arctic Climate Stuff (addtition to trg1r.grf)
  • trgt[r].grf > Toyland
  • trgi[r].grf > Start screens etc.
    Select the file you need, if you have DOS, you should use without r, windows user should be with r
    1. Using GRFWizard
    2. Start the Wizard and Click "Decode graphics", next
    3. Select the directory where TTD is located, next
    4. Click the files you wan't to decode, next
    5. The pallete that is the same as your TTD version (Win/DOS) should be selected, if not do so.
    6. Alternate you can split the file in parts, read the tip below
    7. Press Next
    8. There should now be a box popping up, wait till it is finished/disapeared
    1. Doing it manualy
    2. Start up DOSpromt (winkey -> run, type: command)
    3. Navigate to the TTD Directory
    4. type the following:

      Code: Select all

      grfcodec -d grffile.grf
    5. You can also read the tip below to do make PCX files smaller
    6. This should now decode the file, wait till it is finished and then close it.
  1. Decoding tips
  2. When using i.mage, you'l; notice you have 2 windows, 1 zoomed in and one at 1:1, it would be handy that you use a good width to fit this, also when you have big files like trg1r.grf, you'le get enourmous files, these are un-easy to edit and not recommended.
    • Recommandation for this in GRFWizard:
      There are boxes for alternate width and height, fill in 500 for width and 2000 for the height and you'll get them nice and small, PCX files will all be very efficient to handle...
    • Reccomandation for this doing manually:
      The following code will do the same as above:

      Code: Select all

      grfcodec -d grffile.grf -w 500 -h 2000
  • Find the Sprites
    After the decoding process, you'll need to edit the graphics. I presume you'll be using either. The first thing you need to do is find the sprite, the PCX files are decoded in the \sprites directory. You'll see a .NFO file and one or more .PCX files which have the same name as the .GRF file you've decoded. Open the .PCX file(s) to find the sprite(s) you want to change.

    Very Important: Write down the numbers off the sprites you are changing, you WILL need them later on.

    Editing Graphics
  • Encoding the files
    After you've edited the sprites, you must encode them again. This can be done as follows:
    1. Using GRFWizard
    2. Start the Wizard and Click "Encode graphics", next
    3. Select the directory where TTD is located, next
    4. Click the files you wan't to encode, next
    5. Keep the option for the same pallete in place
    6. Press Next
    7. There should now be a box popping up, wait till it is finished/disapeared
    1. Doing it manualy
    2. Start up DOSpromt (winkey -> run, type: command)
    3. Navigate to the TTD Directory
    4. type the following:

      Code: Select all

      grfcodec -e grffile.grf
    5. This should now encode the file, wait till it is finished and close it.
  1. Remember that this doesn't delete the .NFO or .PCX file, which you can still edit after the encoding.

    Testing in TTD
    You should now try to test it in TTD. Do the colors look good :?: Is the scale alright :?: etc, etc... If something isn't right, edit the files again (no need to decode again) and make the necessary corrections.

    If you think you're creation is okay, head on to the next section...
  1. Submitting your Creations
    If it is correct, you should have a list off the sprites you changed, get them in front off you. We are now going to make a .exe file now. Please read these things carefully if you wan't to get good results...
    1. Using GRFWizard
    2. Start the Wizard and Click "Generate Graphics with the modified Graphics", next
    3. Select the directory where TTD is located, next
    4. Click the file you wan't to give the update for, next
    5. Check the box before "Instead of search for new sprites, use these" box
    6. Now type in the sprites you changed, always use two numbers with a - between them even if there is only one sprite in the range...
      f.e: 1234-5607, 5609-5609
    7. Type the name off the EXE in the box
    8. Press Next and wait till the box isfinished/disapeared
    1. Doing it manualy
    2. Start up DOSpromt (winkey -> run, type: command)
    3. Navigate to the TTD Directory
    4. type the following:

      Code: Select all

      grfdiff -l xxxx-xxxx, xxxx-xxxx grffile.grf grffile.bak -x -o filename.exe
    5. Change the xxxx parts for your spritenumbers, always use two numbers with a - between them even if there is only one sprite in the range...
      f.e: 1234-5607, 5609-5609
    6. Offcourse Change grffile.grf and grffile.bak into the right values
    7. This should now make a .exe file, wait till it is finished and close it.
  1. Uploading the files, and getting them on my site
    This is not relevent to the Tutorial, but I'll just post it here.
    Follow the following steps/rules for doing this:
  2. Make a topic in this forum containing the Graphics + Discription
  3. Register on my site
  4. Contact me abouit it
    That was it, this is enough to get it added...

    Convert it from WIN -> DOS, or vice versa
    I am not going to include it here, but Marcel made a excellent guide for it here.
How to draw TTD graphic?
You should visit this page, there are some tutorials that help you: http://users.tt-forums.net/purno/PDT/index.php

Message from Dinges:
I hope you had much fun reading this tutorial as I had with making this for you, and I hope you could do something with it, feel free to leave a message here. Also, I wish you happy Graphics making.

SHADOW-XIII: added "How to draw TTD graphic?"
Last edited by Dinges on 06 Dec 2004 16:35, edited 31 times in total.
User avatar
Dinges
Tycoon
Tycoon
Posts: 2865
Joined: 07 Jan 2003 18:00
Location: Fryslân Boppe!
Contact:

Post by Dinges »

It progresses good, what'd ya think :?:
Dinges

Who is the other person in me?

my Blog (dutch) - my Last.fm profile

Owner of http://ttdgraphics.cjb.net/ ! Temp addr: http://ttdgraphics.owenrudge.com/
User avatar
Rob
Tycoon
Tycoon
Posts: 4355
Joined: 31 Dec 2002 16:52
Location: Ven-Zelderheide, The Netherlands

Post by Rob »

Nice.

This :

Code: Select all

Tip from dinges: Write down the sprites you are changing, it'll be handy later on
should be a lot bigger. Very important.!!! :lol:

You also could give/explain the use of batch-files to do the bulk of the encode and decode work.
Wie zich gelukkig voelt met het geluk van anderen, bezit een rijkdom zonder grenzen. (F.Daels)
Image
Still the best OS around
User avatar
Dinges
Tycoon
Tycoon
Posts: 2865
Joined: 07 Jan 2003 18:00
Location: Fryslân Boppe!
Contact:

Post by Dinges »

Rob wrote:Nice.

This :

Code: Select all

Tip from dinges: Write down the sprites you are changing, it'll be handy later on
should be a lot bigger. Very important.!!! :lol:

You also could give/explain the use of batch-files to do the bulk of the encode and decode work.
This better :?:, I'll do some tips about that later on...
Dinges

Who is the other person in me?

my Blog (dutch) - my Last.fm profile

Owner of http://ttdgraphics.cjb.net/ ! Temp addr: http://ttdgraphics.owenrudge.com/
User avatar
Rob
Tycoon
Tycoon
Posts: 4355
Joined: 31 Dec 2002 16:52
Location: Ven-Zelderheide, The Netherlands

Post by Rob »

Much better. :D

Iused to forget that myself, and if you want to encode them later on you have to search trough the pcx-files to find the sprites you changed. :oops:
Wie zich gelukkig voelt met het geluk van anderen, bezit een rijkdom zonder grenzen. (F.Daels)
Image
Still the best OS around
User avatar
Dinges
Tycoon
Tycoon
Posts: 2865
Joined: 07 Jan 2003 18:00
Location: Fryslân Boppe!
Contact:

Post by Dinges »

you don't exactly need it, but it could be very handy...
Dinges

Who is the other person in me?

my Blog (dutch) - my Last.fm profile

Owner of http://ttdgraphics.cjb.net/ ! Temp addr: http://ttdgraphics.owenrudge.com/
User avatar
Marcel
President
President
Posts: 917
Joined: 08 Mar 2003 15:36
Location: Bochum, Germany

Re: Graphics Tutorial (Almost Finished)

Post by Marcel »

Dinges wrote: Testing in TTD
You should now try to test it in TTD, do the colors look good :?: Is the scale aalright etc. etc. When this is not okay, edit the files again (no need to decode again) to make them the way you wan't
Best is to make sure that the colours look o.k. when you only use colours which can be found in the decoded pcx - file (this is VERY important for a conversion). Copy them simply out of other sprites. There are 256 colours, and this should be enough. Other colours could have blinking dots as a result. Make a conversion of Chulios Stadium, you will see what I mean.
User avatar
Flavius
Tycoon
Tycoon
Posts: 1531
Joined: 22 Apr 2003 03:55
Location: Gold Coast, Queensland, Australia.

Post by Flavius »

Well done Dinges, having all the information in one place is great. When i find some time i am going to try and learn how to do it.
User avatar
Dinges
Tycoon
Tycoon
Posts: 2865
Joined: 07 Jan 2003 18:00
Location: Fryslân Boppe!
Contact:

Re: Graphics Tutorial (Almost Finished)

Post by Dinges »

Marcel wrote:
Dinges wrote: Testing in TTD
You should now try to test it in TTD, do the colors look good :?: Is the scale aalright etc. etc. When this is not okay, edit the files again (no need to decode again) to make them the way you wan't
Best is to make sure that the colours look o.k. when you only use colours which can be found in the decoded pcx - file (this is VERY important for a conversion). Copy them simply out of other sprites. There are 256 colours, and this should be enough. Other colours could have blinking dots as a result. Make a conversion of Chulios Stadium, you will see what I mean.
hmmm, I dunnow, I'm going to cover the pallete in the colors section, hope that be enough for our drawers...
Dinges

Who is the other person in me?

my Blog (dutch) - my Last.fm profile

Owner of http://ttdgraphics.cjb.net/ ! Temp addr: http://ttdgraphics.owenrudge.com/
User avatar
eis_os
TTDPatch Developer
TTDPatch Developer
Posts: 3603
Joined: 07 Mar 2003 13:10
Location: Germany
Contact:

Post by eis_os »

:idea: Little Tip:

And don't forget to save your hard work before you decode your grf file again, it could happen that there are some mistakes and you will overwrite your work with false sprites :)
User avatar
troopper5
Tycoon
Tycoon
Posts: 1480
Joined: 18 Oct 2002 04:56
Location: Oulu, Finland

Post by troopper5 »

Finally i can study code and grf making! Thanks Dinges! :D
User avatar
Petae
Tycoon
Tycoon
Posts: 1076
Joined: 15 Jun 2003 15:26

Post by Petae »

dude you made a typo
Is the scale aalright etc
keep up the good work
Everything is relative
User avatar
eis_os
TTDPatch Developer
TTDPatch Developer
Posts: 3603
Joined: 07 Mar 2003 13:10
Location: Germany
Contact:

Post by eis_os »

Which typo :P

Already fixed by me :wink:
User avatar
Dinges
Tycoon
Tycoon
Posts: 2865
Joined: 07 Jan 2003 18:00
Location: Fryslân Boppe!
Contact:

Post by Dinges »

You shouldn't use so much enters

Allready fixed by me.
Dinges

Who is the other person in me?

my Blog (dutch) - my Last.fm profile

Owner of http://ttdgraphics.cjb.net/ ! Temp addr: http://ttdgraphics.owenrudge.com/
BobXP
Tycoon
Tycoon
Posts: 2720
Joined: 04 May 2003 11:00
Location: Torquay, England
Contact:

Post by BobXP »

Damn, why does GRFWizard HAVE TO ASSUME THAT THE GRFCODEC FILES ARE IN THE SAME FOLDER AS TTD? THIS ISN'T DOS YOU KNOW! PEOPLE DO ORGANIZE THEMSELVES AND PUT STUFF IN FOLDERS!!!!!!!!
<!-- End Of Post !-->
Image
User avatar
orudge
Administrator
Administrator
Posts: 25223
Joined: 26 Jan 2001 20:18
Skype: orudge
Location: Banchory, UK
Contact:

Post by orudge »

Um... DOS systems can be very organised, you know.
SHADOW-XIII
Tycoon
Tycoon
Posts: 14275
Joined: 09 Jan 2003 08:37

Post by SHADOW-XIII »

indeed ... and if you want to create your graphic just learn how to use grfcodec without grfwizard
what are you looking at? it's a signature!
User avatar
Dinges
Tycoon
Tycoon
Posts: 2865
Joined: 07 Jan 2003 18:00
Location: Fryslân Boppe!
Contact:

Post by Dinges »

SHADOW-XIII wrote:indeed ... and if you want to create your graphic just learn how to use grfcodec without grfwizard
I thought this tutorial gives you that ability too :!:
Dinges

Who is the other person in me?

my Blog (dutch) - my Last.fm profile

Owner of http://ttdgraphics.cjb.net/ ! Temp addr: http://ttdgraphics.owenrudge.com/
Patchman
Tycoon
Tycoon
Posts: 7575
Joined: 02 Oct 2002 18:57
Location: Ithaca, New York
Contact:

Re: Graphics Tutorial (Almost Finished)

Post by Patchman »

Just a couple of quick comments...

grfdiff with -l for a single sprite works fine from version 0.9.5 and above (in "submitting... doing it manually")

It would be useful to have a list of the colours that are special, for example which ones are blinking, and which ones are company colours, and which ones are invalid to use (it think that's obvious because they're an ugly pink). I think there are also colours that work in the DOS version but not the Windows one (when converting graphics from DOS->Win), but I don't know which ones. Maybe it was Win->DOS...
User avatar
Dinges
Tycoon
Tycoon
Posts: 2865
Joined: 07 Jan 2003 18:00
Location: Fryslân Boppe!
Contact:

Post by Dinges »

I know, I'm working on the list...

And I fixed a the error.
Dinges

Who is the other person in me?

my Blog (dutch) - my Last.fm profile

Owner of http://ttdgraphics.cjb.net/ ! Temp addr: http://ttdgraphics.owenrudge.com/
Post Reply

Return to “Graphics Development”

Who is online

Users browsing this forum: Bing [Bot] and 9 guests