A General’s View – Complete Game

Author’s Note: I mentioned in my last post that I had been working on my final year project for college. Just wanted to share what I came up with in the end. The project is a two-player game based on A General’s View, the tabletop strategy game that I designed in 2015 and is written using the Allegro 4 game library. The game is not particularly sophisticated and there are a few interface bugs that need to be ironed out, but it works and could be used for the basis of a more sophisticated game in the future.

The game is played by two human players with the following controls:

Map keys

Up, Down, Left, Right – move cursor

Enter – enter menu

Menu keys

Up, Down – move cursor

Enter – select menu option highlighted by cursor

For full rules and objectives of the game, please see A General’s View: Rules (Alpha Version). Please note that in this version of the game, at most one unit from each player can occupy a tile at once.

The game (in both Windows executable and source code forms) can be downloaded from the following link: https://drive.google.com/folderview?id=0B_lGPZTjA4fzbHN4YVExelBEejA&usp=sharing



A General’s View – Rules (Alpha Version)

Author’s Note: I’ve been rather preoccupied with other things at the moment, including the Rugby World Cup and getting to work on my final-year college project. With respect to the latter, the following post illustrates some of the work that I have had to do for this project.

An industrial era turn-based strategy game for 2 players.

Section 1: Play Rules

  • The game is played between two players, one who is identified as the red player and the other who is identified as the blue player.

  • The game is played on a square grid, called the battle map, where each square on the grid has one of three states of ownership: neutral (or no ownership), owned by the red player, or owned by the blue player.

  • At least 2 of the squares on the battle map are identified as –city– squares. The same ownership rules apply for these squares as any other squares.

    • Each player starts with an equal number of the city squares on the map, where the number of city squares owned by a player at the start of the game is at least 1.

    • A player wins the game when all city squares on the map are owned by that player.

  • The game is played in turns, where one of the two players acts and is referred to as the acting player, with the other player referred to as the opposing player. At the end of their turn, the current opposing player becomes the acting player and vice versa.

    • Before the game begins, both players roll a 6-sided dice. The player who gets the highest value on the dice chooses whether they wish to act first or second. If the value rolled on the dice by both players is the same, the players reroll the dice until the values that each player receives are different.

  • The ownership of the squares on the map is contested by units controlled by each player.

    • A unit is a single game entity representing a company-sized group of 100 soldiers of a specified type and represented by a single game piece.

    • A unit possesses several characteristics which will be discussed in more detail below: ownership, cost, attack value, defence value and movement points.

    • Units may be put into play on a player’s turn. In order to put a unit into play, they must pay the specified cost for that unit type and then place that unit on one of the city squares which they own. The player who put the unit into play is its owner.

  • Each player starts with a predetermined and equal amount of gold, which is called their total gold value.

    • Gold is used to pay for new units, with the cost of each unit specified in gold and subtracted from the total gold that a player possesses when that unit is put into play.

    • If the cost of a unit is greater than the total gold possessed by a player, they may not put that unit into play.

    • Each city square on the map has a specified gold generation value which is determined before the start of the game. This is used during the gold collection phase of a player’s turn, discussed below.

  • Each player’s turn is composed of four phases: Gold collection, unit movement, attack and cleanup.

    • During the gold collection stage, the acting player adds the sum total of all of the gold generation values of the cities which they own to their total gold value.

    • During the movement phase, the acting player may move any number of their owned units (including zero units).

      • A unit may be moved a number of squares adjacent to each other horizontally and/or vertically across the battle map. The number of squares that a unit may be moved is determined by the unit’s movement points, which represent a unit’s movement capability in a single turn. For each square that a unit is moved, 1 point is deducted from the unit’s movement points for that turn if the square into which the unit is moving is either not owned or owned by the acting player, while 2 points are deducted if the square into which the unit is moving is owned by the opposing player. A unit may move any number of squares horizontally or vertically until they do not have enough remaining movement points to move into any adjacent squares. These rules are illustrated in Figure 1.1.


Figure 1.1: For a unit with three (3) movement points, the green squares represent squares into which the unit can move during one turn if the squares are either not owned or owned by the unit’s controller. The squares marked with yellow crosses represent squares into which the unit can move if the squares are owned by the opposing player. The red squares represent squares that are always outside of this unit’s movement range for this turn.

      • If a unit moves through a square which is not owned by the acting player and which contains no units owned by the opposing player, the ownership of that unit is transferred to the acting player.

      • If a unit moves through a square which contains one or more units owned by the opposing player, the unit may move no further squares during that turn.

    • The attack phase involves all squares in which units owned by both the acting and opposing player are present.

      • For each square containing units owned by both players, the acting player selects the unit in that square which they own with the highest attack. The opposing player selects the unit in that square which they own with the highest defence. If two or more units owned by either player has the same attack or defence value respectively, they may choose any of the units with that value.

      • The attack value of the acting player’s selected unit and the defence value of the opposing player’s selected unit are added together. This value is referred to as the reference value.

      • A suitable random number generator or fair pseudorandom number generator is used to generate an inclusive integral value between 1 and the reference value. If this value is below or equal to the attack value of the acting player’s unit, that unit wins and the opposing player’s unit is removed from the battle map and from the game. Otherwise, the opposing player’s unit wins and the acting player’s unit is removed from the battle map and the game.

      • If the acting player’s unit wins, the opposing player selects the unit in that square which they own with the next highest defence. Otherwise, the acting player selects the unit in that square which they own with the next highest attack.

      • The above steps continue until all units remaining in that square are owned by a single player. If that player does not own that square, the ownership of the square is transferred to that player.

    • During the cleanup phase, 1 supply point is subtracted from all units owned by that player and not currently receiving supplies as per the supply point system, described below.

  • Each unit when created starts with 3 supply points, representing ammunition, provisions and other military supplies.

    • A unit receives supplies every turn if there is at least one adjacent square owned by that unit’s owner and if, from that square, an unbroken, direct line can be drawn in horizontal or vertical steps from square to square in a manner similar to unit movement to a city owned by the unit’s owner. This is illustrated in Figure 1.2.


Figure 1.2: In the first example, there are two squares adjacent to the unit which are owned by the unit’s owner. From both of these squares, one can trace a direct line in horizontal or vertical steps from square to square to a city owned to the unit’s owner. In the second example, there is one square adjacent to the unit which is owned by the unit’s owner; however, as one cannot draw a direct line from this square to a city owned by the unit’s owner, it is not supplied through this square. Similarly, the squares to which direct lines can be drawn from the city are either not adjacent to the unit or are not owned by the unit’s owner and therefore the unit is not supplied through these squares.

    • A unit that does not receive supplies at the end of the unit owner’s turn subtracts 1 from that unit’s current supply points until the number of supply points for that unit is 0.

      • A unit which has 0 supply points is treated as having an effective attack and defence value of 1 rather than its usual values until it receives supplies again.

    • A unit that receives supplies at the end of the unit owner’s turn does not subtract from that unit’s supply points and if that unit has less than 3 supply points, it adds 1 to its number of supply points.

Section 2: Unit types

  • Militiamen: Poorly armed and poorly trained, this unit represents an impromptu group of irregulars, such as a volunteer town militia or a set of conscripts pressed into action.

    • Cost: 50 gold

    • Attack: 2

    • Defence: 2

    • Movement Points: 5

  • Line Infantry: The core of an early industrial era army, line infantry represent a significant step up from militia, being drilled to stay in lockstep along rectangular formations designed to present a coordinated line of fire to the enemy. With their discipline and morale, they present a strong defensive line.

    • Cost: 100 gold

    • Attack: 2

    • Defence: 5

    • Movement: 5

  • Skirmishers: This infantry unit forms looser formations than line infantry and, armed with more accurate muskets than other units, their goal is to harry oncoming formations and break their coordination by attacking their officers. However, their loose formations can also represent a weakness, as a committed and concentrated attack can easily divide them into units too small to effectively fight back.

    • Cost: 100 gold

    • Attack: 5

    • Defence: 2

    • Movement: 5

  • Hussars: A type of light cavalry, hussars are most regularly used for reconnaissance and raiding, but can, if an opportunity arises, attack effectively against a vulnerable and coordinated foe, using their sabres to great effect. Lacking armour or long-range weaponry, hussars lack the ability to effectively defend themselves if they are outmanoeuvred.

    • Cost: 120 gold

    • Attack: 4

    • Defence: 2

    • Movement: 7

  • Dragoons: More like mounted infantry than true cavalry, dragoons ride to battle but will usually dismount when the fighting starts, forming a rectangular formation similar to line infantry and attacking with their shortened carbines. Not as effective as line infantry, but able to provide support where necessary, dragoons can, nevertheless, be used as cavalry in a pinch.

    • Cost: 120 gold

    • Attack: 2

    • Defence: 4

    • Movement: 7

  • Lancers: While the style of lancers may have changed drastically from the armoured knights of the medieval era to the altogether more lightly equipped troopers of the industrial era, the lancer has lost none of its potential to destabilise an entire front if used properly. With a devastating attack that can shatter enemy infantry formations, lancer squadrons represent the shock troops of the age, but are no less susceptible than any other light cavalry unit.

    • Cost: 160 gold

    • Attack: 6

    • Defence: 2

    • Movement: 7

  • Cuirassiers: The elite of the battlefield, cuirassiers are one of the few armoured units on the industrial era battlefield. Wearing a metal breastplate and backplate, the armour of a cuirassier does little to protect him against musket shots or artillery, but provides an extra layer of defence against sabres or bayonets. Slower and more cumbersome than other cavalry units, cuirassiers nevertheless possess an élan which can be hard to overcome.

    • Cost: 160 gold

    • Attack: 5

    • Defence: 3

    • Movement: 6

  • Artillery: The so-called “King of Battle”, artillery batteries have the biggest guns with the greatest power. Used effectively, an artillery strike can have terrifying effect, smashing through infantrymen and cavalry alike. However, its immobility – even with the use of horse-drawn limbers and caissons – means that it is particularly susceptible to attack if not appropriately protected by other forces.

    • Cost: 120 gold

    • Attack: 10

    • Defence: 1

    • Movement: 3