Tiling Module

The Tiling module contains

  1. Hex and Square tile coordinate system, allowing the tile centres, the tile sides and the tile vertices to each have their own unique 2 integer coordinates.
  2. Tile collections, tile paths and tile polygons and other tile structures, allowing their manipulation as tiles.
  3. Tile grid classes that describe the tile grids but do not contain any data. For example an 8 by 8 square grid would describe a chess board, but the class contains no data as to the position of the chess pieces, or even that it is being used for achess game.
  4. Tile Grid system classes allowing for multiple hex grids to be manipulated the same as a single grid. This enablesthe code in the EGrid module and other possible non Euclidean tile systems.
  5. Projections. Projections allow the separation of the visual display of tile geometry from the applications and objects within the grid systems.
  6. Scenario and Game terminology,
  7. Turn system allowing those grid systems to be used in, multi, simultaneous, homogenious segment simultaneous turn games and productions.
  8. Example games to demonstrate the use of the design principles and code of this module.

Game Terminology

Coordinate System

So the primary focus of this project is regular tiling. Some strategy games use irregular tiling systems such as the old board game Diplomacy the grand strategy Paradox Interactive game series Victoria, Europa Universals and Hearts of Iron, or the classic board game Risk, which has become popular in its online form.Irregular tiles provides great flexibility when representing geography from the real world, allowing the game designer to greatly exaggerate the features and boundaries, they want and to downplay and ignore the features and boundaries they consider less important or distracting. The two dominant regular tiling systems are standard squares and hexs. Tranlge while useful as a graphics primitive is not useful for strategy games. It is also possible to tile with squares where alternative rows or alternate columns are offset.

But from here on I'm only going to consider the standard square tiling and hex tiling. We'll focus on the hex grid system first but a lot of what I say will apply to hex and square tile grid. Now with hex tiling we have a choice between nice continuous rows and nice continuous columns. without too much ado I have chosen to keep rows over columns. We write in rows not colunms and this means on real world hex maps our hex rows can follow lines of latitude, right around the earth if necessary, where as if you want to go north or south you have to zigzag. We'll assign tiles some row and column integer coordinates. Straightforward for the squares, the only diference with the hexs is that when I move right I increase by 2 column units. If I go up-right I go up 1 row and right 1 column. If I then go down-right I down 1 and right anther column giving the same result of same row coordinate but column increased by 2.

So things are still pretty simple right? A hex is either land or its water. A hex is either hilly or or its not. If we were creating some kind of low level Dungeons and Dragons type game a square could be either be rock which you can not enter of the open space of a room or a cavern which you can enter. Unfortunately this is not going to work at least for real world maps. So I have mapped Britain at a number of scales including 80km hex tiles. At this scale mainland Britain occupies 15 hex rows from Cornwall to the north of Scotland. However the English Channel, or La Manche at its narrowest point still does not occupy a full hex at this scale.

The hex tile coordinate system not only allows each hex tile to be given its own unique coordinate, but also assigns a unique coordinate to each of the separating borders between the hexs and to each of the vertices of the tiles.

2; 2 2; 6 2; 10 2; 14 4; 4 4; 8 4; 12 6; 2 6; 6 6; 10 6; 14 1; 1 1; 3 1; 5 1; 7 1; 9 1; 11 1; 13 1; 15 2; 0 2; 4 2; 8 2; 12 2; 16 3; 1 3; 3 3; 5 3; 7 3; 9 3; 11 3; 13 3; 15 4; 2 4; 6 4; 10 4; 14 5; 1 5; 3 5; 5 5; 7 5; 9 5; 11 5; 13 5; 15 6; 0 6; 4 6; 8 6; 12 6; 16 7; 1 7; 3 7; 5 7; 7 7; 9 7; 11 7; 13 7; 15 1; 0 1; 2 1; 4 1; 6 1; 8 1; 10 1; 12 1; 14 1; 16 3; 0 3; 2 3; 4 3; 6 3; 8 3; 10 3; 12 3; 14 3; 16 5; 0 5; 2 5; 4 5; 6 5; 8 5; 10 5; 12 5; 14 5; 16 7; 0 7; 2 7; 4 7; 6 7; 8 7; 10 7; 12 7; 14 7; 16
  1. ScenWorld The universe of the scenario. Entities within the scenario universe have no knowledge of entities in the GameWorld or the OutWorld.
  2. GameWorld the universe of the players in the game. The assignment of PlayerControl. The time dead lines and time credits for submission of turn Directives. Rules on credits from InGame achievements or role-playering accreditation on future assignment of InWorld entities. Rules on Player communication.
  3. OutWorld Anything outside of the Player universe. This can include servers, security, payement etc.
  4. Player A GameWorld entity. Maybe a human, an AI or a script.
  5. PlayerControl Assignment of an InWorld entity to a Player's control.
  6. Directive A player directive given by a player to an InWorld entity at the begining of a turn.
  7. ControlHeirarchy The precedence order of PlayerControl for Directives if multiple players are given control of an InGame entity.
  8. Intention Intention to make an effect by an InGame object. An Intention has a single SourceTile and a single TargetTile.
  9. SourceTile The location of an entity making an Intention.
  10. TargetTile The target an Intention. Maybe the sourceTile. For some Intentions it must be an adjacent tile for others it maybe a non adjacent tile.

Turn Resolution

  1. Verify directives from Players are valid and under the PlayerControl
  2. Resolve ControlHeirarchy
  3. Map Directives to intentions. In more complex games some Directives maybe ignored or defered by InGame Objects.
  4. Aggregate Intentions.
  5. Add subsidary Intentions.
  6. Resolve Segment
    • Accumulate. Aggregate the intentions in their TargetTiles.
    • Ajudicate. Determine the outcome of the Intentions and processes.
    • Consolidate. Create a new game state from the outcomes of the Intentions on the TargetTile. No Movement is implemented during this stage.
    • Distribute. Distribute the movement effects of the resolution of the TargetTiles on the SourceTiles in the Consilidated Game State. Moving entities from SourceTiles to TargetTiles when appropriate.
  7. Repeat Resolve Segement till the given number of segments has been repeated.
  8. Inform the players, human and AI, of the Turn resolution.