The nfo/grf Technical Reference
Creating new graphics sets
Show full frameset for easy navigation
Introduction
These pages contain info on how to make new graphics sets. The reference on the actions is up-to-date, whereas the tutorial is still under construction. Stay tuned.
The main advantage of nfo/grf is versatility and performance. Because of tight integration with the game's state engine, there's nearly no limit for the nfo/grf coder (many of nfo's features in existence since years haven't made it into set development as of today!) in conjunction with an excellent performance, because of it's heavily optimized byte code for processing and displaying sprites.
In TTDPatch, the resulting byte code is even compiled into CPU instructions directly, something which couldn't be accomplished by any script-related approach.
OTOH, the "drawback" of using plain nfo is that it's hard to write and even harder to read. There have been several approaches to remedy this by supplying additional programs for lexical checking and beautifying nfo-code (renum), graphics frontends for nfo-programming (
GRFmaker), and high-level languages compiling into NFO (
m4nfo and NML).
However, to get the most out of these approaches, a thorough knowledge of plain nfo is still important, both for the game developer and for the graphic's set author, something that this newly compilated and revised technical reference would like to provide.
A downloadable version of these pages, in the form of a zip file containing all individual pages as HTML files, is available
here.
Table of contents
- GRFTutorial - A tutorial on writing new graphics for TTDPatch
- GRFActionsDetailed - Technical reference of the new .grf actions
- Action0 - Defining new graphics feature properties
- Action1 - Define a set of real sprites
- Action2 - Define graphics set IDs
- Action3 - Associate vehicles with graphics set IDs
- Action4 - Define vehicle names or other texts
- Action5 - Define TTDPatch specific graphics sets
- Action6 - Modify the contents of the following sprite
- Action7 - Conditionally skip sprites or jump to label
- Action8 - Define GRF ID, Name and Description
- Action9 - (see action 7 above)
- ActionA - Modify TTD's sprites
- ActionB - Generate error messages
- ActionC - Do nothing.
- ActionD - Assign parameters and calculate results
- ActionE - Deactivate other graphics files or force activation of current file
- ActionF - Define new town name styles
- Action10 - Define GOTO label for action 7/9
- Action11 - Define new sound data
- Action12 - Load font glyphs
- Action13 - Translate GRF-specific strings
- Action14 - Static GRF Information
- RealSprites - Sprites that actually get drawn on the screen
- RecolorSprites - Changing how other sprites are drawn
- AdditionalReferences - Various reference lists for GRF-related items