Description of the game

The outside (Connected by three entrances with the Combat zone)
It is the area where zombies appear, soldiers and civilians do not usually go there, but it is the entrance to the military part where humans are.
Combat zone
In this zone, there are several barricades, the civilians watching the zone in case they arrive zombies, and the soldiers prepared to act.
Military barracks
This is the area where are the military barracks and the turret barracks, a little more on the trail there are the civil buildings. Here is no combat but it can be reached, it is a management area.

Entities

Soldier
This entity is generated from the buildings of the military zone. Once generated, they will patrol the entrance of the base and defend their position against the enemy horde.
Citizen
They are dedicated to monitoring the base, but they can not fight. Them are an easy prey for zombies.
Zombie
This entity will be generated outside the military base and will move towards the civil zone. His attacks are melee.
Turret
Is the first **smart object** in the game, player can buy a turret and put it where he want (not if collide with other and inside of the combat zone). The turret will defend the base and will communicate with the soldier to tell him if it has to be recharged.

Controls

Mouse Left Click : Interact with the environment
While building the turret :
      Escape: Cancel the buy
      First click - Place the turret
      Second click - Set the rotation of the turret
Cursor arrow / Mouse in the border of the screen : Move the camera
Shift will increase the speed x2
Mouse wheel : Camera zoom in/out
Escape : Close the game

How to play


Each dead zombie provides gold coins which is the main resource of the game. With these coins the player will have the option of increasing the number of military buildings in case there are missing soldiers in the base, barricades can be bought at the entrance of the base so that the soldiers can cover themselves from the enemy shots and build the medical camp to heal wounded soldiers.
The objective is to defend a specific number of rounds the base, each enemy horde will be more difficult than the previous one. If the user does not build the buildings or barricades in the correct order he will soon be defeated by the zombies.

Costs / Money resources

The costs are basically the construction of buildings. If a building is destroyed it disappears, so it must be rebuilt (can not be repaired).
You get resources through killing zombies. Each zombie give a coin, each coin are 10 points. Sometimes will appear a zombie horde, it's a good opportunity to win extra cash.
The turrets barrack cost 50 coins.
Turret cost 30 coins.
Heavy Wall cost 50 coins (1st), 70 coins (2nd) and 100 coins (3rd).

Constructions

Turret Barrack
Player can purcharse turrets and put them where he wants.
Turret
Build steps: First emplace the turret in a valid area. Second aim the turret.
It shoots zombies when enter at the aim area (after shooting a zombie it needs to reload).
The turret will send messages about the recharge status to the nearest soldier.
Heavy Wall
This entity will be generated outside the military base and will move towards the civil zone. His attacks are melee.
It's a double-edged buy since it's an advance to win the game but in turn the heavy wall affects the difficulty of the game as it makes the zombies become faster permanently.
When player buy a Heavy Wall the zombies will try to enter from other side (running).
Citizens will go to the town if the zone that their was patrolling now is covered with the heavy wall.
If player construct the 3 Heavy Walls win the game.

AI features

Disclamer for first assignment: Since our game is about defending a base and killing entities, for the first delivery we had to make the entities interact with each other more than we would have liked so that the concept of the game could be understood. That's why the soldier and the citizen have more than two routines to follow in the game cycle.
About the behaviour trees: All the behaviour trees have the repeat function so in case that the main selector receives true or false, the tree will run again.

SOLDIER The core of the AI will be carried by the soldier's entity and citizen's entity. The citizen can advise from zombies atack and the soldiers fight. Soldiers can find zombies, but they don't patroll too far, so they need the citizens.

Behaviour Tree & Atomic behaviours
Back to patrol: This same task is used both in the soldier and in the citizen. Activates the scripts needed to make a path and returns true when it reaches the destination.
Patrol: This task is also used in the citizen and the soldier. It activates the tracking of a path fixed in the perception script of the gameobject that is executing this task. When is used by the soldier, return true if any citizen warns him of the presence of a zombie, and returns false if there is some turret unloaded (the turrets are smart objects that send messages to the soldiers about the ammunition they have).
Go To Unload Turret: The soldier makes a path to the turret and returns false when it is near it.
Reload Turret: The soldier reloads the turret and returns false, in this way the beheaviour tree is executed again making it go back to the task: Back to Patrol.
Search For Threats: The soldier calculates the path to the warned zombie and the movement scripts are executed.
Threat found decorator: Allows you to advance to the beheaviour tree when the soldier has the zombie within reach.
Delete Threats: The soldier eliminates the zombie and executes the sound and appropriate animations. Finally the behavior tree is again executed.


ZOMBIE
Behaviour Tree & Atomic behaviours
Lazy Walk: The zombie goes towards the military base, it returns true in case of detecting a citizen / soldier / turret. And it returns false in case of detecting that the entry in which it is found has been blocked.
Find Other Entry: In this task, the zombie will look for an entry that has not been blocked and will go to it. It returns false as soon as it is in a clear entry and, therefore, the behaviour tree will run again, returning to the task: Lazy Walk.
Chase People: This task will execute the steering behavior of pursuing the citizen detected in the task Lazy Walk. This task returns false when the zombie is shot by a turret or soldier.
Die: In this task the zombie reacts to the received shots with audio and animation to be later eliminated.

CITIZEN
Behaviour Tree & Atomic behaviours
Back to patrol: This same task is used both in the soldier and in the citizen. Activates the scripts needed to make a path and returns true when it reaches the destination.
Patrol: This task is also used in the citizen and the soldier. It activates the tracking of a path fixed in the perception script of the gameobject that is executing this task. When patrol is used by the citizen, return true if the citizen see any zombie or return false if you build a barricade where he was patrolling.
Go home: This task builds a path for the citizen to return to the city and be destroyed.
Advice Soldier: The nearest soldier is searched, a path is made to it and the movement scripts are executed.
Zombie Warned decorator stops the flow of the behaviour tree until the citizen is within reach of the soldier.
Wait: The citizen waits till the warned zombie is killed, then return false and the behaviour tree starts again.

TURRET
The turret, being a fairly simple intelligent object, is managed with a simple state machine.
Atomic behaviours: Wait: The turret will wait until a zombie enters its firing zone.
Point: The turret will aim at the zombie before shoots.
Shoot: Shoot a zombie and kill him instantly.
Reload: After shoot, turret will be useless until a soldier go and reload the turret. In this phase, the turret will send messages to the nearest soldier to recharge.

How to play


Each dead zombie provides gold coins which is the main resource of the game. With these coins the player will have the option of increasing the number of military buildings in case there are missing soldiers in the base, barricades can be bought at the entrance of the base so that the soldiers can cover themselves from the enemy shots and build the medical camp to heal wounded soldiers.
The objective is to defend a specific number of rounds the base, each enemy horde will be more difficult than the previous one. If the user does not build the buildings or barricades in the correct order he will soon be defeated by the zombies.

Made by: