Learn more about grid battles and how to use them.
Grid battles are available in all battle system types when using a Battle component (i.e. also when started from the auto start battles, e.g. when running into an enemy spawned by a Combatant Spawner component). Grid battles allow creating a very tactical battle system in your game – best suited for Turn Based or Phase battles.
When using a battle grid in a battle, the combatants will be placed on the grid and are able to move around on it. Use ranges and affect ranges of items and abilities can be defined by individual grid shapes (e.g. a line of 3 cells in front of the user) and will be highlighted on the grid (e.g. showing which cells are within use range of an ability).
Battle grids are added to scenes using Battle Grid components. Battle components can be set up to use the nearest grid or a defined grid (or none at all). Learn more about setting up Battle Grid components in this documentation.
Download the grid cell prefabs to get you started with some basic cells. They contain 2D and 3D prefabs for grid cells – please enable Use Prefab Rotation when using these prefabs in your grid cell types, since the prefabs already have the correct rotation set up.
There are prefabs for square grids, hexagonal horizontal grids and hexagonal vertical grids (see more details on grid types below). The provided grid cell prefabs are intended for the following cell setup in Battles > Battle Grid Settings (both 2D and 3D prefabs):
- Cell Size
Set to 2. - Cell Offset
Set to X=0.1, Y=0.1.
When using them for different cell size/offset, you might need to adjust the scale of the grid cell prefabs.
Battle Grid Settings #
The battle grid settings handle most of the grid battle features, e.g. which grid type is used or grid actions like the grid move command.
The battle grid settings can be found in Battles > Battle Grid Settings.
Grid Settings #
Define the basic settings of battle grids.
There are 2 different types of grids available – square and hexagonal grids. Hexagonal grids can be used in 4 different modes (horizontal even/odd, vertical even/odd).
The cell size and cell offset settings are used when setting up a grid in your scenes to calculate the positions for the individual grid cells.
Square Grids #
Square grids create a chessboard-like grid in the scene. A cell in the grid has 4 edges and 4 corners.
Combatants can move horizontally and vertically, optionally you can also allow diagonal movement – i.e. combatants can either move in 4 or in 8 directions.
Hexagonal Grids #
Hexagonal grids create a more complex grid in the scene. There are different types of hexagonal grids available – in general, every 2nd row or column in the grid will be offset. A cell in the grid has 6 edges and 6 corners.
Depending on the used type, movement is availalble diagonally and either horizontally or vertically – i.e. combatants can move in 6 directions.
Horizontal Even
A horizontal even hexagonal grid uses hexagonal cells with a pointy top. Every even row is offset, i.e. row 0 (1st row), row 2, row 4, etc.
Being horizontally aligned, movement is available horizontally and diagonally.
Horizontal Odd
A horizontal odd hexagonal grid uses cells with a pointy top. Every odd row is offset, i.e. row 1, row 3, row 5, etc.
Being horizontally aligned, movement is available horizontally and diagonally.
Vertical Even
A vertical even hexagonal grid uses cells with a flat top. Every even column is offset, i.e. column 0 (1st column), column 2, column 4, etc.
Being vertically aligned, movement is available vertically and diagonally.
Vertical Odd
A vertical odd hexagonal grid uses cells with a flat top. Every odd column is offset, i.e. column 1, column 3, column 5, etc.
Being vertically aligned, movement is available vertically and diagonally.
Cell Occupation Settings #
Cells can either have a Single Occupant or allow multiple occupants.
When using multiple occupants, you can define the maximum number of player/ally and enemy combatants on a cell. Battle Grid Cell Positions components can be used on grid cell prefabs to define the positions on a cell for multiple occupants. In grid move schematics, use Select Grid Cell Position nodes to get the position game object for a combatant and use it as target for your movement.
Cell Selection #
Define the how cells can be selected (e.g. to select a target cell for the move command).
Individual commands using cell selections can override the default cell selection with a custom one.
Input Key Settings #
You can use input keys to select a cell (e.g. as target for the move command).
The input keys are used to navigate on the grid.
Mouse/Touch Control #
Input settings for mouse and touch control.
Clicking/touching will use the raycast settings defined in the grid settings to find the nearest cell.
Audio Settings #
Define audio clips that will be played during cell selections, e.g. for selecting and accepting cells.
Orientation Selection #
Define the how the orientation of a combatant can be selected.
This is only used by player combatants when either using the grid orientation command (e.g. via battle menu or shortcut) or in schematics using the Grid Orientation Selection node.
AI controlled combatants will only use the Block Diagonal Rotation setting (in Square grids) and otherwise rotate based on their AI settings, e.g. to the nearest target.
Camera Control Target #
Optionally change the camera control target to the selected cell during the cell selection.
The camera control must derive from the BaseCameraControl class (like all built-in camera controls).
Info Text #
Optionally display an info text box while the player selects a target cell.
The content can use text codes to add the selecting combatant’s content information (e.g. name).
Accept Question Dialogue #
Optionally display an accept question dialogue to ask if the player wants to use the accepted cell.
Cell Selection #
Optionally override the default cell selection settings.
Combatant Placement #
Define the settings for the player’s combatant placement on the grid. This can e.g. be used in a battle start schematic to let the player select the cells for the combatants participating in battle.
The combatant placement can either place the battle group members or allow the player to select from all available members, defining the battle group that’ll be used. The combatants can either be selected using a combatant selection or placed in a predefined order (based on a sorting setting).
Optionally also select the orientation of the placed combatants (see orientation selection settings above).
Camera Control Target #
Optionally change the camera control target to the selected cell during the cell selection.
The camera control must derive from the BaseCameraControl class (like all built-in camera controls).
Info Text #
Optionally display an info text box while the player selects a target cell.
The content can use text codes to add the selecting combatant’s content information (e.g. name).
Accept Question Dialogue #
Optionally display an accept question dialogue to ask if the player wants to use the accepted cell.
Cell Selection #
Optionally override the default cell selection settings.
Move Command #
The move command handles a combatant’s movement on the battle grid.
Define the pathfinding settings (e.g. if combatants can move over cells blocked by their allies), the default move range and other settings.
Using the move command can optionally be limited to once per turn and allow diagonal movement (in Square grids).
Camera Control Target #
Optionally change the camera control target to the selected cell during the cell selection.
The camera control must derive from the BaseCameraControl class (like all built-in camera controls).
Limit Height Movement #
Optionally limit movement to a maximum height distance for upward and downward distances.
E.g. only allow moving upward movement for low height distances (e.g. 0.3).
Waypoint Settings #
Optionally allow setting waypoints during grid move path selection.
Default Battle Animation #
Define the default schematics used to animate the grid move command.
The schematic is used to move the combatant from cell to cell and use cell events on those cells. Use the Store Grid Path node to get individual cells (or the whole path) for movement. The Grid Cell Event node can be used to start cell events.
Combatants can individually override the battle animation.
Info Text #
Optionally display an info text box while the player selects a target cell.
The content can use text codes to add the selecting combatant’s content information (e.g. name) and information about the cell, move/action costs and move range changes.
Accept Question Dialogue #
Optionally display an accept question dialogue to ask if the player wants to use the accepted cell.
Cell Selection #
Optionally override the default cell selection settings.
Cell Selection Schematics #
Optionally use schematics when selecting a valid or invalid cell for movement, or when accepting or canceling cell selection.
This can be used for advanced features, e.g. previewing the movement along the path to the selected cell.
Potential Attacks Highlights #
Optionally highlight enemies that can attack when moving to a selected cell.
Target Cell Selection #
Define the settings for the target cell selection of abilities and items that target a grid cell.
Abilities and items can target a grid cell by using the None target range and enabling Select Target Cell.
Camera Control Target #
Optionally change the camera control target to the selected cell during the cell selection.
The camera control must derive from the BaseCameraControl class (like all built-in camera controls).
Info Text #
Optionally display an info text box while the player selects a target cell.
The content can use text codes to add the selecting combatant’s content information (e.g. name) and used action’s content information.
Accept Question Dialogue #
Optionally display an accept question dialogue to ask if the player wants to use the accepted cell.
Cell Selection #
Optionally override the default cell selection settings.
Examine Grid #
Define how examining the grid is handled and displayed.
The player can examine cells on the battle grid and combatants placed on the cells through the Grid Examine command (e.g. via the battle menu or shortcuts). Examining the grid can also be set to be always active.
Camera Control Target #
Optionally change the camera control target to the selected cell during the cell selection.
The camera control must derive from the BaseCameraControl class (like all built-in camera controls).
Info Text #
Optionally display an info text box while the player selects a target cell.
The content can use text codes to add the selecting combatant’s content information (e.g. name) and the examined cell’s information.
Cell Selection #
Optionally override the default cell selection settings.
Cell Info Texts #
Similar to the info text, but allows setting up multiple cell info text boxes.
Cell info text boxes can be set up for different cell states, e.g. showing different content for empty or occupied cells.
They can optionally be toggled on/off via input keys.
Combatant Information #
Define the information about a combatant of an examined cell that will be displayed
Selecting a cell with a combatant can highlight the combatant’s move range or attack range (use range of the combatant’s base attack).
Additionally, you can add combatant info boxes, displaying combatant information in a UI box. You can add multiple boxes, e.g. displaying different content for player or enemy combatants. Add the combatant’s content informatoin via text codes and use a HUD as template to add more complex information and layout (e.g. value bars).
Battle Grid Cell Types #
The cell type defines a grid cell’s movement costs, deployment options and more. Battle grid cell types are set up in Battles > Battle Grid Cell Types.
Random Cell Type #
Optionally select a random cell type to replace this grid cell type it in-game. You can add multiple other cell types, each with a chance it’ll be used.
Using the random cell type setup will remove the rest of the settings discussed here.
Prefab Settings #
Define the prefab used by the grid cell type. Grid cells in your scenes will each spawn their prefab.
Additonially, you can add multiple prefabs to randomize the appearance of cells using the grid cell type.
The prefab settings can also define an offset used by prefab cell highlights (see the battle grid highlights documentation for details).
Cell Settings #
Define settings that affect cells using the grid cell type.
You can set the grid cells to be blocked, i.e. combatants can’t move on those cells. Optionally, blocked cells can still be passable, i.e. combatants can still move over them, but not stop on them.
Deployment #
Define if and which combatants can be deployed on this cell type.
The following deployment options are available.
- None
The cell is not available for deployment. - Player
Player combatants can be deployed on the cell. - Ally
Allies of the player can be deployed on the cell. - Enemy
Enemies of the player can be deployed on the cell. - All
All combatants can be deployed on the cell. - Faction
Combatants of a selected faction can be deployed on the cell. - Combatant
Places the defined combatant on the cell.
Individual grid cells in your battle grids in the scene can define their own deployment settings.
The deployment settings will be used for placing combatants on the grid, both for automatic placement and the player selecting combatant placement.
Costs #
Moving on/over a cell can cost the moving combatant.
This can reduce the combatant’s move range as well as reduce their actions per turn (only used in turn based and phase battles).
Additionally, you can define cell type costs to define different costs when coming from defined other grid cell types.
E.g. coming from a swamp cell type can cost more than coming from a regular ground cell type.
Object Variable Settings #
You can automatically add Object Variables components to the game object of this cell type.
The object variables can be initialized with default values.
Cell Events #
Optionally add events that can happen when a combatant interacts with a cell, e.g. apply a status effect when a combatant moves on a poisoned cell.
Cell events can be started by:
- None
Can only be started through schematics. - Any
Starts with any other type. - Move To
Starts when a combatant moves to this cell (i.e. target of a move command). - Move Over
Starts when a combatant moves over this cell (i.e. path of a move command). - Start Turn
Starts when a combatant’s turn starts on this cell.
This is used automatically. - End Turn
Starts when a combatant’s turn ends on this cell.
This is used automatically. - Move From
Starts when a combatant moves from this cell.
Please note that only start/end turn will automatically be used (also starts Any) – the rest has to be started manually via schematics using a Grid Cell Event node, e.g. at the start of a grid move schematic (Move From).
Cell events can also be added to individual cells in battle grids set up in your scenes and via schematics.
Ability #
Uses an ability with the combatant as a target.
Status Effect #
Changes status effects on the combatant.
Schematic #
Starts a schematic with the combatant as Starting Object.