diff --git a/README.md b/README.md
index d829b82..aa894cf 100644
--- a/README.md
+++ b/README.md
@@ -18,6 +18,7 @@
- [Group Project in TDT4240 - Software Architecture](#group-project-in-tdt4240---software-architecture)
- [Introduction](#introduction)
+ - [Game play](#game-play)
- [Installation and Setup](#installation-and-setup)
- [Prerequisites](#prerequisites)
- [Installing](#installing)
@@ -29,6 +30,12 @@
## Introduction
+Besieged! is a cooperative, real-time multiplayer tower defense game inspired by Viking and Norse mythology. Supporting both single player and multiplayer. Players collaborate in shared instances to defend their village against waves of mythological creatures. Gameplay involves purchasing and strategically placing combination of "tower-cards"—on the map to build unique towers that attack invading enemies. Each kill grants players money to acquire more cards. Enemies spawn in waves and follow a set path toward your village; if they succeed in destroying it, the game ends. Besieged! innovates on traditional tower defense mechanics, such as those in Bloons Tower Defense 4, by enabling dynamic tower creation through card combinations.
+
+### Game play
+
+[![Trailer](https://img.youtube.com/vi/hZOwTa846p4/0.jpg)](https://www.youtube.com/watch?v=hZOwTa846p4)
+
## Installation and Setup
### Prerequisites
@@ -123,6 +130,44 @@ To run the tests, you can use the following command:
./gradlew test
```
+### General overview of how the game runs when starting either a singleplayer or multiplayer-match
+
+
+
The GameApp, which is the entry point of the application, creates the GameLauncher.
+
+ The GameLauncher creates all the different instances of the necessary interfaces that are needed to run the application like drawing, audio and input. It also creates the Data Access Objects (DAOs) for the client and server. It also creates the GameClient itself.
+
+ The GameClient tells the ScreenManager to initialize and enter the Menu state, i.e. the main menu.
+
+ The Menu-state instantiates the required ECS-systems like the InputSystem, RenderingSystem, AudioSystem.
+
+ The GameApp starts its update-method which updates the GameClient continuously, which in turn updates the ECS-system. Review the next subsection to get a better deeper understand of the update-cycle in the ECS.
+
+ After each iteration of the ECS update-cycle, the GameClient checks if it has joined a game or not.
+
+ User navigates through the multiplayer-menu to the "Choose map"-menu and chooses a map.
+
+ After choosing a map, the server is started on a separate thread. Depending on if the game is a singleplayer or a multiplayer-game, the Server and Client get either a LocalDAO or a FirebaseDAO, respectively.
+
+ The server continuously polls to check if there is a pending player waiting to join the game.
+
+ A client notifies the server that it wants to join the game. This happens in the "Join Game"-menu by pressing an available game. It then waits a short period before checking for a response from the server.
+
+ The server handles the join request and puts the player hosting the game into the game itself, i.e. the InGame-state. This also happens to the joining player.
+
+ The server then initializes the game itself by creating entities and adding them to the ECS-system, and updating all clients.
+
+ During each update-cycle in the Server while In-game, the following things happen: The ECS-systems are updated, progressing the game. It then checks if the game has ended or not. Then, it looks for pending actions received from players, and handles them if they are valid, like placing a card on an available tile if the player has enough money to buy it. At the end of each update-cycle the new updated GameState is applied and sent to all clients.
+
+ Repeat main update-cycle until the game is over, or the host terminates the application or loses connection.
+
+ Clients continuously pull updates to the GameState from the server and updates their local ECS-systems.
+
+ Clients send request for doing actions to the server.
+
+ The game ends in one of the two following ways: Case 1. The server abruptly loses connection. If a client does not receive new updates from the server within 10 seconds, it exits to the "lost connection"-screen. Case 2: The game ends with the players losing all their health, and the "Game Over"-screen is displayed. The server does a teardown-procedure which include updating the global highscore, and removes the game from the list of pollable games.
+
+
## Contributors
diff --git a/docs/diagrams/networking/heatbeat.puml b/docs/diagrams/networking/heatbeat.puml
new file mode 100644
index 0000000..389da1a
--- /dev/null
+++ b/docs/diagrams/networking/heatbeat.puml
@@ -0,0 +1,9 @@
+@startuml
+participant "Client" as C
+participant "Server" as S
+
+loop Every client update
+ C -> S: Heartbeat signal
+ S -> C: Heartbeat acknowledgment
+end loop
+@enduml
\ No newline at end of file
diff --git a/docs/diagrams/softwarearchitecturefull1of2.png b/docs/diagrams/softwarearchitecturefull1of2.png
new file mode 100644
index 0000000..1332444
Binary files /dev/null and b/docs/diagrams/softwarearchitecturefull1of2.png differ
diff --git a/docs/diagrams/softwarearchitecturefull2of2.png b/docs/diagrams/softwarearchitecturefull2of2.png
new file mode 100644
index 0000000..d1435d0
Binary files /dev/null and b/docs/diagrams/softwarearchitecturefull2of2.png differ
diff --git a/docs/diagrams/softwarearchitecturefull2of2.xcf b/docs/diagrams/softwarearchitecturefull2of2.xcf
new file mode 100644
index 0000000..b717cc3
Binary files /dev/null and b/docs/diagrams/softwarearchitecturefull2of2.xcf differ
diff --git a/docs/diagrams/state-diagram.puml b/docs/diagrams/state-diagram.puml
index b99227e..5bbbae3 100644
--- a/docs/diagrams/state-diagram.puml
+++ b/docs/diagrams/state-diagram.puml
@@ -1,30 +1,24 @@
@startuml
-[*] --> GameMenu : Starts game
-GameMenu --> SinglePlayer : Presses Single Player
-GameMenu --> Multiplayer : Presses Multiplayer
-GameMenu --> Options : Presses Options
-GameMenu --> Quit : Presses Quit
-
-Options --> GameMenu : Presses Back
-
-Multiplayer --> HostGame : Presses Host Game
-Multiplayer --> JoinGame : Presses Join Game
-
-HostGame : Has a unique id. Can be shared with another player.
-HostGame --> Lobby : Automatically creates lobby
-JoinGame --> Lobby : Joins a lobby after entering a unique id
-Lobby --> GameMenu : Leaves the lobby
-
-SinglePlayer --> Game : Automatically starts
-Lobby --> Game : Presses Start once the lobby is full
-
-Game --> Pause : Presses Pause
-Pause --> Game : Presses Resume
-Pause --> GameMenu : Presses Leave Game
-
-Game --> GameOver : Game ends, either a victory or defeat
-GameOver --> GameMenu : Automatically returns to the main menu
+[*] --> Menu : Starts the game
+Menu --> Options : Presses Options
+Menu --> Quit : Presses Quit
+Menu --> Multiplayer : Presses Multiplayer
+Menu --> ChooseMap : Presses Play
+Menu --> Tutorial : Presses Tutorial
+Options --> Menu : Presses Go back
+Multiplayer --> Menu : Presses Go back
+ChooseMap --> Menu : Presses Go back
+Tutorial --> Menu : Presses Go back
+Multiplayer --> JoinLobby : Presses Join
+Multiplayer --> ChooseMap : Presses Host
+Multiplayer --> Highscores : Presses Highscore
+JoinLobby --> Multiplayer : Presses Go back
+JoinLobby --> InGame : Presses Join on a lobby
+ChooseMap --> InGame : Presses on one of the maps
+InGame --> GameOver : Game ends, the player(s) have no life left or the client has lost connection with the server
+GameOver --> Menu : Presses Go back
+Highscores --> Multiplayer : Presses Go back
Quit --> [*]