NML/NFO to GRF Related problem......
Moderator: Graphics Moderators
Re: NML/NFO to GRF Related problem......
I think those platforms should be below street level?
-
- Tycoon
- Posts: 5954
- Joined: 27 Apr 2005 07:09
- Contact:
Re: NML/NFO to GRF Related problem......
Your tile layout is faulty:Yoursnotmine wrote: [...]
Could you spot the problem ? I suspect its due to the boundingboxes and wrong sprite placing, but I don't know how and where to change it...Code: Select all
7 * 62 00 04 02 01 00 08 "UDBL" 09 02 F4 03 00 00 00 00 00 10 05 03 2D 84 00 00 00 00 00 10 10 7A 2E 84 00 00 80 F3 03 00 00 00 00 00 05 10 03 2F 84 00 00 00 00 00 10 10 7A 30 84 00 00 80
regardsCode: Select all
7 * 62 00 04 02 01 00 08 "UDBL" 09 02 F4 03 00 00 00 00 00 10 05 03 2D 84 00 00 00 00 00 10 10 7A 2E 84 00 00 80 // <-- F3 03 00 00 00 00 00 05 10 03 2F 84 00 00 00 00 00 10 10 7A 30 84 00 00 80 // <--
Michael
Re: NML/NFO to GRF Related problem......
Well, it should give the same appearence like FooBar Underground Metro track. (And I develop these regarding that)Yoshi wrote:I think those platforms should be below street level?
@ michael blunk : thank you, I'll try to change that and see the result.
YNM = yoursNotMine - Don't get it ?
「ヨーッスノットマイン」もと申します。
「ヨーッスノットマイン」もと申します。
Re: NML/NFO to GRF Related problem......
Sorry for doublepost appearence
@ michael blunk : hmm, your code in quote are just the same with my posted code ; still same thing.
But probably you doesn't understand what I mean and what I want....
In my attached image, you can see the purple boxes covering tiles : that is the real location of the tile of the station. I get a problem likely with sprite offset. As I'm new in NFO, I dont know yet how to change them, as NFO likely gets hard to understand by people without experience like me. (by means of using all-hex number
)
Could any of you explain how to change the offset ? I get to sprite aligner to change offset and it all looks OK, but thats temporary.
EDIT : heres the fixed by sprite aligner one :
@ michael blunk : hmm, your code in quote are just the same with my posted code ; still same thing.
But probably you doesn't understand what I mean and what I want....
In my attached image, you can see the purple boxes covering tiles : that is the real location of the tile of the station. I get a problem likely with sprite offset. As I'm new in NFO, I dont know yet how to change them, as NFO likely gets hard to understand by people without experience like me. (by means of using all-hex number

Could any of you explain how to change the offset ? I get to sprite aligner to change offset and it all looks OK, but thats temporary.
EDIT : heres the fixed by sprite aligner one :
- Attachments
-
- Station problem 21922192593.png (114.63 KiB) Viewed 1073 times
YNM = yoursNotMine - Don't get it ?
「ヨーッスノットマイン」もと申します。
「ヨーッスノットマイン」もと申します。
Re: NML/NFO to GRF Related problem......
You indeed need to change the offset in your code, spritealigner says X= -31 and Y= -91.
Your code for that sprite says:
Change -83 to -91 and it should be ok.
Your code for that sprite says:
Code: Select all
5 C:\Users\THINKCENTRE\Pictures\Projects\Metro_Station\metroRET_blue.pcx 169 268 01 122 64 -31 -83
Projects: http://www.tt-forums.net/viewtopic.php?f=26&t=57266
Screenshots: http://www.tt-forums.net/viewtopic.php?f=47&t=56959
Scenario of The Netherlands: viewtopic.php?f=60&t=87604
Winner of the following screenshot competitions:
sep 2012, jan 2013, apr 2013, aug 2013, mar 2014, mar 2016, oct 2020
All my work is released under GPL-license (either V2 or V3), if not clearly stated otherwise.
Screenshots: http://www.tt-forums.net/viewtopic.php?f=47&t=56959
Scenario of The Netherlands: viewtopic.php?f=60&t=87604
Winner of the following screenshot competitions:
sep 2012, jan 2013, apr 2013, aug 2013, mar 2014, mar 2016, oct 2020
All my work is released under GPL-license (either V2 or V3), if not clearly stated otherwise.
Re: NML/NFO to GRF Related problem......
Oh, so thats how ? Thanks ! (well, I got all sprite have wrong offset
I know how to do those in NML, but I have no idea about that in NFO
)


YNM = yoursNotMine - Don't get it ?
「ヨーッスノットマイン」もと申します。
「ヨーッスノットマイン」もと申します。
-
- Tycoon
- Posts: 5954
- Joined: 27 Apr 2005 07:09
- Contact:
Re: NML/NFO to GRF Related problem......
That IS your code. Only re-arragend for better visibility.Yoursnotmine wrote: @ michael blunk : hmm, your code in quote are just the same with my posted code ; still same thing.

First thing to do would be to fix the tile layout, simply because both the coordinates given there, AND the sprite offsets given for the real sprites will count for the display on-screen. (Edit: sprite offsets like -91 are clearly wrong!)Yoursnotmine wrote: But probably you doesn't understand what I mean and what I want....
In my attached image, you can see the purple boxes covering tiles : that is the real location of the tile of the station. I get a problem likely with sprite offset.
Take a look on http://www.ttdpatch.de/grfspecs/m4nfoMa ... tions.html .Yoursnotmine wrote: As I'm new in NFO, I dont know yet how to change them, as NFO likely gets hard to understand by people without experience like me. (by means of using all-hex number)
Even if you don´t use m4nfo for station coding, this should give you a better general understanding how to set up your nfo code.
regards
Michael
Re: NML/NFO to GRF Related problem......
Well I dare to disagree(Edit: sprite offsets like -91 are clearly wrong!)

For as far as I understand the coding, the offsets depend on the sizes of the blue boxes you drawn your graphics in, so with the boxes that he uses the -91 is very logical. Correct me if I'm wrong but as far as I know it works like this:
Projects: http://www.tt-forums.net/viewtopic.php?f=26&t=57266
Screenshots: http://www.tt-forums.net/viewtopic.php?f=47&t=56959
Scenario of The Netherlands: viewtopic.php?f=60&t=87604
Winner of the following screenshot competitions:
sep 2012, jan 2013, apr 2013, aug 2013, mar 2014, mar 2016, oct 2020
All my work is released under GPL-license (either V2 or V3), if not clearly stated otherwise.
Screenshots: http://www.tt-forums.net/viewtopic.php?f=47&t=56959
Scenario of The Netherlands: viewtopic.php?f=60&t=87604
Winner of the following screenshot competitions:
sep 2012, jan 2013, apr 2013, aug 2013, mar 2014, mar 2016, oct 2020
All my work is released under GPL-license (either V2 or V3), if not clearly stated otherwise.
-
- Tycoon
- Posts: 5954
- Joined: 27 Apr 2005 07:09
- Contact:
Re: NML/NFO to GRF Related problem......
<takes a look> Hehe, yeah. That amount of "excessive blue" is utter nonsense.Quast65 wrote:Well I dare to disagree(Edit: sprite offsets like -91 are clearly wrong!)
For as far as I understand the coding, the offsets depend on the sizes of the blue boxes you drawn your graphics in, so with the boxes that he uses the -91 is very logical.
Anyway, he should first get his tile layout right, and then fix the sprite offsets, rather than trying to "arrange" the offsets in the first place. Which would only encourage the sprite sorter to complain.
regards
Michael
Re: NML/NFO to GRF Related problem......
I struggled with this for a while. Your offsets are fine, but if you don't have the correct compression setting, the extra blue space is discarded and that messes up the calculation for the offset once the sprite is drawn in game.Yoursnotmine wrote:Could any of you explain how to change the offset ? I get to sprite aligner to change offset and it all looks OK, but thats temporary.
So, assuming you want to use Quast65's templates, go back to your realsprite definitions and change the compression (column 5) from 01 to 49 -- bit field flags for "blue is transparent," "use tile compression," and "do not crop." Then change the offsets back to what Quast65 recommended.
For example:
Code: Select all
3 C:\Users\THINKCENTRE\Pictures\Projects\Metro_Station\metroRET_blue.pcx 9 268 49 122 64 -31 -91
4 C:\Users\THINKCENTRE\Pictures\Projects\Metro_Station\metroRET_blue.pcx 89 268 49 122 64 -31 -91
5 C:\Users\THINKCENTRE\Pictures\Projects\Metro_Station\metroRET_blue.pcx 169 268 49 122 64 -31 -91
6 C:\Users\THINKCENTRE\Pictures\Projects\Metro_Station\metroRET_blue.pcx 249 268 49 122 64 -31 -91
Jim
______________________________________________________________________________________________

Train GIFs from Frograil
______________________________________________________________________________________________
Train GIFs from Frograil
Re: NML/NFO to GRF Related problem......
Dare to show me how to fix the tile layout ? The m4nfo likely don't uses the all hex number, rather it likely uses something halfway between NML and NFO... And so I don't get how to do itmichael blunck wrote: Anyway, he should first get his tile layout right, and then fix the sprite offsets, rather than trying to "arrange" the offsets in the first place. Which would only encourage the sprite sorter to complain.
regards
Michael

EDIT : @ jmodule : thanks

@ All : I'm no longer on my computer, so you may tell me something which I may understand.
YNM = yoursNotMine - Don't get it ?
「ヨーッスノットマイン」もと申します。
「ヨーッスノットマイン」もと申します。
Re: NML/NFO to GRF Related problem......
And as a little addition to yoursnotmine's request to Michael (because I'm also curious to understand a bit more of that particular piece of code), please bear in mind that the idea of the code I suggested in my "station tile code for dummies" thread (that is the piece of code that yoursnotmine used as his base code) is that one uses standard templates as a base for graphics (hence the use of excessive blue, it leaves room for big buildings) with also the corresponding big bounding boxes.
The idea is that one doesn't have to make changes in the code when adding more stationtiles, except for the ID's and the position of the graphics in the graphicsfile.
@Jmodule, Interesting suggestion. So does setting the compression to 49 make it easier for the game to ignore the transparant blue and therefor easier for it to place it in the game and thus making the game a bit faster?
The idea is that one doesn't have to make changes in the code when adding more stationtiles, except for the ID's and the position of the graphics in the graphicsfile.
@Jmodule, Interesting suggestion. So does setting the compression to 49 make it easier for the game to ignore the transparant blue and therefor easier for it to place it in the game and thus making the game a bit faster?
Projects: http://www.tt-forums.net/viewtopic.php?f=26&t=57266
Screenshots: http://www.tt-forums.net/viewtopic.php?f=47&t=56959
Scenario of The Netherlands: viewtopic.php?f=60&t=87604
Winner of the following screenshot competitions:
sep 2012, jan 2013, apr 2013, aug 2013, mar 2014, mar 2016, oct 2020
All my work is released under GPL-license (either V2 or V3), if not clearly stated otherwise.
Screenshots: http://www.tt-forums.net/viewtopic.php?f=47&t=56959
Scenario of The Netherlands: viewtopic.php?f=60&t=87604
Winner of the following screenshot competitions:
sep 2012, jan 2013, apr 2013, aug 2013, mar 2014, mar 2016, oct 2020
All my work is released under GPL-license (either V2 or V3), if not clearly stated otherwise.
Re: NML/NFO to GRF Related problem......
No, it makes it slower by disallowing cropping (but unless you pass the -c option to grfcodec, there is no cropping anyway). Cropping produces smaller GRF files, but with it the offsets shown in-game will not match the ones in the NFO file.Quast65 wrote:So does setting the compression to 49 make it easier for the game to ignore the transparant blue and therefor easier for it to place it in the game and thus making the game a bit faster?
-- Michael Lutz
Re: NML/NFO to GRF Related problem......
I see, so what is the real advantage of changing the compression to 49 then?
Projects: http://www.tt-forums.net/viewtopic.php?f=26&t=57266
Screenshots: http://www.tt-forums.net/viewtopic.php?f=47&t=56959
Scenario of The Netherlands: viewtopic.php?f=60&t=87604
Winner of the following screenshot competitions:
sep 2012, jan 2013, apr 2013, aug 2013, mar 2014, mar 2016, oct 2020
All my work is released under GPL-license (either V2 or V3), if not clearly stated otherwise.
Screenshots: http://www.tt-forums.net/viewtopic.php?f=47&t=56959
Scenario of The Netherlands: viewtopic.php?f=60&t=87604
Winner of the following screenshot competitions:
sep 2012, jan 2013, apr 2013, aug 2013, mar 2014, mar 2016, oct 2020
All my work is released under GPL-license (either V2 or V3), if not clearly stated otherwise.
-
- Tycoon
- Posts: 5954
- Joined: 27 Apr 2005 07:09
- Contact:
Re: NML/NFO to GRF Related problem......
Well, "49" means "sprite should not be cropped" AND "sprite is in chunked data format (aka "tile compression")", i.e., preserve the "excessive blue", but compress the sprite, i.e., mostly that "excessive blue".Quast65 wrote:I see, so what is the real advantage of changing the compression to 49 then?
Although, in general, there´s no use for "excessive blue", but only for two reasons:
- to explicitly manipulate the bounding box,
- to be able to position child sprites w/r to the parent sprites.
Well, it´s all there - just read. Take a look at the examples.Yoursnotmine wrote: Dare to show me how to fix the tile layout ?
Again:
I had marked the corrupted lines.Code: Select all
7 * 62 00 04 02 01 00 08 "UDBL" 09 02 F4 03 00 00 00 00 00 10 05 03 2D 84 00 00 00 00 00 10 10 7A 2E 84 00 00 80 // <-- F3 03 00 00 00 00 00 05 10 03 2F 84 00 00 00 00 00 10 10 7A 30 84 00 00 80 // <--
Code: Select all
<groundsprite> {<xoffset> <yoffset> <zoffset> <xextent> <yextent> <zextent> <buildingsprite>} 80
Yoursnotmine wrote: The m4nfo likely don't uses the all hex number, rather it likely uses something halfway between NML and NFO... And so I don't get how to do it
regards
Michael
Re: NML/NFO to GRF Related problem......
Let me think of it :
I would feel so helped if you explain over this.
O/T : Now 00:15 local time - had to sleep....
Code: Select all
F4 03 00 00 -> is this is groundsprite ?
00 00 00 10 05 03 2D 84 -> xoffset yoffset zoffset ?
00 00 00 00 00 10 10 7A 2E 84 00 00 80 -> xextent yextent zextent buildingsprites ?
O/T : Now 00:15 local time - had to sleep....
YNM = yoursNotMine - Don't get it ?
「ヨーッスノットマイン」もと申します。
「ヨーッスノットマイン」もと申します。
Re: NML/NFO to GRF Related problem......
Code: Select all
F4 03 00 00 00 00 00 10 05 03 2D 84 00 00 00 00 00 10 10 7A 2E 84 00 00 80 F3 03 00 00 00 00 00 05 10 03 2F 84 00 00 00 00 00 10 10 7A 30 84 00 00 80
Code: Select all
F4 03 00 00 = groundsprite East-West direction
00 00 00 = xoffset yoffset zoffset Backgroundsprite E-W
10 05 03 = xextent yextent zextent Backgroundsprite E-W
2D 84 00 00 = buildingsprite
00 00 00 = xoffset yoffset zoffset Foregroundsprite E-W
10 10 7A = xextent yextent zextent Foregroundsprite E-W
2E 84 00 00 = buildingsprite
80 = End of spritelist for this tile
F3 03 00 00 = groundsprite North-South direction
00 00 00 = xoffset yoffset zoffset Backgroundsprite N-S
05 10 03 = xextent yextent zextent Backgroundsprite N-S
2F 84 00 00 = buildingsprite
00 00 00 = xoffset yoffset zoffset Foregroundsprite N-S
10 10 7A = xextent yextent zextent Foregroundsprite N-S
30 84 00 00 = buildingsprite
80 = End of spritelist for this tile
- first of all the values of the xextent yextent zextent are not the precise measurements of the graphics that have been drawn. But that is done to make a "universal" piece of code, to make it easier to code. If this causes major problems with the spritesorter, please let me know.
- The number of the buildingsprite. To be honest I don't know exactly what this does... If anyone has more info about this, please share that with us.
Apart from these two things I can't see anything fundamentally wrong...
Projects: http://www.tt-forums.net/viewtopic.php?f=26&t=57266
Screenshots: http://www.tt-forums.net/viewtopic.php?f=47&t=56959
Scenario of The Netherlands: viewtopic.php?f=60&t=87604
Winner of the following screenshot competitions:
sep 2012, jan 2013, apr 2013, aug 2013, mar 2014, mar 2016, oct 2020
All my work is released under GPL-license (either V2 or V3), if not clearly stated otherwise.
Screenshots: http://www.tt-forums.net/viewtopic.php?f=47&t=56959
Scenario of The Netherlands: viewtopic.php?f=60&t=87604
Winner of the following screenshot competitions:
sep 2012, jan 2013, apr 2013, aug 2013, mar 2014, mar 2016, oct 2020
All my work is released under GPL-license (either V2 or V3), if not clearly stated otherwise.
Re: NML/NFO to GRF Related problem......
These are the comments I used to figure out the station layout:
The difference from what you show is the bounding box extents. For the south sprite I changed the z-offset to 8 pixels instead of 122 (0x7A) pixels.
Take a look at the attached files. I modified your NFO example earlier in the thread so that it ignores the extra space in the sprite template. I drew a pink box around the outside of the coordinates I used in the real sprite line in the NFO. If you do that, you no longer have to worry if grfcodec is going to crop the sprite and so the in-game offsets will match what you need in the NFO. It also means your offsets change considerable (at least the y-offset does). Instead of -91 I used -3 (and -9).
Hope that helps.
Code: Select all
F4 03 00 00 // ground sprite for X tile
00 00 00 // x,y,z offset of bounding box
10 05 03 // x,y,z extent for bounding box
2D 84 00 00 // north X sprite (842D = first in action 1 list)
00 00 00 // x,y,z offset
10 10 08// x,y,z extent
2E 84 00 00 // south X sprite (842E = second in list)
80 // end of building sprite list
Take a look at the attached files. I modified your NFO example earlier in the thread so that it ignores the extra space in the sprite template. I drew a pink box around the outside of the coordinates I used in the real sprite line in the NFO. If you do that, you no longer have to worry if grfcodec is going to crop the sprite and so the in-game offsets will match what you need in the NFO. It also means your offsets change considerable (at least the y-offset does). Instead of -91 I used -3 (and -9).
Hope that helps.
- Attachments
-
- metroRET.nfo
- (1.55 KiB) Downloaded 91 times
-
- metroRET_blue.png
- (20.91 KiB) Downloaded 1 time
Jim
______________________________________________________________________________________________

Train GIFs from Frograil
______________________________________________________________________________________________
Train GIFs from Frograil
-
- Tycoon
- Posts: 5954
- Joined: 27 Apr 2005 07:09
- Contact:
Re: NML/NFO to GRF Related problem......
The first sprite in the associated sprite block is (always) numbered 0x042D (this once was an original TTD sprite), i.e. LSB -> "2D 04". In the example, it has bit15 set as well -> 0x842D, which means it would be displayed in company colour, if drawn using the cc colour range.Quast65 wrote: [...] The number of the buildingsprite. To be honest I don't know exactly what this does... If anyone has more info about this, please share that with us.
regards
Michael
Re: NML/NFO to GRF Related problem......
Wow, thank you all for describing those numbers !
Can't use my computer now... I'll try it when I able to use it...
Can't use my computer now... I'll try it when I able to use it...
YNM = yoursNotMine - Don't get it ?
「ヨーッスノットマイン」もと申します。
「ヨーッスノットマイン」もと申します。
Who is online
Users browsing this forum: No registered users and 16 guests