JustPaste.it

1. Overview
Grid Master is a tactical game, based highly on (obviously) grids with fictional universum. Lots of mathematical humour, real-world metaphors and strategy. There are three layers of gameplay:
- economic (building the wealth of your country)
- expanding (grid-based map of the world, each cell is a province you can conquer)
- battle (main aspect of the game, where you fight with the AI enemy on a 55x40 grid. Rules of battle below)
 
2. Plot
The entire world is rectangular (thus pixelart style in graphics): world, battlefield, inhabitants of Squarius (continent), simply - everything. There are some Artifacts to collect, which could give you tremendous amount of geometrical power. Because of them a really long war fomented on the continent.
Intro (voice-overed)
Old days seem to be very distant and unreal, if we forget for a while about the eternal war and look back. Who could possibly think that there will be bigger issues than Aaron Coast, trying to break even on Wall Street? Or Trarii Legionaries, shaving every day just to be distinguishable from the barbarians in Alba? Nevertheless... the Pythagorean peace is gone.
Squarius lands have plunged into chaos ever since foreign emperors found out about existence of The Mighty Circle. Our previous ruler couldn't save this stunning ovalness from being discovered. This artifact is too formidable to just pass by it. Chariots without rectangular wheels, proper bowling - just... just think of the possiblities! But we are not that selfish - we are responsible.
If The Mighty Circle is used just once, the whole universe will reorganize itself into smoother shapes. Since the Atialiasing Artifact has not been found yet, our kingdom is obligated to protect The Circle by any means available. Although you have passed each of four exams with only 90 degree score, you have our permission. Save us.
God bless Squarius lands.

1892230.jpeg
 
3. Battle rules
Battle is fought on a 55x40 grid, after the player indicates which province he wants to attack (world map). Player starts down south with a deployment area of 10x40 (thus 400 units available to deploy). Computer starts up north with the same deployment area. Both sides have their towns (4x4 in the center of their areas) and they need a protection.
- Player objective
To destroy all enemy's formations (about them below) or to claim the enemy city (having a friendly formation inside a town for 10 turns does this).
- How to play
Game is divided into 4 phases.
DEPLOYMENT
There is a GUI which tells you how much and what kind of troops you can deploy from the garrison (if you DEFENDS your province) or siege camp (if you are ATTACKER of this province). One unit occupies one cell on the grid. Also, you can deploy barricades over the deployable area.
During this turn, most importantly, you can create FORMATIONS. Formations are objects that enclose all troops indicated by you and move, fight, defend and take damage as ONE ORGANISM. Without a formation assignment unit cannot move even an inch on a battlefield. Formations are always rectangular and have a size as small as to enclose all troops within it - even if this causes some empty cells inside. You can create those only during the deployment phase, and such a phase happens once per whole battle. (more on formations later, because they're crucial to the gameplay)
 
Screenshot (work in progress):
1892231.jpeg
 
Look at the formation nr. 1 for example. There are few blank spots, but it always tries to stay rectangular. Formations are rigid in shape, but if some units die and the current size it too big to enclose them - a formation shrinks.
 
MANEVUER
This phase happens repeatedly after two others (melee and ranged phases - described below). You can move your formations around, if no obstacle is in front of the direction of march (e.g. trees on grassland or cactuses on dessert). During maneuver, you can rotate your formations too. Clockwise or counterclockwise, if there is a space for it. And even during melee combat (below), to change exhausted troops to some fresh ones.
 
MELEE
Very important. When a friendly or enemy formation impacts with the opposite side troops, melee phase is triggered. Here the entire aspect of formations comes really clear:
1892232.jpeg
Formations impacts with their lines (there can be north, south, east or west line) and each line has statistics based on combined value of all units within it.
In this example player's north line has 8 units of jannisary (green units within green rectangle) impacting with 6 enemy units of legionary (blue troops within red rectangle).
Combined value of their attack points is (8*3)=24, their defense points aka HP is (8*2)=16.
All line is considered in combat, even when more than half of the north line isn't impacting the enemy.
Red attacks first (suppose he impacted within his maneuver phase). He deals... like... 14 damage, and it's substracted from our north line HP, leaving us with 2 defence points left over.
We attack, they receive some damage, and they counterattack. Now our defence point is below zero, so the player must decide which unit he wants to diminish.
1892233.jpeg
This is a strategic decision, even when it doesn't seem so. All because that you can retreat from melee combat, simply by killing your units causing the impact. When enemy is facing gaps rather than units, it's not longer relevant that their borders overlaping and melee is finished.
 
RANGED COMBAT
If formation consists of even one archer unit, ranged combat is executed by this formation. Archers have their shooting range and hit enemy units within this range. If they are engaged in melee combat, they cannot execute ranged anymore until melee is over.
 
other things to briefly describe:
1. lieutenants: each formation can have one commander with some predefined proficiency. Casts buffs or special abilities upon units or formations.

2. provinces: each province has capacity for a particular amount of buildings and units which can fit inside its border or feed. If you win by a tactical victory (mentioned earlier, taking over enemy town 4x4) you inherit all enemy buildings within this province. some of them might be destroyed unfortunately, if you ordered your siege machines to attack the fortress.

 

early apha (development stage - vision), basic functionalities enlisted below
https://drive.google...iew?usp=sharing
 
What I've implemented so far:

  • splash screen with particle effects
  • main menu
  • deploying units of two types (jannisary/legionary, 9 more to go), LMB click on empty cell
  • deleting units (keyboard 'U', LMB, hover units with mouse to delete more than one, or RMB click on unit to delete this particular unit)
  • creating formations (keyboard 'F', click and hover some units, or RMB to abort the operation)
  • deleting formations
  • hard-deleting formations (with all units inside)
  • movement (cell by cell, no pathfinding)
  • phase division (4 phases, indicator is located in the right-top corner)
  • next turn button (to switch phases)
  • formations quick numbers (to switch formations with digits, without clicking on them)
  • two types of battle view (keyboard 'Z') indicates the type of soldiers (footman/archer/cavalry)
  • debug mode (F3 to enable "rotation algorithm" to test it out, or keyboard 'O' to change terrain)
  • clear mode button
  • rotation (only in debug mode, still working on it)
  • one special abbility for formations (defensive testudo)
  • obstacles and terrain types

Economic aspect of the game

There are 9 different countries to pick when a new-game starts, like: Trarii Empire, Kebabuffer or Muricane Freedomium.

The economic room of the game is a place where player will spend most time, because battle room executes itself only when attacking/defending a province.

All countries have four basic wealth indicators (and two others):

  1. Cash
  2. Army
  3. Buildings
  4. Provinces
  5. Living space (described in province wealth below)
  6. Food resource (described there too)

You become a king of the chosen country with a predefined amount of each of this resources. World map generates randomly (15x15 grid = 255 provinces) and gives you some provinces to start with, then it gives the rest for 8 computer kingdoms. You have enough cash to build some cheap structures or to hire some units. You earn or loose cash by several actions, some of them might be performed on demand, others are performed each turn:

- for each building_type (buildings_amount * cash_flow_per_turn) ADDS CASH

- for each unit_type (unit_amount * salary_per_turn) LOSE CASH

- recruit troops (each country has three kinds of soldiers it can buy: native [cheap] - 1 type among 11 available, universal [very cheap] - 2 types, mercenaries [expensive] - other countries native units: 8 types) LOSE CASH

- build structures (several types, each of them grants you with different cash flow, can be destroyed during enemy siege) LOSE CASH

- Wall Street condition (this is a mechanic I'll explain further below, it's very interesting - because of it you can earn or lose cash. Let's call it 'diplomacy' for now) EARN/LOSE CASH

- local province economy (each province has a predefined value of cash flow due to its local industry or taxes; based on wealth value - so more local economy, the more buildings you can build there and more units you can feed - explain further below under province wealth logic). EARN CASH

 

After you did all the actions you wanted (you can perform 20 of them during your turn: even moving a unit from province to another province consumes 1 action point), you can click "next turn" and let the computer adapt and deduce his actions for each computer country.

 

Wall Street condition

Every kingdom can decide how to behave in Wall Street (you have some federal companies in there). You can either postpone crisis or cause it. You cannot change your decision for several turns, and then your opinion is added to the global result.

1892425.jpeg

If your decision is winning currently, you gain advantages in some of the aspects, in the same time struggling with drawbacks on another.

For example:

  • Winning decision is "causing"
    every country that backs this decision have 30% stronger army, countries opposing this decision have 5% stronger armies.
  • Winning decision is "postponing
    every country that backs this bahaviour have 45% more cash flow, others: 10% more.

I called it diplomacy earlier, because if you win 3 times in a row with a certain country, then it automatically backs your decision and follow your lead on Wall Street. Thus you can "persuade" AI to cope with you :)

 

Province wealth

This is a very important aspect in sake of the AI programming, so let me explain it to you.

During world generation, Grid Master assigns some random value from 1 to 10 to each province. This is its wealth value. Higher it is, the better.

Wealth determines how much buildings you can build here (combined value of all your provinces building capacity is called LIVING SPACE), and how much troops you can feed (FOOD RESOURCE). Speaking of the food resource:

1892430.jpeg

 

AI and the wealth indicator - how does it links?

Well, AI and player really should take the wealth value into account. Why?

Suppose this situation:

 

You attack from this province (it needs to be mentioned that you can only attack adjacent provinces)

  • 10 food points
  • Grassland
  • 3 wealth points

And the computer defends in this province

  • 35 food points
  • Dessert
  • 7 wealth points

Do you think that you could possibly engage there 35 troops, because this is the food value of the attacked province?

Nope. Only AI can deploy there 35 troops, but you can only consume 10 points of food. And, most importantly. You won't fight on the grassland.

The wealthier province imposes its conditions, and you can only adjust to that. This results in a situation when a single very rich province has a "circle of influence" above other adjacent provinces)

1892435.jpeg

Thus... AI should try to attack from wealthier to weaker provinces, same as you would do. Because this creates a huge advantage to benefit from.

Hope the economic aspect is explained well.