1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-23 22:37:55 +02:00

Add basic description of battlefield layout

This commit is contained in:
Ivan Savenko
2025-05-10 19:12:09 +03:00
parent 9bf5cf42f3
commit a188934e12
6 changed files with 264 additions and 1 deletions

View File

@@ -1,5 +1,7 @@
# Battle Obstacle Format
## Configuration reference
```json
// List of terrains on which this obstacle can be used
"allowedTerrains" : []
@@ -16,7 +18,7 @@
// Height of an obstacle, in hexes
"height" : 1
// List of tiles blocked by an obstacles. For non-absolute obstacles uses relative hex indices
// List of tiles blocked by an obstacles. See below for description
"blockedTiles" : [ 0, 20, 50 ]
// For absolute obstacle - image with static obstacle. For non-absolute - animation with an obstacle
@@ -25,3 +27,21 @@
// If set to true, obstacle will appear in front of units or other battlefield objects
"foreground" : false
```
## Blocked tiles definition
How blocked tiles are defined depends on whether obstacle is `absolute` or not:
### Non-absolute obstacles
Non-absolute obstacles specify their coordinates relative to bottom-left corner of obstacle. If you wish to have obstacle that takes multiple rows, substracting 17 from hex number would block tile directly above bottom-left corner of your obstacle.
For example, obstacle that blocks tiles `[1, 2, 3, -15, -16, -31]` would result in following layout on the battlefield:
![Battlefield Relative Obstacle Example](../Battle_Field_Relative_Obstacle.svg)
### Absolute obstacles
Absolute obstacles operate in absolute coordinates. Because of that, blocked tiles contains list of indexes of blocked tiles. For reference on tiles indexes see image below:
![Battlefield Hexes Layout](../Battle_Field_Hexes.svg)

View File

@@ -23,3 +23,10 @@
// List of battle hexes that will be always blocked on this battlefield (e.g. ship to ship battles)
"impassableHexes" : [ 10, 20, 50 ],
```
### Impassable Hexes
Impassable hexes operate in absolute coordinates. For reference on tiles indexes see image below:
![Battlefield Hexes Layout](../images/Battle_Field_Hexes.svg)