GRF encoder tool: GRFMaker [under development]

Discussions about the technical aspects of graphics development, including NewGRF tools and utilities.

Moderator: Graphics Moderators

Post Reply
RK
Transport Coordinator
Transport Coordinator
Posts: 264
Joined: 13 Oct 2003 10:43
Location: Dortmund, Germany

Post by RK »

use a pcx file, created by the GRFCodec and then select the sprite with the right mouse button.
User avatar
jvassie
Tycoon
Tycoon
Posts: 3421
Joined: 18 Dec 2002 18:00
Location: High Wycombe, England
Contact:

Post by jvassie »

Thanks!

By pcx file created by grfcodec... i assume you mean a decoded pcx file and then edit it?


Cheers
James
(British) Modular Stations Set - Thread: | Website:
Swiss Set - Thread: | Website:
Route Map Creator
My Screenshot Thread
DaleStan
TTDPatch Developer
TTDPatch Developer
Posts: 10285
Joined: 18 Feb 2004 03:06
Contact:

Post by DaleStan »

That, or apply the palette from a decoded PCX to a new PCX.
To get a good answer, ask a Smart Question. Similarly, if you want a bug fixed, write a Useful Bug Report. No TTDPatch crashlog? Then follow directions.
Projects: NFORenum (download) | PlaneSet (Website) | grfcodec (download) | grfdebug.log parser
MrMuscle
Engineer
Engineer
Posts: 1
Joined: 12 Oct 2005 06:24

Post by MrMuscle »

Hello. I am sorry for my question but can I somewhere download the GrfMaker tool to test if ? Thanks
User avatar
Szappy
Chief Executive
Chief Executive
Posts: 689
Joined: 29 Mar 2004 14:35
Location: Budapest, Hungary
Contact:

Post by Szappy »

jamesvassie wrote:Im not sure if this is a bug, probably isnt though, maybe a need for help! When i try to add a vehicle sprite block, i choose my options, click ok, and i get errors saying firstly that the BMP file contains more than 500 sprites, then an error saying no sprite selected in the sprite block.
The 'more than 500 sprites' error is probably caused by the blue numbers that grfcodec pastes on the images. The program falsely recognizes them as sprites.
Use method1 for sprite search, it's designed to filter out those blue numbers.
Unless you're using an image file, with more than 500 spirites, but that's unlikely. ;)

Here's a quick guide, to get started with sprite blocks:

first you have to create the folder under \projects for your new project, and move all the graphic files there (the program can support bmp or pcx currently). Then save the project there (the project name will also be the grf's name, on encoding), so the program acknowledges the project directory. Then on creating the vehicle sprite block, you can select all the pcx or bmp files in the dir in 'bitmap file name' field.
Sprite search is for automatic sprite recognition mode, for grfcodec decoded sprites (with those blue numbers), use method1, for a file with only sprites, use method2.
One thing that is important, though, is the sprite layout in the image files. The program uses an automatic method, to recognize the sprites, and the requisites are as follows:
- the order of the directions for vehicle sprites is: facing up first, then rotating CW.
- you should never use the color 255 (the totally white) in any of the graphics (TTD never used that color anyway)
- the top edge of the sprites needs to be in line, which also means the highest sprite cannot extend to the next row of sprites
- the gaps between the sprites need to be at least (but can be any more): 2 column of pixels horizontally, and 6 row of pixels vertically between the highest sprite, and the upper edge of the next row
You can make as many sprite blocks as you want, each having a different .pcx, the only requirement is, that one vehicle's sprites be in one file. Although one .pcx file must not contain more than 500 sprites, this is a limitation of the implementation.
After creating such sprite blocks, you select individual sprites with the right mouse button, or full rows with middle one. Only sprites selected in a block are actually part of that graphic ID block. That means, that one image file can contain many sets' sprites, and you can select any subset of them.

Szappy

-edit- corrected RMB/MMB
Attachments
An example (from the japan set)
An example (from the japan set)
ex.png (2.89 KiB) Viewed 4661 times
Last edited by Szappy on 13 Oct 2005 06:34, edited 1 time in total.
Image please use email instead of PM
User avatar
jvassie
Tycoon
Tycoon
Posts: 3421
Joined: 18 Dec 2002 18:00
Location: High Wycombe, England
Contact:

Post by jvassie »

Cheers for the reply! :D

Could you explain in more detail what RMB and MMB are please?

Also how do i select which sprite i want in that screen?

Cheers
James
(British) Modular Stations Set - Thread: | Website:
Swiss Set - Thread: | Website:
Route Map Creator
My Screenshot Thread
RK
Transport Coordinator
Transport Coordinator
Posts: 264
Joined: 13 Oct 2003 10:43
Location: Dortmund, Germany

Post by RK »

the select the sprites with the the Right Mouse Button, or the full row with the Middle Mouse Button. (you need 4 or 8 sprites for a vehicle)


@ Szappy
why you don't release a FAQ instead explaining it to every user
User avatar
Szappy
Chief Executive
Chief Executive
Posts: 689
Joined: 29 Mar 2004 14:35
Location: Budapest, Hungary
Contact:

Post by Szappy »

RK wrote:@ Szappy
why you don't release a FAQ instead explaining it to every user
You're right, I should.
But since it's here now, I can just link to it ;)
someday I may write a walkthrough for a simple vehicle coding, but that won't happen anytime soon, I'm afraid.
Image please use email instead of PM
User avatar
Purno
Tycoon
Tycoon
Posts: 16659
Joined: 30 Mar 2004 12:30
Location: Almere, The Netherlands

Post by Purno »

jamesvassie wrote:Could you explain in more detail what RMB and MMB are please?
Right Mouse Button and Middle Mouse Button? Pure guess...
Contributor to the The 2cc Set and Dutch Trainset. Inventor of the Metro concept. Retired Graphics Artist.
Image Image
Download TT | Latest TTDPatch | OpenTTD | OpenTTDCoop | BaNaNaS: OpenTTD content system | 2048² OTTD scenario of the Netherlands
GRF Codec | GRF Crawler | GRF Maker | Usefull graphics & tools sites | NML Documentation Wiki | NFO Documentation Wiki
All my graphics are licensed under GPL. "Always remember you're unique, just like everyone else."
User avatar
jvassie
Tycoon
Tycoon
Posts: 3421
Joined: 18 Dec 2002 18:00
Location: High Wycombe, England
Contact:

Post by jvassie »

Ok another thing ive found, may be a bug, not sure...

If i create my sprites in paint using the correct colours and save it as a 256 colour bmp file, then that loads in grfmaker no probs, but if i convert it to a pcx file then i get a range check error....

The thing is my graphics get all screwed up 'cos of the file compression. Is it possible to add other types of ffiles? best i think would be png, then it can get shown in the forum and its easier to use :wink:

Cheers
James
(British) Modular Stations Set - Thread: | Website:
Swiss Set - Thread: | Website:
Route Map Creator
My Screenshot Thread
BobDendry
Tycoon
Tycoon
Posts: 2215
Joined: 06 May 2004 09:10
Location: Sydney

Post by BobDendry »

way I do it is this: if you are using paint is to open it in paint, save it as a 24-bit bitmap, open GRFMaker's sprite editor, press 'import true color bitmap' and select the file you just saved.
AS for the range check error, I believe it has something to do with either the numbers made by GRFCodec, or there may be two different coloured background whites in there.
Last edited by BobDendry on 23 Oct 2005 00:35, edited 1 time in total.
User avatar
Hyronymus
Tycoon
Tycoon
Posts: 13235
Joined: 03 Dec 2002 10:36
Location: The Netherlands
Contact:

Post by Hyronymus »

James, GRFmaker supports bmp ONLY. It's not my favourite graphics format either but it just works like that (I thought it had to do with GRFmaker internals).
BobDendry
Tycoon
Tycoon
Posts: 2215
Joined: 06 May 2004 09:10
Location: Sydney

Post by BobDendry »

PNG would be too complicated to implement, because it has such a large library, that's what I heard
User avatar
krtaylor
Tycoon
Tycoon
Posts: 11784
Joined: 07 Feb 2003 01:58
Location: Texas, USA
Contact:

Post by krtaylor »

Are there open-source converter algorithms, so it could read PNG and GIF simply by converting them to BMP and taking it from there?
Development Projects Site:
http://www.as-st.com/ttd
Japan, American Transition, Planeset, and Project Generic Stations available there
User avatar
Hyronymus
Tycoon
Tycoon
Posts: 13235
Joined: 03 Dec 2002 10:36
Location: The Netherlands
Contact:

Post by Hyronymus »

What could possibly the benefit of that? It only adds an extra vulnerability to the proces.
User avatar
orudge
Administrator
Administrator
Posts: 25223
Joined: 26 Jan 2001 20:18
Skype: orudge
Location: Banchory, UK
Contact:

Post by orudge »

WhiteHand wrote:PNG would be too complicated to implement, because it has such a large library, that's what I heard
I'm not sure about languages other than C, but the PNG programming interface isn't too difficult to use at all - I've used it a few times now with minimal effort.
User avatar
Szappy
Chief Executive
Chief Executive
Posts: 689
Joined: 29 Mar 2004 14:35
Location: Budapest, Hungary
Contact:

Post by Szappy »

Hyronymus wrote:James, GRFmaker supports bmp ONLY. It's not my favourite graphics format either but it just works like that (I thought it had to do with GRFmaker internals).
You're actually wrong. GRFMaker supports .bmp and .pcx for quite some time now.
If jamesvassie got a range checking error, then it could be an error in the pcx conversion algorithm. Please, jamesvassie post the pcx involved, so gl2 can check if it's a bug, or a problem with MSPaint.

As for the .png, it has a complicated compression algorithm, and haven't got around to implementing it, but it's in the todo list ;)
Image please use email instead of PM
User avatar
jvassie
Tycoon
Tycoon
Posts: 3421
Joined: 18 Dec 2002 18:00
Location: High Wycombe, England
Contact:

Post by jvassie »

Ok glad to hear about future png's! :D

How shall i send it, the forums dont loike pcx's!


James
(British) Modular Stations Set - Thread: | Website:
Swiss Set - Thread: | Website:
Route Map Creator
My Screenshot Thread
User avatar
Hyronymus
Tycoon
Tycoon
Posts: 13235
Joined: 03 Dec 2002 10:36
Location: The Netherlands
Contact:

Post by Hyronymus »

Szappy wrote:
Hyronymus wrote:James, GRFmaker supports bmp ONLY. It's not my favourite graphics format either but it just works like that (I thought it had to do with GRFmaker internals).
You're actually wrong. GRFMaker supports .bmp and .pcx for quite some time now.
Why wasn't I told so :(.
User avatar
Szappy
Chief Executive
Chief Executive
Posts: 689
Joined: 29 Mar 2004 14:35
Location: Budapest, Hungary
Contact:

Post by Szappy »

jamesvassie wrote:How shall i send it, the forums dont loike pcx's!
Zip/rar it maybe? ;)
Hyronymus wrote:Why wasn't I told so :(.
err... dunno... maybe you didn't get my mail... gmail doesn't like my yahoo account, you know...
Image please use email instead of PM
Post Reply

Return to “NewGRF Technical Discussions”

Who is online

Users browsing this forum: No registered users and 19 guests