06 AI Assignments
--------------------------------------
-Assignment 1-
--------------------------------------

For Assignment 1, we were tasked to create a simulation by creating AIs with multiple states. So I created a restaurant simulation with 5 different AIs (Customer, Receptionist, Waiter, Chef, Baby)
--------------------------------------
Customer

The Customer queues up and upon reaching a table, would take a random time to order. Each customer has different amounts of patience. While waiting for food, his patience would drop. He would then tip at the end based on how much patience he has left.
.png)
< Mouse over for state diagram
--------------------------------------
Receptionist

The receptionist waits for customers to queue. If there are empty tables the receptionist would then go and bring the customers to the table and seat them. If the group has a baby, he would then go bring a baby chair to the table.
.png)
--------------------------------------
Waiter

When all customers at a table are ready to order, he would go to the table and take the order. If the chef has served a plate on the counter, he would pick it up and bring it to the correct table.
.png)
--------------------------------------
Chef

The chef has energy. When there is an order she would proceed to cook. She would also need to use energy to put out fires. After cooking, if her energy is <0, she would rest instead, only being ready to cook when she has max energy.
.png)
--------------------------------------
Baby

The baby has a random chance to cry. If the baby cries, the patience of the customers at the same table would drop faster.
.png)
--------------------------------------
Through this assignment, I learnt how to create AIs with multiple states and how their behaviours would change depending on who/what they are interacting with.
--------------------------------------
You can watch the sample video here:

--------------------------------------
--------------------------------------
-Assignment 2-

For assignment 2, we had to implement tile-based movement and pathfinding into the game.
--------------------------------------
Player

The player can click on any of the green markers to take a step. The red markers show how much energy the player has left. The player's job is to catch all the thieves and then proceed to the next floor.

--------------------------------------
Thief

The thief has to find the treasure. So by using Depth-first search, he has to scope the entire level until he finds the treasure.

--------------------------------------
Assassin

The assassin will patrol along a path until the player gets close enough which he will then use AStar pathfinding to reach the player by the best route as there are puddle/door tiles which cost more energy to go through

--------------------------------------
Through this assignment, I learnt how to create AIs that can traverse tile-based maps using DFS, BFS and AStar pathfinding.
--------------------------------------
You can watch the sample video here:

--------------------------------------
-Assignment 3-
--------------------------------------

Assignment 3 was a very short assignment where we had to make a game where we can play against an AI in a game where you summon troops down a lane.
--------------------------------------
In this assignment instead of being grid-based, we had to do node-based pathfinding instead which is displayed by the red circles being the nodes while the lines showing the connected nodes.
--------------------------------------
Troops




There are 3 different troops all having the same 3 states (Move, Chase, Attack).
However, each of them has a different amount of 'point' so that the AI can decide which lane needs help and what is the best move for it.
For the AI, 4 weights are considered:
1.Player's towers' health in the lane.
2.Enemy's towers' health in the lane.
3.Number and type of enemies in the lane.
4.Number and type of minions in the lane.
-->There is also a random noise added to randomize the spawning
a little
--------------------------------------
The AI also has changes playstyle.
Offensive(ignores player's towers' health).
Defensive(ignores enemy's towers'health).
Changes to Defensive strategy if damage taken is too much.
Changes to Offensive strategy if damage taken by the opponent is more than AI.
--------------------------------------
Through this assignment, I learnt how to create an AI that can make decisions based on what is on the map to get the most optimal results.
--------------------------------------
You can watch the sample video here:

--------------------------------------
You can check out the game, source code and documentation here:
Password : references