mirror of
https://github.com/space-wizards/RobustToolbox.git
synced 2026-02-15 03:30:53 +01:00
Refactor tile IDs. (#778)
* Refactor tile IDs. Tile IDs are now automatically assigned at runtime. A mapping is also stored in map files to avoid compatibility issues. Also removed tile prototypes. Content is now responsible for it. This is so content can define its own data for tiles. * Update map format specification. * Fix tile placement.
This commit is contained in:
committed by
GitHub
parent
2bb73aa93d
commit
d7d0363cc3
@@ -20,6 +20,12 @@ Fields:
|
||||
* `name`: A name. Simple huh. Can be left out.
|
||||
* `author`: Authorship info. Also simple. Can be left out.
|
||||
|
||||
### The `tilemap` section
|
||||
|
||||
Numeric tile IDs are not guaranteed to be consistent between different versions of the game. As such, each map file that contains grids must also contain a `tilemap` section, mapping tile definition names to the tile IDs used to encode them in the `grids` section.
|
||||
|
||||
The section is a map of numeric ID: tile definition name.
|
||||
|
||||
### The `grids` Section
|
||||
|
||||
Contains data for all the grids. The section is an ordered sequence. Each sequence is made up of a single grid's data. That data:
|
||||
@@ -49,6 +55,8 @@ Tile data is a binary array of the tile data of a chunk. Tiles are ordered witho
|
||||
|
||||
Tiles are 4 bytes in size (`ushort` for Tile ID, `ushort` for tile metadata field, little endian) Thus, since the amount of tiles is equal to `chunksize * chunksize`, the tile data per chunk is exactly `chunksize * chunksize * 4` bytes long.
|
||||
|
||||
Tile IDs should be mapped to tile definitions via the `tilemap` section.
|
||||
|
||||
## Blueprints
|
||||
|
||||
Blueprints are just map files with one grid.
|
||||
|
||||
Reference in New Issue
Block a user