Turn Based Strategy Grids

Zhi Kang Shao - Feb 9, 2015

Tools for representing and querying 2D grid worlds, targeted at turn based strategy games.

  • Supported Platforms
  • Supported Engine Versions
    4.7 - 4.12, 4.25
  • Download Type
    Asset Pack
    This product contains an assortment of Unreal Engine assets which can be imported into a pre-existing project of your choice.
Video: https://www.youtube.com/watch?v=0hrfFMf1eR8

This blueprint system provides developers of turn based strategy games with logic for managing and querying 2D grid worlds. Its main function is the computation of action grids: queriable grids that efficiently store all pathing and attack options available to a unit during its current turn. Square tiles and hexagonal tiles are supported, but line of sight is not yet implemented for hex tiles.

Action grids are intended to be used for efficiently retrieving shortest paths to any reachable tile, for displaying the movement and attack options that are available to the player's selected unit, and for providing AI units with a search function to retrieve the set or a subset of valid actions, which can then be processed by your high level AI controller.

The system includes features such as editing of level layouts in the editor and at run-time, multiple terrain types with different interaction per unit and optional line of sight checking when determining which tiles are in attack range. Action grids can be merged to represent the influence radius of multiple units. An example map and player controller is included that demonstrates usage of the plugin in blueprints and handling of player input. All blueprint is commented.

A detailed user guide for this plugin is available at: http://www.zkshao.com/downloads/TBStrategyGrids_UserGuide.pdf

Technical Details

Any blueprint class can be made compatible with the plugin by implementing the included blueprint interface IGridActor.

The included LevelGrid blueprint has a number of functions prepared that can be overridden in a subclass for the following customization purposes:
- Defining unit-terrain interaction: accessibility, movement cost, targetability
- Defining vision-terrain interaction: whether a tile's area and corner block line of sight or not
- Defining unit-unit interaction: whether unit A can pass through unit B and whether unit A can attack unit B

The example map demonstrates customization via the subclass ExampleLevelGrid which makes mountains more costly to pass, allows units of the same team to pass through each other and allows units to only target enemies.

Intended Platform: Desktop