Which numbers do what?
Moderator: Graphics Moderators
- Hector-Lavoe
- Engineer
- Posts: 15
- Joined: 13 Jan 2014 21:15
- Skype: the-hector-lavoe
- Location: Yorkshire
Which numbers do what?
Hi so I'm messing around with some tools and have somehow managed to edit a .grf, rename some stuff and even edit the textues. I have looked at the wiki and I'm finding it hard to understand what numbers do what here, I want to know how to change the positioning of the sprites and also stats of the busses, you know, speed, capacity etc. This is what I am working with, I used the .grf Bob's British Busses as a base for my testing.
0 * 4 35 03 00 00
1 * 27 08 06 "HRES" 01 00 "H Readmans European Set" 00 00
2 * 21 04 01 1F 01 00 "Bristol RE" 00
3 * 36 00 01 0F 01 00 00 54 33 03 32 04 32 06 0F 07 0A 08 80 09 63 0F 48 10 00 11 63 12 1A 13 0B 14 20
19 04 1C 02
4 * 6 01 01 01 FF 08 00
5 sprites/hres00.png 8bpp 98 8 8 20 -3 -12 normal
6 sprites/hres00.png 8bpp 114 8 16 19 -12 -9 normal
7 sprites/hres00.png 8bpp 146 8 20 16 -6 -10 normal
8 sprites/hres00.png 8bpp 178 8 16 19 -3 -10 normal
9 sprites/hres00.png 8bpp 210 8 8 20 -3 -12 normal
10 sprites/hres00.png 8bpp 226 8 16 19 -12 -8 normal
11 sprites/hres00.png 8bpp 258 8 20 16 -5 -9 normal
12 sprites/hres00.png 8bpp 290 8 16 19 -3 -9 normal
13 * 9 02 01 01 01 01 00 00 00 00
14 * 6 01 01 01 FF 01 00
15 sprites/hres00.png 8bpp 354 8 20 16 -10 -10 normal
16 * 9 02 01 11 01 01 00 00 00 00
17 * 7 00 01 01 01 00 0E FF
18 * 10 03 01 01 00 01 FF 11 00 01 00
19 * 29 04 01 1F 01 01 "Bristol VR" 00
20 * 36 00 01 0F 01 01 00 E2 3B 03 32 04 14 06 0F 07 0A 08 A0 09 63 0F 39 10 00 11 63 12 1A 13 0B 14 20
19 04 1C 02
21 * 6 01 01 01 FF 08 00
22 sprites/hres00.png 8bpp 482 8 8 20 -3 -12 normal
23 sprites/hres00.png 8bpp 498 8 16 19 -12 -9 normal
24 sprites/hres00.png 8bpp 530 8 20 16 -6 -10 normal
25 sprites/hres00.png 8bpp 562 8 16 19 -3 -10 normal
26 sprites/hres00.png 8bpp 594 8 8 20 -3 -12 normal
27 sprites/hres00.png 8bpp 610 8 16 19 -12 -8 normal
28 sprites/hres00.png 8bpp 642 8 20 16 -5 -9 normal
29 sprites/hres00.png 8bpp 674 8 16 19 -3 -9 normal
30 * 9 02 01 01 01 01 00 00 00 00
31 * 6 01 01 01 FF 01 00
32 sprites/hres00.png 8bpp 738 8 20 16 -10 -10 normal
33 * 9 02 01 11 01 01 00 00 00 00
34 * 7 00 01 01 01 01 0E FF
35 * 10 03 01 01 01 01 FF 11 00 01 00
As you can see I have figures some out.
0 * 4 35 03 00 00
1 * 27 08 06 "HRES" 01 00 "H Readmans European Set" 00 00
2 * 21 04 01 1F 01 00 "Bristol RE" 00
3 * 36 00 01 0F 01 00 00 54 33 03 32 04 32 06 0F 07 0A 08 80 09 63 0F 48 10 00 11 63 12 1A 13 0B 14 20
19 04 1C 02
4 * 6 01 01 01 FF 08 00
5 sprites/hres00.png 8bpp 98 8 8 20 -3 -12 normal
6 sprites/hres00.png 8bpp 114 8 16 19 -12 -9 normal
7 sprites/hres00.png 8bpp 146 8 20 16 -6 -10 normal
8 sprites/hres00.png 8bpp 178 8 16 19 -3 -10 normal
9 sprites/hres00.png 8bpp 210 8 8 20 -3 -12 normal
10 sprites/hres00.png 8bpp 226 8 16 19 -12 -8 normal
11 sprites/hres00.png 8bpp 258 8 20 16 -5 -9 normal
12 sprites/hres00.png 8bpp 290 8 16 19 -3 -9 normal
13 * 9 02 01 01 01 01 00 00 00 00
14 * 6 01 01 01 FF 01 00
15 sprites/hres00.png 8bpp 354 8 20 16 -10 -10 normal
16 * 9 02 01 11 01 01 00 00 00 00
17 * 7 00 01 01 01 00 0E FF
18 * 10 03 01 01 00 01 FF 11 00 01 00
19 * 29 04 01 1F 01 01 "Bristol VR" 00
20 * 36 00 01 0F 01 01 00 E2 3B 03 32 04 14 06 0F 07 0A 08 A0 09 63 0F 39 10 00 11 63 12 1A 13 0B 14 20
19 04 1C 02
21 * 6 01 01 01 FF 08 00
22 sprites/hres00.png 8bpp 482 8 8 20 -3 -12 normal
23 sprites/hres00.png 8bpp 498 8 16 19 -12 -9 normal
24 sprites/hres00.png 8bpp 530 8 20 16 -6 -10 normal
25 sprites/hres00.png 8bpp 562 8 16 19 -3 -10 normal
26 sprites/hres00.png 8bpp 594 8 8 20 -3 -12 normal
27 sprites/hres00.png 8bpp 610 8 16 19 -12 -8 normal
28 sprites/hres00.png 8bpp 642 8 20 16 -5 -9 normal
29 sprites/hres00.png 8bpp 674 8 16 19 -3 -9 normal
30 * 9 02 01 01 01 01 00 00 00 00
31 * 6 01 01 01 FF 01 00
32 sprites/hres00.png 8bpp 738 8 20 16 -10 -10 normal
33 * 9 02 01 11 01 01 00 00 00 00
34 * 7 00 01 01 01 01 0E FF
35 * 10 03 01 01 01 01 FF 11 00 01 00
As you can see I have figures some out.
Hej allesammen.
Re: Which numbers do what?
The usual approach is to look for the source code of a grf, find the number there, and then rebuild the grf.
To avoid getting very confused, always change the GRF ID and preferably the displayed text as well, so you can check which version is in each file. The license of a GRF tells you your rights and duties in the formal sense, a PM to the original author is generally nice too.
To avoid getting very confused, always change the GRF ID and preferably the displayed text as well, so you can check which version is in each file. The license of a GRF tells you your rights and duties in the formal sense, a PM to the original author is generally nice too.
Being a retired OpenTTD developer does not mean I know what I am doing.
Re: Which numbers do what?
Before we get into this, we should know what you have to work with. The code described in the NewGRF Specifications wiki is called NFO. It is written in Assembly language using hexadecimal notation.If you are familiar with the terms "assembly language" and "hexadecimal notation", then we can move on to the next level of assistance.Hector-Lavoe wrote:Hi so I'm messing around with some tools and have somehow managed to edit a .grf, rename some stuff and even edit the textues. I have looked at the wiki and I'm finding it hard to understand what numbers do what here, I want to know how to change the positioning of the sprites and also stats of the busses, you know, speed, capacity etc. This is what I am working with, I used the .grf Bob's British Busses as a base for my testing.
wallyweb on tt-forums: Screenshots - Wallyweb World - Projects & Releases
wallyweb on Simuscape: Projects - Releases
Other Stuff: TTDPatch 2.6 "Nightly" download - cirdan's OpenTTD branch (New Map Features)
Screenshot Of The Month Contest Winner: August 2015 - Tied May 2016 - January 2018 - December 2018 - May 2019
wallyweb on Simuscape: Projects - Releases
Other Stuff: TTDPatch 2.6 "Nightly" download - cirdan's OpenTTD branch (New Map Features)
Screenshot Of The Month Contest Winner: August 2015 - Tied May 2016 - January 2018 - December 2018 - May 2019
-
- Tycoon
- Posts: 5948
- Joined: 27 Apr 2005 07:09
- Contact:
Re: Which numbers do what?
In general, the nfo docs should be comprehensible, at least with regards to your questions (sprite positioning and vehicle stats).Hector-Lavoe wrote: I have looked at the wiki and I'm finding it hard to understand what numbers do what here, I want to know how to change the positioning of the sprites and also stats of the busses, you know, speed, capacity etc.
Sprite positioning happens here:
Code: Select all
5 sprites/hres00.png 8bpp 98 8 8 20 -3 -12 normal
Vehicle stats are defined in your "action 0":
Code: Select all
3 * 36 00 01 0F 01 00 00 54 33 03 32 04 32 06 0F 07 0A 08 80 09 63 0F 48 10 00 11 63 12 1A 13 0B 14 20
19 04 1C 02
Code: Select all
3 * 36 00 01 0F 01 00 // define 15 properties for roadveh-ID = 00
00 54 33 // date of introduction = 1-1-1920 + 13140 days -> ~1956 (plus random amount)
03 32 // vehicle life in years = 50
04 32 // model life in years = 50
06 0F // climate availability = all climates
07 0A // load amount = 10 units
08 80 // speed in mph*3.2 = 128
09 63 // running cost factor = 99
0F 48 // capacity = 72
10 00 // cargo type = passengers
11 63 // cost factor = 99
12 1A // sound effect = 26 (bus horn)
13 0B // power in 10 hp = 11 -> 110 hp
14 20 // weight in 1/4 tons = 32 -> 8 tons
19 04 // air drag coefficient = 4
1C 02 // vehicle flags = use two company colors
HTH
Michael
-
- Engineer
- Posts: 1
- Joined: 05 Jul 2017 21:50
Re: Which numbers do what?
Hello, I am not familiar with assembly language, but I have heard of hexadecimal notation, and after some searching, I think I understand it. Is it possible to help me?wallyweb wrote:Before we get into this, we should know what you have to work with. The code described in the NewGRF Specifications wiki is called NFO. It is written in Assembly language using hexadecimal notation.If you are familiar with the terms "assembly language" and "hexadecimal notation", then we can move on to the next level of assistance.Hector-Lavoe wrote:Hi so I'm messing around with some tools and have somehow managed to edit a .grf, rename some stuff and even edit the textues. I have looked at the wiki and I'm finding it hard to understand what numbers do what here, I want to know how to change the positioning of the sprites and also stats of the busses, you know, speed, capacity etc. This is what I am working with, I used the .grf Bob's British Busses as a base for my testing.
Re: Which numbers do what?
Try asking a question about NFO or hexadecimal numbersI think I understand it. Is it possible to help me?
Being a retired OpenTTD developer does not mean I know what I am doing.
- Bob_Mackenzie
- Chairman
- Posts: 823
- Joined: 25 Mar 2010 13:36
Re: Which numbers do what?
I wrote this 5 years ago using GRFmaker (if that still exists) - anyway I have attached the GRF code if it helps?
- Attachments
-
- BBBw.GRF
- (94.03 KiB) Downloaded 63 times
Who is online
Users browsing this forum: No registered users and 79 guests