-
Notifications
You must be signed in to change notification settings - Fork 3
Metatile Attributes
Metatile attributes are a key part of any good tileset. As such, Porytiles supports seamless attribute management via an easy-to-use CSV file. Simply create a file called attributes.csv
in your source tileset folder, right next to your layer PNGs.
The first line of the attribute file is the column key. For the default target base game, pokeemerald
, it should look like this:
id,behavior
On subsequent lines, you can then specify a metatile ID followed by the desired behavior for that metatile. The behavior can be either a raw integral value, or a metatile behavior label as defined in the given include/constants/metatile_behaviors.h
. Porytiles recommends that you use the label as opposed to the integral value, as it is more flexible and less error prone. For example:
11,MB_TALL_GRASS
This line specifies that the metatile with ID 11 should have the behavior value associated with label MB_TALL_GRASS
. After compiling and refreshing Porymap, you should see the behaviors you specified in the CSV file appear in the tileset editor window.
Any metatile you don't explicitly specify in attributes.csv
will receive the default value of 0
for all attributes. You can change this with the various -default-*
options detailed below.
For target base games pokeruby
and pokeemerald
, the attribute column format should be id,behavior
as indicated above. Any deviation from this format will present a compilation error.
For target base game pokefirered
, the attribute column format should be id,behavior,terrainType,encounterType
. Any deviation from this format will present a compilation error.
Attribute generation can be tweaked via the following command options. These options should be supplied after the compilation command, i.e. after compile-primary
or compile-secondary
.
Ignore the contents of attributes.csv
and skip generation of metatile_attributes.bin
. Enable this option if you want to manage attributes via Porymap instead of the CSV file. Otherwise, Porytiles will write metatile_attributes.bin
to your output location, which will overwrite anything you have edited in Porymap.
Select the default metatile behavior for metatiles that do not have an entry in the attributes.csv
file. You may use either a raw integral value or a metatile behavior label defined in the provided include/constants/metatile_behaviors.h
header file. If unspecified, defaults to 0
.
Select the default encounter type for metatiles that do not have an entry in the attributes.csv
file. You may use either a raw integral value or an EncounterType label defined in the include/global.fieldmap.h
file. If unspecified, defaults to 0
.
Select the default terrain type for metatiles that do not have an entry in the attributes.csv
file. You may use either a raw integral value or a TerrainType label defined in the include/global.fieldmap.h
file. If unspecified, defaults to 0
.
There are a few compilation warnings that can be enabled to help catch common attributes.csv
problems.
This warning alerts you when the attributes specified in the header of attributes.csv
do not match the target base game. Base games pokeemerald
/pokeruby
and pokefirered
have different attribute formats. Specifically, pokefirered
metatiles contain the same id
and behavior
attributes as pokeemerald
/pokeruby
, but they additionally contain terrain_type
and encounter_type
attributes. This warning will display if attributes.csv
is missing these extra attributes while the target base game is set to pokefirered
. It will also display if you specify fields beyond id
and behavior
for target base games pokeemerald
/pokeruby
. Defaults to off.
This warning alerts you when attributes.csv
is missing. When there is no attributes.csv
in the source folder, Porytiles will apply the default values to all metatile attributes. Defaults to off.
This warning alerts you when attributes.csv
specifies an attribute for a metatile ID that does not exist in the layer sheet. Defaults to off.
As tracked here, Porytiles plans to eventually support completely customized attributes via custom masks and shifts à la Porymap. Look out for the feature in a future Porytiles release. Once the feature is implemented, I will explain how to use it in an updated version of this tutorial page.
Decompiling A Secondary Tileset
Makefile Integration
Target Base Game and Fieldmap Overrides
Other Useful Options
Layering Structures to Maximize Palette Efficiency