GRF encoder tool: GRFMaker [under development]

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

Moderator: Graphics Moderators

User avatar
NekoMaster
Tycoon
Tycoon
Posts: 4001
Joined: 16 Aug 2008 22:26
Skype: neko-master
Location: Oshawa, Ontario, CANADA

Re: GRF encoder tool: GRFMaker [under development]

Post by NekoMaster »

It would be nice if the Running cost of things could be set higher in GRFmaker, because a ALCO Century 855 I made, which should cost A LOT to run, is cheaper then a EMD GP9 to run. Anything over 255x just gets messed up |
Image Proud Canadian Image
Nekomasters Projects! (Downloads available on BaNaNaS!) \(>^w^<)/
# NARS ADD-ON SET 2CC | 2cc Rapid Transit For Me! (2ccRTFM) | 2cc Wagons In NML (2ccWIN)
# NML Category System (Organize your GRFS!) <- TT-Forums Exclusive Download!
User avatar
krtaylor
Tycoon
Tycoon
Posts: 11784
Joined: 07 Feb 2003 01:58
Location: Texas, USA
Contact:

Re: GRF encoder tool: GRFMaker [under development]

Post by krtaylor »

I don't think that has anything to do with GRF Maker, there was a limitation in TTD itself. There is a way around it but I don't know what it is in coding.
Development Projects Site:
http://www.as-st.com/ttd
Japan, American Transition, Planeset, and Project Generic Stations available there
User avatar
NekoMaster
Tycoon
Tycoon
Posts: 4001
Joined: 16 Aug 2008 22:26
Skype: neko-master
Location: Oshawa, Ontario, CANADA

Re: GRF encoder tool: GRFMaker [under development]

Post by NekoMaster »

krtaylor wrote:I don't think that has anything to do with GRF Maker, there was a limitation in TTD itself. There is a way around it but I don't know what it is in coding.
Well My Alco C855's runing cost starts at the make grfmaker running cost of 12,550 USD (255x) And thats very cheap compard to smaller, less powerful locomotives
Image Proud Canadian Image
Nekomasters Projects! (Downloads available on BaNaNaS!) \(>^w^<)/
# NARS ADD-ON SET 2CC | 2cc Rapid Transit For Me! (2ccRTFM) | 2cc Wagons In NML (2ccWIN)
# NML Category System (Organize your GRFS!) <- TT-Forums Exclusive Download!
phedon
Engineer
Engineer
Posts: 23
Joined: 13 Jun 2010 11:34

Re: GRF encoder tool: GRFMaker [under development]

Post by phedon »

Hi,
the edit->import nfo works (most times, sometimes not).
maybe i'll change the drawing code a little (colorpicking with rmb).
last day of my vacations has to be productive :lol:

-p-
:tipp | hint:
:Alles, was ich schreibe, bezieht sich ausschließlich auf OpenTTD:
:Everything I write solely refers to OpenTTD:
User avatar
AndersI
Tycoon
Tycoon
Posts: 1732
Joined: 19 Apr 2004 20:09
Location: Sweden
Contact:

Re: GRF encoder tool: GRFMaker [under development]

Post by AndersI »

NekoMaster wrote:It would be nice if the Running cost of things could be set higher in GRFmaker
This has absolutely, completely, nothing to do with GRFMaker. The costs are 0..255 and that can be set. What it actually means in game depends on base costs and inflation.
frosch
OpenTTD Developer
OpenTTD Developer
Posts: 988
Joined: 20 Dec 2006 13:31
Location: Aschaffenburg

Re: GRF encoder tool: GRFMaker [under development]

Post by frosch »

You can set higher running costs for a single vehicle using callback 36 (though higher values than 255 are likely OTTD-only).
You can generally increase running cost for all vehicle of a grf by using the base cost multipliers. (Action 0 feature 8 "general variables")

As usual I have no idea how to do any of these with GrfMaker, but it is very likely possible :)
⢇⡸⢸⠢⡇⡇⢎⡁⢎⡱⢸⡱⢸⣭⠀⢸⢜⢸⢸⣀⢸⣀⢸⣭⢸⡱⠀⢰⠭⡆⣫⠰⣉⢸⢸⠀⢰⠭⡆⡯⡆⢹⠁⠀⢐⠰⡁
User avatar
DJ Nekkid
Tycoon
Tycoon
Posts: 2141
Joined: 30 Nov 2006 20:33

Re: GRF encoder tool: GRFMaker [under development]

Post by DJ Nekkid »

that also applies to purchase costs, just so you know, both can use 15bit numbers :D
Member of the
ImageImage
phedon
Engineer
Engineer
Posts: 23
Joined: 13 Jun 2010 11:34

Re: GRF encoder tool: GRFMaker [under development]

Post by phedon »

frosch wrote:You can set higher running costs for a single vehicle using callback 36 (though higher values than 255 are likely OTTD-only).
You can generally increase running cost for all vehicle of a grf by using the base cost multipliers. (Action 0 feature 8 "general variables")

As usual I have no idea how to do any of these with GrfMaker, but it is very likely possible :)
Maybe in [general] [base cost block] ?

BUT: you can set only a value of 128, shouldn't this be max 255 (FFh) ? According to the wiki it should be (atleast) FFh.

:p:
:tipp | hint:
:Alles, was ich schreibe, bezieht sich ausschließlich auf OpenTTD:
:Everything I write solely refers to OpenTTD:
michael blunck
Tycoon
Tycoon
Posts: 5948
Joined: 27 Apr 2005 07:09
Contact:

Re: GRF encoder tool: GRFMaker [under development]

Post by michael blunck »

phedon wrote: According to the wiki it should be (atleast) FFh.
The relevant page is this one.

Note that the default value of each property is "08", leaving the base cost unchanged. Incrementing the property doubles the base cost, and decrementing bisects it. I.e.:

08 -> default value

07 -> 1/2
06 -> 1/4
05 -> 1/8
...

09 -> 2*
0a -> 4*
0b -> 8*
...

HTH
regards
Michael
Image
phedon
Engineer
Engineer
Posts: 23
Joined: 13 Jun 2010 11:34

Re: GRF encoder tool: GRFMaker [under development]

Post by phedon »

thx michael!

as already mentioned, I'm a noob, so what the code would look like?

xx * 07 00 00 01 01 01 08 09

07 // code size
00 // Action 0
00 // feature: train
01 // changed properties
01 // no. of affected vehicles
01 // id of first affected vehicle
08 // change property 8 to..
09 // 09 -> 2*


?(

phedon
:tipp | hint:
:Alles, was ich schreibe, bezieht sich ausschließlich auf OpenTTD:
:Everything I write solely refers to OpenTTD:
michael blunck
Tycoon
Tycoon
Posts: 5948
Joined: 27 Apr 2005 07:09
Contact:

Re: GRF encoder tool: GRFMaker [under development]

Post by michael blunck »

phedon wrote:
xx * 07 00 00 01 01 01 08 09

07 // code size
00 // Action 0
00 // feature: train
01 // changed properties
01 // no. of affected vehicles
01 // id of first affected vehicle
08 // change property 8 to..
09 // 09 -> 2*
Not quite:

Code: Select all

xx * 07      00 08 01 01 2a 08 09

07 // code size
00 // Action 0
08 // feature: general variables
01 // changed properties
01 // no. of modified cost base multipliers
2a // first affected cost base multiplier
08 // -> prop08: Cost base multipliers
09 // 09 -> 2* 
Ah, you did edit it while I was typing ... :cool:

[edit] BTW, "steam engine running cost" would be number 2a (42d) [/edit]

regards
Michael
Image
phedon
Engineer
Engineer
Posts: 23
Joined: 13 Jun 2010 11:34

Re: GRF encoder tool: GRFMaker [under development]

Post by phedon »

yeah, i found an obvious error :roll:
so, i think, the easiest for me would be to write a "decompiler" for nfo/grf files to learn as much as possible about this whole grf-thing.
Is there any complete reference about the opcodes? Or do I have to crawl through this? The existing tools like grfreader / grfmaker where made for ttd, not openttd, but with openttd so many things where added, I think. Is this correct?

from noob to pro - with michael blunck :bow:

p
:tipp | hint:
:Alles, was ich schreibe, bezieht sich ausschließlich auf OpenTTD:
:Everything I write solely refers to OpenTTD:
michael blunck
Tycoon
Tycoon
Posts: 5948
Joined: 27 Apr 2005 07:09
Contact:

Re: GRF encoder tool: GRFMaker [under development]

Post by michael blunck »

phedon wrote: so, i think, the easiest for me would be to write a "decompiler" for nfo/grf files to learn as much as possible about this whole grf-thing.
The "compiler/decompiler" for newgrfs is called grfcodec. Although it does compile nfo/pcx to grf, vice versa.

You may take a look on the Grf2Html tool for a more human-readable view of what´s inside a newgrf.
phedon wrote: But Is there any complete reference about the opcodes? Or do I have to crawl through this?
The technical reference can be found here.
phedon wrote: The existing tools like grfreader / grfmaker where made for ttd, not openttd, but with openttd so many things where added, I think. Is this correct?
Not really. The nfo spec is recognized both by TTDPatch and OTTD, i.e. grfcodec compiles for both programs. However, whether tools like grfmaker do reflect the status of recently introduced features of nfo, I can´t tell.

regards
Michael
Image
User avatar
technosnorunt58
Engineer
Engineer
Posts: 79
Joined: 09 Nov 2008 00:59

Re: GRF encoder tool: GRFMaker [under development]

Post by technosnorunt58 »

When I use GRFMaker I get up to the point where you import the sprites and it doesn't know if my sprites are sprites.
Attachments
ERR1.GIF
ERR1.GIF (34.94 KiB) Viewed 2430 times
ERR2.GIF
ERR2.GIF (29.03 KiB) Viewed 2430 times
phedon
Engineer
Engineer
Posts: 23
Joined: 13 Jun 2010 11:34

Re: GRF encoder tool: GRFMaker [under development]

Post by phedon »

You can either click on the single sprite with the middle mouse button (doesn't work for me, but is mentioned as (delphi) bug by the programmers)
or click once with the left mouse button on the sprite followed by a click with the right mouse button on it. do this for all sprites, you kneed (4 or 8). this will activate the single sprites in the bottom left property window..
it's described in the tutorial you can find here

:p:
:tipp | hint:
:Alles, was ich schreibe, bezieht sich ausschließlich auf OpenTTD:
:Everything I write solely refers to OpenTTD:
User avatar
technosnorunt58
Engineer
Engineer
Posts: 79
Joined: 09 Nov 2008 00:59

Re: GRF encoder tool: GRFMaker [under development]

Post by technosnorunt58 »

oops...didn't know abot the tutorial...
User avatar
NekoMaster
Tycoon
Tycoon
Posts: 4001
Joined: 16 Aug 2008 22:26
Skype: neko-master
Location: Oshawa, Ontario, CANADA

Re: GRF encoder tool: GRFMaker [under development]

Post by NekoMaster »

just right click on each set of sprites you need, selected sprites are bordered in red
Image Proud Canadian Image
Nekomasters Projects! (Downloads available on BaNaNaS!) \(>^w^<)/
# NARS ADD-ON SET 2CC | 2cc Rapid Transit For Me! (2ccRTFM) | 2cc Wagons In NML (2ccWIN)
# NML Category System (Organize your GRFS!) <- TT-Forums Exclusive Download!
User avatar
technosnorunt58
Engineer
Engineer
Posts: 79
Joined: 09 Nov 2008 00:59

Re: GRF encoder tool: GRFMaker [under development]

Post by technosnorunt58 »

Now I get this.
Attachments
ERR3.GIF
ERR3.GIF (24.18 KiB) Viewed 2407 times
User avatar
technosnorunt58
Engineer
Engineer
Posts: 79
Joined: 09 Nov 2008 00:59

Re: GRF encoder tool: GRFMaker [under development]

Post by technosnorunt58 »

Also when I try to encode in GRFCodec I get,
Error: ysize to large
phedon
Engineer
Engineer
Posts: 23
Joined: 13 Jun 2010 11:34

Re: GRF encoder tool: GRFMaker [under development]

Post by phedon »

If you post the bmp/pcx or send me a mail, I could check it out.
Pls have a look here and here (there's part two of the tutorial about grfmaker).

Regarding to the error message: try repositioning the single sprites - same space between the single sprites, same offset, maybay this solves the error..


Regards

:p:
:tipp | hint:
:Alles, was ich schreibe, bezieht sich ausschließlich auf OpenTTD:
:Everything I write solely refers to OpenTTD:
Post Reply

Return to “NewGRF Technical Discussions”

Who is online

Users browsing this forum: No registered users and 13 guests