The nfo/grf Technical Reference

Action 8

Defining GRF-ID, Name and Description


Introduction

Meanwhile, there are many new graphic sets available to TTD players. This needs to make sure that sets doesn't get mixed up. Therefore, Action 8 is used to provide a unique ID for every grf file. Another feature of Action 8 is the ability to include useful information into the final grf.


Format

<sprite-number> * <length> 08 <version> <grf-id> <name> <description>

ElementSizeDescription
<sprite-number>decA sequential sprite number
<length>decThe total number of bytes in the action
08BAction 08
<version>BNFO version
<grf-id>4*BA unique ID for your .grf file
<name>SA short text containing the name of this set
<description>SA longer description of this set



Description

<sprite-number>


The number of this sprite.

Action 8 has to be one of the first pseudosprites in the .NFO file. It is however valid to have other actions before it, except those that define new sprites or vehicle (etc.) properties.

Actions 6, 7, 9, B, C, D (except resource management sprites), 10 and 14 are valid before an action 8.

<length>


The total number of bytes in Action 8.

<version>


This should be the graphics version that your file will support. Valid values are:

ValueCompatibilityTTDPatch versionOpenTTD support
0702 .. 072.5 beta 1 or higher yes
0602 .. 062.0.1 alpha 13 or higher yes
0502 .. 052.0r1 Stable TTDPatch + 2.0.1 alphas up to 12 yes
0402 .. 042.0 Stable TTDPatchyes
0100 .. 011.9.1 alpha 28 or higherno
00001.9.1 alphas up to 27no

Entries for 00 and 01 are included only for completeness, and to aid with updating existing graphics. They should not be used with new graphics, because they will be incompatible with current TTDPatch and OpenTTD versions. OpenTTD 1.1.0 and later will disable NewGRFs with non-supported NFO versions.

Make sure to set a version number no lower than the minimum version that supports all features which are used by your file.

The compatibility column means how low a version number is supported by the given TTDPatch version, e.g. 2.0r1 supports graphics files with any version from 02 to 05, but not for example 01 or 06.

Version 07 introduces a few minor semantic changes to some graphics features, i.e. the file will behave slightly differently depending on whether it's declared as version 06 or 07. These changes are described in more detail in the pages for the features they affect.

<grf-id>


This is a series of 4 bytes. It's a convention to use the first two bytes for the creator's initials in ASCII code, e.g. 54 57 for "TW". The last two bytes should be numbers, typically the first number identifying which of the author's sets this is, and the second number being a version number.

In principle, you are free what to use for the GRF ID as long as you are sure it is unique, but generally it is best to follow the above guidelines.

Note that GRF IDs starting with FF (i.e. the first byte is FF, such as in FF123456) are reserved for internal purposes and should not be used by regular .grf files. A GRF ID of FFFFFFFF is a special case for a .grf file that is always active and cannot be deactivated, used for feature-specific TTDPatch graphics such as electrified railways or pre-signals. This kind of file is shown with a blue flag in the GRF Status Window.

The extra newgrf file, part of OpenTTD base sets, have to have a GRF ID starting with FF "OT". The fourth letter may not be "W" nor "D" which are reserved for the openttdd.grf file. OpenGFX defines 01 for its extra newgrf.

<name>


This short field should contain the name of the set. See GRFActionsDetailed for instructions to generate the necessary byte codes, and for restrictions on what characters you may use.

The name must be short because it should fit on one line of the GRF Status window.

<description>


This is a longer description of the set. Typically it contains the name of the author and a copyright notice or other attribution. See GRFActionsDetailed for instructions to generate the necessary byte codes, and for restrictions on what characters you may use.

The description may be quite long, but should be short enough to fit in the description part of the GRF Status window, or a part of it may be cut off.


Example

Below is an example of what a real Action 8 pseudo-sprite could look like.

1 * 43 08 05 54 57 01 06 20 54 75 74 6F 72 69 61 6C 20 65 78 61 6D 70 6C 65 00 20 43 6F 70 79 72 69 67 68 74 3A 20 53 79 73 74 65 6D 00

Let's clarify it bit by bit. In order to understand what the bits say you could use a hexadecimal editor.

ByteMeaning
1<sprite-number>
43<length> of the action in bytes; start counting at 08 (<action>)
08<action>: sets this pseudo-sprite to function as action 8
05<version>: this .grf file works with TTDPatch 2.0r1 + alpha series
54 57 01 06<grf-id>: ASCII code for TW, then the numbers 1 and 6 to indicate version 6 of TW's first set
20 54 .. 65 00<name>: Tutorial example
20 43 .. 6D 00<description>: Copyright: System