Behind the scenes, different parts of the game are controlled by a few main scripts. Each of these scripts, named "Managers", are in charge over one part/mechanic of the game.
The Managers in the game are:
GamePlayManager
- overall in charge of everything, runs the gameplay loopProposerManager
- in charge of updating the proposer UI and loading different ProposerBehaviourDocumentManager
- in charge of the documents the players interact withConvoUIManager
- in charge of showing in-game conversationsNewsManager
- in charge of loading and showing NewsItemsMenuManager
- in charge of showing/hiding in-game menusCutSceneManager
- in charge of loading and displaying cutscenesOverlayManager
- in charge of showing overlays
Interactions between Managers
In order for the game to work, the different managers need to communicate. Although technically any script can call on any manager to execute some code, it is good practice to keep interactions between managers confined to a minimum to decrease coupling.
The Cross Functional Flowchart below shows the interactions between the different Managers.
In the main gameplay loop:
Gameplay manager gets next Proposal
Gameplay manager sends the proposal to Document manager and Proposer manager to load
- Proposer manager loads the right sprite into the proposer UI and loads the right proposer behaviour
- Document manager loads all relevant information to the documents
Proposer manager triggers the animation, and on completion, triggers Document manager to show documents
Proposer behaviour acts accordingly, triggering ConvoUI manager for Conversations
When documents are all returned, Game manager triggers the proposer manager to start the npc evaluation.
Proposer behaviour decides when evaluation is finished and triggers proposer manager to start the leaving animation.
When the animation is complete, proposer manager triggers an event to signal the Gameplay manager.
Game manager passes the processed proposal to the Gamestate to apply its effects.
If any news is generated, game manager triggers an event for the news manager to prepare the news paper.
Game manager gets next proposal and loop continues.