Page 1 of 2

Graphics Tutorial (Almost Finished)

Posted: 14 Aug 2003 18:40
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?"

Posted: 18 Aug 2003 17:22
by Dinges
It progresses good, what'd ya think :?:

Posted: 18 Aug 2003 17:29
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.

Posted: 18 Aug 2003 17:40
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...

Posted: 18 Aug 2003 17:43
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:

Posted: 18 Aug 2003 19:33
by Dinges
you don't exactly need it, but it could be very handy...

Re: Graphics Tutorial (Almost Finished)

Posted: 18 Aug 2003 19:57
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.

Posted: 19 Aug 2003 02:44
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.

Re: Graphics Tutorial (Almost Finished)

Posted: 19 Aug 2003 11:16
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...

Posted: 19 Aug 2003 16:12
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 :)

Posted: 19 Aug 2003 16:18
by troopper5
Finally i can study code and grf making! Thanks Dinges! :D

Posted: 19 Aug 2003 16:21
by Petae
dude you made a typo
Is the scale aalright etc
keep up the good work

Posted: 19 Aug 2003 16:27
by eis_os
Which typo :P

Already fixed by me :wink:

Posted: 19 Aug 2003 17:41
by Dinges
You shouldn't use so much enters

Allready fixed by me.

Posted: 23 Aug 2003 10:07
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!!!!!!!!

Posted: 23 Aug 2003 10:33
by orudge
Um... DOS systems can be very organised, you know.

Posted: 23 Aug 2003 10:51
by SHADOW-XIII
indeed ... and if you want to create your graphic just learn how to use grfcodec without grfwizard

Posted: 23 Aug 2003 12:22
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 :!:

Re: Graphics Tutorial (Almost Finished)

Posted: 31 Aug 2003 18:38
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...

Posted: 31 Aug 2003 18:54
by Dinges
I know, I'm working on the list...

And I fixed a the error.