mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2025-12-20 11:01:23 +01:00
Updated Object Model (markdown)
parent
4e31f6eac7
commit
80ac5470d4
1 changed files with 32 additions and 2 deletions
|
|
@ -23,7 +23,7 @@ Both `grid` and `pack` objects include data representing voronoi diagrams and th
|
|||
* * `grid.cells.i`: `number[]` - cell indexes `Uint16Array` or `Uint32Array` (depending on cells number)
|
||||
* * `grid.cells.c`: `number[][]` - indexes of cells adjacent to each cell (neighboring cells)
|
||||
* * `grid.cells.v`: `number[][]` - indexes of vertices of each cell
|
||||
* * `grid.cells.b`: `number[]` - indicator whether the cell borders the map edge, 1 if `true`, 0 if `false`. Integers, not Boolean
|
||||
* * `grid.cells.b`: `number[]` - indicates if cell borders map edge, 1 if `true`, 0 if `false`. Integers, not Boolean
|
||||
|
||||
* `grid.vertices`: `{}` - vertices data object, contains only voronoi data:
|
||||
* * `grid.vertices.p`: `number[][]` - vertices coordinates `[x, y]`, integers
|
||||
|
|
@ -44,13 +44,43 @@ Both `grid` and `pack` objects include data representing voronoi diagrams and th
|
|||
* * `pack.vertices.c`: `number[][]` - indexes of cells adjacent to each vertex, each vertex has 3 adjacent cells
|
||||
* * `pack.vertices.v`: `number[][]` - indexes of vertices adjacent to each vertex. Most vertices have 3 neighboring vertices, bordering vertices has only 2, while the third is still added to the data as `-1`
|
||||
|
||||
## Features data
|
||||
* `grid.features`: `object[]` - array containing objects for all enclosed entities of original graph: islands, lakes and oceans. Feature object structure:
|
||||
* * `i`: `number` - feature id starting from `1`
|
||||
* * `land`: `boolean` - `true` if feature is land (height >= `20`)
|
||||
* * `border`: `boolean` - `true` if feature touches map border (used to separate lakes from oceans)
|
||||
* * `type`: `string` - feature type, can be `ocean`, `island` or `lake
|
||||
|
||||
* `pack.features`: `object[]` - array containing objects for all enclosed entities of repacked graph: islands, lakes and oceans. Note: element 0 has no data. Stored in .map file. Feature object structure:
|
||||
* * `i`: `number` - feature id starting from `1`
|
||||
* * `land`: `boolean` - `true` if feature is land (height >= `20`)
|
||||
* * `border`: `boolean` - `true` if feature touches map border (used to separate lakes from oceans)
|
||||
* * `type`: `string` - feature type, can be `ocean`, `island` or `lake`
|
||||
* * `group`: `string`: feature subtype. The variants are:
|
||||
* * * `ocean` - is always `ocean`
|
||||
* * * `island` - `continent`, `island`, `isle` or `lake_island`
|
||||
* * * `lake` - `freshwater`, `salt`, `dry`, `sinkhole` or `lava`
|
||||
* * `cells`: `number` - number of cells in feature
|
||||
* * `firstCell`: `number` - index of the first (top left) cell in feature
|
||||
* * `vertices`: `number[]` - indexes of vertices around the feature (perimetric vertices)
|
||||
|
||||
## Specific cells data
|
||||
### Grid object
|
||||
World data is mainly stored in typed arrays within `cells` object in both `grid` and `pack`.
|
||||
|
||||
### Grid object
|
||||
|
||||
* `grid.cells`: `{}` - cells data object, including world data:
|
||||
* * `grid.cells.f`: `number[]` - _features_ indexes `Uint16Array` or `Uint32Array` (depending on cells number)
|
||||
* * `grid.cells.c`: `number[][]` - indexes of cells adjacent to each cell (neighboring cells)
|
||||
* * `grid.cells.v`: `number[][]` - indexes of vertices of each cell
|
||||
* * `grid.cells.b`: `number[]` - indicates if cell borders map edge, 1 if `true`, 0 if `false`. Integers, not Boolean
|
||||
|
||||
### Pack object
|
||||
---
|
||||
|
||||
# Secondary pack data
|
||||
Secondary data available as a part of the `pack` object.
|
||||
## Features
|
||||
## Cultures
|
||||
## Burgs
|
||||
## States
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue