-
Notifications
You must be signed in to change notification settings - Fork 35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Change: Implement GRFv9 #357
Conversation
for sound in self.sound_list: | ||
sound.write(file, 1) | ||
sound.write(file, 2) | ||
file.newline() | ||
|
||
def get_size(self): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
get_size
needs adjusting. See frosch123@7ba80f2
(triggered by FIRS 5.0.0-beta-3
I tested 3 variants of self-describing Action0 with property sizes: frosch123@d323112
As benchmark I used FIRS 5.0.0-beta-3: a large NewGRF with decent NFO size, and not as much sprites as vehicle sets.
Opinion:
|
Has thought been put into what we're going to do with GRFCodec and friends?
|
While the overhead is low for NML which nearly always only writes properties for one item at a time, any outputter in which property "batching" is used with num-info > 1 will see a larger relative increase in size. Not necessarily a problem, just pointing it out. This is common with hand-written NFO (and grf-py can do it), and asking NFO authors to hand-encode every property size is awkward. Variably-sized size information will also affect writing correct Action 6 offsets. |
I tested with the property size tweak. It puts the property size before the property number, which wasn't what I expected, as it means the value changes depending on my items are being changed. |
8bf52e1
to
fc7b4be
Compare
Would it be an idea to not go fully self-describing on Action0, but introduce a new action that defines a basic description of the actions. However, any property with a variable length must define their length in the Action0, but any property without length does not. Some of these variable length properties already have a size, e.g. airport layouts (swap num layouts and size fields though), or never/always refittable cargoes. However, these have a different size of their size field, so the describing new action should also define the length of the size field for variable size properties. By designing it as a separate action, we don't need to duplicate this information for each and every property. It also makes it easier to just skip it. |
I guess if you need to scan the whole NewGRF to find the property descriptor blocks you can probably cope with
|
We keep listing changes to the GRF spec and saying "that can come in GRFv9".
Well, here is an attempt to implement some changes, and call it GRFv9.
This is of course just a draft and is subject to improvements (or being scrapped...)
Action 6 changes are very... temperamental.
See OpenTTD/OpenTTD#13309