The game is won by occupying all the 16 regions on the world map or you can survive for 20 days. The game can also be lost by losing all your territories through being conquered by other countries or consumption of your own military power and manpower after each attack.
[Instructions on how to install and run the game, including any prerequisites or dependencies.]
The game can be executed in Linux terminal.
If you are Windows users typewsl to access it.
- cd to the exact directory
- type
make start
This game requires only one player to type commands.
You can type new to start a new game; type load or previous to load saved game, a new game is started if there is no saved game.
There are 4 interfaces.
to i1, to i2, to i3, to i4.
show builtlisted the buildings you now have.show buildablelisted the buildings and their max amount you can build nowshow info BUILDING_NAMEshow the details of a building you type in the BUILDING_NAMEbuild NUM BUILDING_NAMEbuy NUM amount of building with the name BUILDING_NAME typed.
move NUM [solider/tank] from x,y to x,yis the command to move your soliders and tanks from your lands.
Type end to end the current game day.
Type help to see the command guides.
Type quit to save and leave the game.
- Chan Yiu Sing (IORIshizuku)
- Cheng Ching Yan Grace (flyuzu)
- Chiu Yi Shun (Eylssca)
- Hui Chi Ming (JimmyHCM)
- Kwong King Lam (azidoazideazide)
*name in bracket is the nickname in GitHub
We have not used any non-standard C/C++ libraries in our game.
There are 4 countries in total and there are four resources for each country, namely population, food, fuel, metal. In each turn, territories, city index and the amount of resources will be altered after you have made different choices.
Type “new” if you are new to the game. If you want to load back your previous game status, please type “previous”. You will be assigned to one of the 4 countries and you will receives the corresponding resources. You will need to make good use of your own resources in the following time. After the beginning of each turn, you can choose to increase the number of soldiers or add more resources or attack other countries. You can do more than one action in each turn. After all your modifications, you have to declare the end of that turn. Then, all the changes regarding to resources, territories and city index will be made and one day will be passed. You will repeat step 2 and 3 until the end of the game.
You can save the game progress at any time, so that you can get back to it next time if you have not reached the state of victory or loss.
The game world is a 4x4 map consisting of 16 territories. The 4 territories at the 4 corners are being occupied by each country respectively at the beginning of the game. The remaining 12 lands remain unoccupied at first and players will have to send troops to the desired land and fight with their enemies before they can get the land. Failure may occur depending on various factors, such as starvation.
- Your enemies are controlled by random factors. They may have different actions in each turn.
- We will remind you if you give an invalid command.
- You can check your amount of resources at anytime during the game.
- Every time when you quit the game, your game progress is saved. Thus, you can get back to the previous status when you enter our game again later on.
In the beginning of every game day, players will see a random story. Some may have bad or good effect to the player resources.
In each day, countries controlled by computer has 0 to 4 moves. In these moves, they can choose to build buildings and move soldiers like the player does, for example, they may build more mines, factories, houses or other buildings.
The npc countries may send troops to random lands on the world map with random number of soldiers.
class Military_Resouces: a class representing a set of military resources, including the number of soldiers and tanks.class Resources: a class representing a set of resources, including food, fuel, metal, citizen, and other attributes such as maximum population, livelihood, military strength, diplomacy, and military factor.class Building: a class representing a building, including its name, requirements, description, effect, cost, production, limit per land, and initial quantity.class i3Map: a class representing a world map, including the military resources of each country and its owner.class Country: a class representing a country, including its resources and attributes, such as whether it is dead, the building limits and quantities it owns.
std::map and std::vector are used a lot in the code.
The user interface can be read inside UI.cpp and UI.h The class UI is constructed as a game screen. It is a 2D grids of characters in 120 x 47. It allows the divide of game screen into different ui_regions showing different informations. For each ui_region, drawing of content to the screen is automatically aligned at center vertically. The developers can decide the horizontal alignment of the content to be to the left, at center or to the right. The word and background colors of each ui_region can be modified by developers.
We have used the “new” function to create a dynamic array to as a buffer to store the line by line screen drawing for the UI design. We use the “delete” operator to deallocate the memory after drawing the lines for the UI. We do not use the “malloc” function, so memory does not need to be “free” afterwards.
We have implemented file input/output functionality to allow the player to save and load their game progress so that he/ she can get back to his/ her previous status when he/ she re-opens the game.
Our code is organized into multiple source files to improve readability and maintainability.

