Help with changing introduction date
Moderator: Graphics Moderators
-
- Engineer
- Posts: 59
- Joined: 08 Dec 2018 18:09
Help with changing introduction date
I'm working on reverse engineering Generic Cars to make the vehicles appear earlier, for now it's just a personal project as I want to learn how to make a NewGRF and don't want to sort licensing, but I can't find the introduction dates or much documentation on where they might be.
There should be an intro date somewhere in this code I believe, but where? Can someone with any kind of NFO skills take a look:
91 * 9 02 01 00 01 01 00 00 00 00
92 * 16 02 01 E1 85 7F 0A "@ÿÿã" 00 01 00 00 00 80
93 * 16 02 01 E2 85 7F 0A "@ÿÿ²" 00 01 00 00 00 80
94 * 16 02 01 E3 85 7F 0A "@ÿÿÝ" 00 01 00 00 00 80
95 * 16 02 01 E4 85 7F 0A "@ÿÿU" 00 01 00 00 00 80
96 * 16 02 01 E5 85 7F 0A "@ÿÿÌ" 00 01 00 00 00 80
97 * 16 02 01 E6 85 7F 0A 40 FF FF 08 00 01 00 00 00 80
98 * 16 02 01 E7 85 7F 0A "@ÿÿô" 00 01 00 00 00 80
99 * 16 02 01 E8 85 7F 0A "@ÿÿv" 00 01 00 00 00 80
100 * 23 02 01 EE 80 00 00 08 E1 00 E2 00 E3 00 E4 00 E5 00 E6 00 E7 00 E8 00
101 * 11 02 01 33 80 00 00 02 4D 80 4E 80
102 * 14 02 01 33 81 46 08 7F 01 33 00 7F 7F 00 00
103 * 15 02 01 33 81 7F 00 00 01 01 00 00 01 01 33 00
104 * 22 02 01 33 81 10 00 FF 03 50 80 01 01 49 80 03 03 33 00 07 07 00 00
105 * 18 02 01 00 81 0C 00 FF 02 EE 00 2D 2D 33 00 33 33 00 00
106 * 9 03 01 01 FF 66 3C 00 00 00
107 * 4 01 01 01 08
My guess is line 101 * 11, since it's the only line that's significantly different to the equivalent line for the next vehicle, but I can't work out how the numbers would convert to a date.
There should be an intro date somewhere in this code I believe, but where? Can someone with any kind of NFO skills take a look:
91 * 9 02 01 00 01 01 00 00 00 00
92 * 16 02 01 E1 85 7F 0A "@ÿÿã" 00 01 00 00 00 80
93 * 16 02 01 E2 85 7F 0A "@ÿÿ²" 00 01 00 00 00 80
94 * 16 02 01 E3 85 7F 0A "@ÿÿÝ" 00 01 00 00 00 80
95 * 16 02 01 E4 85 7F 0A "@ÿÿU" 00 01 00 00 00 80
96 * 16 02 01 E5 85 7F 0A "@ÿÿÌ" 00 01 00 00 00 80
97 * 16 02 01 E6 85 7F 0A 40 FF FF 08 00 01 00 00 00 80
98 * 16 02 01 E7 85 7F 0A "@ÿÿô" 00 01 00 00 00 80
99 * 16 02 01 E8 85 7F 0A "@ÿÿv" 00 01 00 00 00 80
100 * 23 02 01 EE 80 00 00 08 E1 00 E2 00 E3 00 E4 00 E5 00 E6 00 E7 00 E8 00
101 * 11 02 01 33 80 00 00 02 4D 80 4E 80
102 * 14 02 01 33 81 46 08 7F 01 33 00 7F 7F 00 00
103 * 15 02 01 33 81 7F 00 00 01 01 00 00 01 01 33 00
104 * 22 02 01 33 81 10 00 FF 03 50 80 01 01 49 80 03 03 33 00 07 07 00 00
105 * 18 02 01 00 81 0C 00 FF 02 EE 00 2D 2D 33 00 33 33 00 00
106 * 9 03 01 01 FF 66 3C 00 00 00
107 * 4 01 01 01 08
My guess is line 101 * 11, since it's the only line that's significantly different to the equivalent line for the next vehicle, but I can't work out how the numbers would convert to a date.
-
- Engineer
- Posts: 59
- Joined: 08 Dec 2018 18:09
Re: Help with changing introduction date
Actually, I think it might be in here instead: 20 * 64 00 01 18 01 FF 66 3A 00 00 00 02 00 03 1E 04 3C 06 07 07 02 08 60 09 00 0A 48 4C 00 00 13 03 14
04 0E FF 0F 02 10 00 11 00 12 17 15 18 16 00 00 00 00 17 C0 1A 00 1B 01 1C 02 1D 00 00 1E 00 00
There's several lines of similar code which seems to be setting up all the vehicles in order.
04 0E FF 0F 02 10 00 11 00 12 17 15 18 16 00 00 00 00 17 C0 1A 00 1B 01 1C 02 1D 00 00 1E 00 00
There's several lines of similar code which seems to be setting up all the vehicles in order.
-
- Engineer
- Posts: 59
- Joined: 08 Dec 2018 18:09
Re: Help with changing introduction date
I figured out where the date is with the help of YAGL but I can't figure out how to get a date pre-1920, even trying to use code from EGRVTS2 isn't working.
-
- Engineer
- Posts: 59
- Joined: 08 Dec 2018 18:09
Re: Help with changing introduction date
My main issue now is that I can't make the pre-1920 dates work, even using a long introduction date that works in both NARS2.03 and EGRVTS2, it just won't work for my GRF and instead causes the vehicle to not show up. If anyone knows how to fix this please tell me how.
-
- Engineer
- Posts: 59
- Joined: 08 Dec 2018 18:09
Re: Help with changing introduction date
It's actually working oh my god, EGRVTS and NARS2's code didn't work but for some reason I was able to reverse engineer Bob's British Buses and that does work. Now I only need to redo the sprites and my NewGRF is finished for personal use. The sprites are quite low res but I don't know how to change the sprite specifications, so this will have to do for now.
Re: Help with changing introduction date
I would suggest taking the time to learn NML instead. A much better investment than trying to wrangle with NFO.
Do you like drones, quadcopters & flying toys? Check out Drone Strike Force!

Base Music Sets: OpenMSX | Scott Joplin Anthology | Traditional Winter Holiday Music | Modern Motion Music
Other Projects: 2CC Trams | Modern Waypoints | Sprite Sandbox & NewGRF Releases | Ideabox | Town Names | Isle of Sodor Scenario | Random Sprite Repository
Misc Topics: My Screenshots | Forgotten NewGRFs | Unfinished Graphics Sets | Stats Shack | GarryG's Auz Sets

Base Music Sets: OpenMSX | Scott Joplin Anthology | Traditional Winter Holiday Music | Modern Motion Music
Other Projects: 2CC Trams | Modern Waypoints | Sprite Sandbox & NewGRF Releases | Ideabox | Town Names | Isle of Sodor Scenario | Random Sprite Repository
Misc Topics: My Screenshots | Forgotten NewGRFs | Unfinished Graphics Sets | Stats Shack | GarryG's Auz Sets
-
- Route Supervisor
- Posts: 466
- Joined: 15 Jun 2007 09:27
- Skype: madchimiste
- Location: Berlin, Deutschland
Re: Help with changing introduction date
This is the Action0, which defines the properties:JustMoreMemes wrote: 09 Nov 2022 13:45 Actually, I think it might be in here instead: 20 * 64 00 01 18 01 FF 66 3A 00 00 00 02 00 03 1E 04 3C 06 07 07 02 08 60 09 00 0A 48 4C 00 00 13 03 14
04 0E FF 0F 02 10 00 11 00 12 17 15 18 16 00 00 00 00 17 C0 1A 00 1B 01 1C 02 1D 00 00 1E 00 00
There's several lines of similar code which seems to be setting up all the vehicles in order.
Code: Select all
20 * 64 // Line# * Length
00 //Action0, Doc = https://newgrf-specs.tt-wiki.net/wiki/Action0
01 //Feature 01 = Road Vehicle
18 //Number of properties in this Action0: x18 = 24
01 //Number of vehicles
FF 66 3A //ID of the first vehicle: 3A66
//Properties 00 - 07 are documented here: https://newgrf-specs.tt-wiki.net/wiki/Action0/Vehicles
00 //01/24: Prop 00 = Date of introduction, 1920-based
00 00 // 1920-01-01 I guess
02 //02/24: Prop 02 = Reliability decay speed
00 // 0 = never decays
03 //03/24: Prop 03 = Vehicle life
1E // old after 30 years
04 //04/24: Prop 04 = Model life
3C // disappears after 60 years
06 //05/24: Prop 06 = Climate availability
07 // all, except toyland
07 //06/24: Prop 07 = Loading speed
02 // 2 units every 20 game ticks
//Properties 08+ are documented here: https://newgrf-specs.tt-wiki.net/wiki/Action0/Vehicles/RoadVehicles
08 //07/24: Prop 08 = Speed
60 // ~30 mph
09 //08/24: Prop 09 = Running cost factor
00 // normal I guess
0A //09/24: Prop 0A = Cost base
48 4C 00 00 // that's standard
13 //10/24: Prop 13 = Power
03 // 30 hp
14 //11/24: Prop 14 = Weight
04 // 1 ton
0E //12/24: Prop 0E = Sprite ID
FF // FF means new graphics
0F //13/24: Prop 0F = Capacity
02 // 2
10 //14/24: Prop 10 = Cargo types
00 // Passengers
11 //15/24: Prop 11 = Cost factor
00 // free
12 //16/24: Prop 12 = Sound effect
17 // normal
15 //17/24: Prop 15 = Speed
18 // 24/0.8 = 30 mph also
16 //18/24: Prop 16 = bitmask for cargo refit
00 00 00 00
17 //19/24: Prop 17 = Callback flags
C0 //80 (Sound effect) + 40 (Color mapping)
1A //20/24: Prop 1A = refit cost
00
1B //21/24: Prop 1B = retire vehicle early
01
1C //22/24: Prop 1C = misc vehicle flags
02 //use 2 company colors
1D //23/24: Prop 1D = refitable cargo classes
00 00
1E //24/24: Prop 1E = non refitable cargo classes
00 00
Not very user friendly (if you practice it everyday, maybe you begin seeing the matrix), but really interesting.
Re: Help with changing introduction date
"\d1-1-1920" also works. If you're just changing (or adding, since the grf predates it) a property in a decompiled file like this, you could also just tag additional sprites on the end of the file, rather than trying to find where the property is (or would be) set and changing it there.arikover wrote: 09 Nov 2022 17:14the number of days since year 0 [...] 51 B3 0A 00 [...] Not very user friendly
Code: Select all
1 * 1 00 01 \b1 \b1 ff 66 3a 1f \d1-1-1920 // Model T
1 * 1 00 01 \b1 \b1 ff 66 3b 1f \d1-1-1940 // Ford
1 * 1 00 01 \b1 \b1 ff 66 3c 1f \d1-1-1960 // Beetle
1 * 1 00 01 \b1 \b1 ff 66 3d 1f \d1-1-1980 // Astra
1 * 1 00 01 \b1 \b1 ff 66 3e 1f \d1-1-2000 // Punto
1 * 1 00 01 \b1 \b1 ff 66 3f 1f \d1-1-2020 // Futuristic

If you're trying to make your own grf with your own vehicles, which is what it sounds like you're doing, then yes, you'd be much better off learning to code a grf from scratch (using NML) rather than decompiling and modifying existing sets.
-
- Engineer
- Posts: 59
- Joined: 08 Dec 2018 18:09
Re: Help with changing introduction date
I think you're right, I decided to work with NFO because I figured that it must be the one most people use, I'd misunderstood NML and assumed it was a basic language for beginners that most modders ignore but it just seems objectively better. At the moment I'm using a combination of NFO and YAGL for writing and it works quite well but I'll probably be learning NML for my first non-reverse engineered products.kamnet wrote: 09 Nov 2022 15:43 I would suggest taking the time to learn NML instead. A much better investment than trying to wrangle with NFO.
-
- Engineer
- Posts: 59
- Joined: 08 Dec 2018 18:09
Re: Help with changing introduction date
Thanks for the information. it's very useful, YAGL and the TT wiki helped me understand some of this but not all of it. I'm probably gonna try to learn NML but I'll be finishing this project in NFO.arikover wrote: 09 Nov 2022 17:14This is the Action0, which defines the properties:JustMoreMemes wrote: 09 Nov 2022 13:45 Actually, I think it might be in here instead: 20 * 64 00 01 18 01 FF 66 3A 00 00 00 02 00 03 1E 04 3C 06 07 07 02 08 60 09 00 0A 48 4C 00 00 13 03 14
04 0E FF 0F 02 10 00 11 00 12 17 15 18 16 00 00 00 00 17 C0 1A 00 1B 01 1C 02 1D 00 00 1E 00 00
There's several lines of similar code which seems to be setting up all the vehicles in order.For an introduction date before 1920, add the property 1F, which can be set to the number of days since year 0 (1920-01-01 is 701265, that is 51 B3 0A 00).Code: Select all
20 * 64 // Line# * Length 00 //Action0, Doc = https://newgrf-specs.tt-wiki.net/wiki/Action0 01 //Feature 01 = Road Vehicle 18 //Number of properties in this Action0: x18 = 24 01 //Number of vehicles FF 66 3A //ID of the first vehicle: 3A66 //Properties 00 - 07 are documented here: https://newgrf-specs.tt-wiki.net/wiki/Action0/Vehicles 00 //01/24: Prop 00 = Date of introduction, 1920-based 00 00 // 1920-01-01 I guess 02 //02/24: Prop 02 = Reliability decay speed 00 // 0 = never decays 03 //03/24: Prop 03 = Vehicle life 1E // old after 30 years 04 //04/24: Prop 04 = Model life 3C // disappears after 60 years 06 //05/24: Prop 06 = Climate availability 07 // all, except toyland 07 //06/24: Prop 07 = Loading speed 02 // 2 units every 20 game ticks //Properties 08+ are documented here: https://newgrf-specs.tt-wiki.net/wiki/Action0/Vehicles/RoadVehicles 08 //07/24: Prop 08 = Speed 60 // ~30 mph 09 //08/24: Prop 09 = Running cost factor 00 // normal I guess 0A //09/24: Prop 0A = Cost base 48 4C 00 00 // that's standard 13 //10/24: Prop 13 = Power 03 // 30 hp 14 //11/24: Prop 14 = Weight 04 // 1 ton 0E //12/24: Prop 0E = Sprite ID FF // FF means new graphics 0F //13/24: Prop 0F = Capacity 02 // 2 10 //14/24: Prop 10 = Cargo types 00 // Passengers 11 //15/24: Prop 11 = Cost factor 00 // free 12 //16/24: Prop 12 = Sound effect 17 // normal 15 //17/24: Prop 15 = Speed 18 // 24/0.8 = 30 mph also 16 //18/24: Prop 16 = bitmask for cargo refit 00 00 00 00 17 //19/24: Prop 17 = Callback flags C0 //80 (Sound effect) + 40 (Color mapping) 1A //20/24: Prop 1A = refit cost 00 1B //21/24: Prop 1B = retire vehicle early 01 1C //22/24: Prop 1C = misc vehicle flags 02 //use 2 company colors 1D //23/24: Prop 1D = refitable cargo classes 00 00 1E //24/24: Prop 1E = non refitable cargo classes 00 00
Not very user friendly (if you practice it everyday, maybe you begin seeing the matrix), but really interesting.
-
- Engineer
- Posts: 59
- Joined: 08 Dec 2018 18:09
Re: Help with changing introduction date
Thanks for the info, my plan is to make a similar NewGRF to generic cars that adds vehicles across 1700-1900, specifically 1705, 1788, 1815, 1858, 1883, and 1886, since for the latter 5 I'm using real designs and dates. It's gonna have new graphics and will likely only share some generic code for the vehicles albeit with changed stats and graphics. At the moment the artwork is under construction and I'm still fine tuning the stats but here's my list of vehicles, barring future changes if I can't make a sprite work for one of them or something. I eventually managed to add the date in a different way though.PikkaBird wrote: 09 Nov 2022 21:03"\d1-1-1920" also works. If you're just changing (or adding, since the grf predates it) a property in a decompiled file like this, you could also just tag additional sprites on the end of the file, rather than trying to find where the property is (or would be) set and changing it there.arikover wrote: 09 Nov 2022 17:14the number of days since year 0 [...] 51 B3 0A 00 [...] Not very user friendly
Of course, if you change the introduction dates, you're perhaps going to have issues with model life, etc.Code: Select all
1 * 1 00 01 \b1 \b1 ff 66 3a 1f \d1-1-1920 // Model T 1 * 1 00 01 \b1 \b1 ff 66 3b 1f \d1-1-1940 // Ford 1 * 1 00 01 \b1 \b1 ff 66 3c 1f \d1-1-1960 // Beetle 1 * 1 00 01 \b1 \b1 ff 66 3d 1f \d1-1-1980 // Astra 1 * 1 00 01 \b1 \b1 ff 66 3e 1f \d1-1-2000 // Punto 1 * 1 00 01 \b1 \b1 ff 66 3f 1f \d1-1-2020 // Futuristic
If you're trying to make your own grf with your own vehicles, which is what it sounds like you're doing, then yes, you'd be much better off learning to code a grf from scratch (using NML) rather than decompiling and modifying existing sets.
I'll probably be learning NML for my next project after this one, which I'll be finishing in NFO with some YAGL, my next one will probably be fully originally written rather than reverse engineered.
- Svartypops
- Engineer
- Posts: 28
- Joined: 20 Nov 2022 15:15
Re: Help with changing introduction date
I can do hex editing. If you know what numbers to look for, you can convert to hex and search for them, but remember that oftentimes games store data in LITTLE ENDIAN, which means reversing the "pairs" of digits in a four-byte block.JustMoreMemes wrote: 09 Nov 2022 13:38 I'm working on reverse engineering Generic Cars to make the vehicles appear earlier, for now it's just a personal project as I want to learn how to make a NewGRF and don't want to sort licensing, but I can't find the introduction dates or much documentation on where they might be.
There should be an intro date somewhere in this code I believe, but where? Can someone with any kind of NFO skills take a look:
91 * 9 02 01 00 01 01 00 00 00 00
92 * 16 02 01 E1 85 7F 0A "@ÿÿã" 00 01 00 00 00 80
93 * 16 02 01 E2 85 7F 0A "@ÿÿ²" 00 01 00 00 00 80
94 * 16 02 01 E3 85 7F 0A "@ÿÿÝ" 00 01 00 00 00 80
95 * 16 02 01 E4 85 7F 0A "@ÿÿU" 00 01 00 00 00 80
96 * 16 02 01 E5 85 7F 0A "@ÿÿÌ" 00 01 00 00 00 80
97 * 16 02 01 E6 85 7F 0A 40 FF FF 08 00 01 00 00 00 80
98 * 16 02 01 E7 85 7F 0A "@ÿÿô" 00 01 00 00 00 80
99 * 16 02 01 E8 85 7F 0A "@ÿÿv" 00 01 00 00 00 80
100 * 23 02 01 EE 80 00 00 08 E1 00 E2 00 E3 00 E4 00 E5 00 E6 00 E7 00 E8 00
101 * 11 02 01 33 80 00 00 02 4D 80 4E 80
102 * 14 02 01 33 81 46 08 7F 01 33 00 7F 7F 00 00
103 * 15 02 01 33 81 7F 00 00 01 01 00 00 01 01 33 00
104 * 22 02 01 33 81 10 00 FF 03 50 80 01 01 49 80 03 03 33 00 07 07 00 00
105 * 18 02 01 00 81 0C 00 FF 02 EE 00 2D 2D 33 00 33 33 00 00
106 * 9 03 01 01 FF 66 3C 00 00 00
107 * 4 01 01 01 08
My guess is line 101 * 11, since it's the only line that's significantly different to the equivalent line for the next vehicle, but I can't work out how the numbers would convert to a date.
See that other block 01 00 00 00? That's 00 00 00 01 in little endian = 1.
In your data block, the second number on each line seems to indicate how many bytes on that line, but it's not always true, so presumably this, "@ÿÿã" is 4 bytes.
---
[edit]
I just read some of the replies... my comment has been covered above. Anyway, I wanted to just say...
701265 days = 0a B3 51
which is stored in little endian as shown above: 51 B3 0A 00
Who is online
Users browsing this forum: No registered users and 16 guests