Failing to work on the map format
+53
-5
@@ -1,8 +1,50 @@
|
||||
I'm overthinking this too much. This is why I like coding more than documentation. Check back after the editor is finished.
|
||||
|
||||
|
||||
## Version One (Under Construction)
|
||||
|
||||
This version is designed to be as simple as possible, while still providing a solid feature set.
|
||||
Tiles are zero indexed, with -1 meaning transparent.
|
||||
All tiles share the same tileset, which is loaded separately and not referenced in the map file.
|
||||
|
||||
#### Modules
|
||||
|
||||
MapUtility
|
||||
|
||||
-
|
||||
|
||||
#### File Format
|
||||
|
||||
The map files are layed out like this:
|
||||
|
||||
```
|
||||
[metadata]
|
||||
[data blob]
|
||||
```
|
||||
|
||||
The metadata is a single line of non-negative, comma delimited integers ending in a semicolon.
|
||||
The metadata contains:
|
||||
|
||||
* layers
|
||||
* width of the map (in tiles)
|
||||
* height of the map (in tiles)
|
||||
|
||||
The data blob contains the actual tile data. These are plain text integers delimited by whitespace.
|
||||
The data is read in this order:
|
||||
|
||||
* bottom layer
|
||||
* left most column of the layer
|
||||
* top most tile of a column
|
||||
|
||||
-------------------------
|
||||
|
||||
## Version Two (Under Construction)
|
||||
|
||||
The map data is stored in plain text.
|
||||
The tiles are zero indexed, with -1 meaning transparent.
|
||||
Each layer has it's own tileset.
|
||||
|
||||
## Containers
|
||||
#### Containers
|
||||
|
||||
Patch:
|
||||
int xCount, yCount
|
||||
@@ -17,7 +59,7 @@ MapUtility:
|
||||
list<Layer> data[layerCount]
|
||||
list<Image> tilesets[layerCount]
|
||||
|
||||
## File Format
|
||||
#### File Format
|
||||
|
||||
The files are layed out like this:
|
||||
|
||||
@@ -27,14 +69,20 @@ The files are layed out like this:
|
||||
[data blob]
|
||||
```
|
||||
|
||||
The format metadata includes the tile format, the number of tiles in a patch, the number of patches in a layer, and the number of layers and tilesets in the map. It also includes totals, which can be used to verify the formats before loading the data blob.
|
||||
The format metadata includes the tile size, the number of tiles in a patch, etc. as detailed below. It also includes totals, which can be used to verify the formats before loading the data blob.
|
||||
The metadata is layed out like this:
|
||||
|
||||
```
|
||||
tileWidth tileHeight patchXCount patchYCount layerXCount layerYCount layerCount totalXCount totalYCount totalCount;
|
||||
tileWidth tileHeight //the width and height of each tile in pixels
|
||||
patchWidth patchHeight //the width and height of each patch in tiles
|
||||
patchXCount patchYCount //the number of patches in
|
||||
layerCount //
|
||||
totalXCount //
|
||||
totalYCount //
|
||||
totalCount //
|
||||
```
|
||||
|
||||
The tileset list is a list of filenames terminated by semicolons.
|
||||
The tilesets are a list of filenames terminated by semicolons.
|
||||
|
||||
The data blob is made up of each tile, layed out from the bottom layer to the top, from the top-left most tile, read X first.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user