diff options
author | ClarkeCode <33846391+ClarkeCode@users.noreply.github.com> | 2023-03-22 18:33:29 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-03-22 18:33:29 +0100 |
commit | 65dfeae1641d091d74d22372146a2a7cb4b19f8e (patch) | |
tree | e0f6060b4e72a1a0f7dad4c94ce12264bc139381 /docs/general-program-architecture.md | |
parent | eb87e2af53bd693e04739aaee84fde408e72f3a9 (diff) | |
parent | 000ede9303e071e69a7dace95117d593ebcb92aa (diff) |
Merge pull request #68 from OpenVic2Project/docs-architecture-and-schema
Docs architecture and schema
Diffstat (limited to 'docs/general-program-architecture.md')
-rw-r--r-- | docs/general-program-architecture.md | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/docs/general-program-architecture.md b/docs/general-program-architecture.md new file mode 100644 index 0000000..533a8fa --- /dev/null +++ b/docs/general-program-architecture.md @@ -0,0 +1,52 @@ +# Player-Game Interaction +```mermaid +sequenceDiagram +actor Player +participant UI as Godot +participant Bridge as Godot-CPP Bridge +participant Simulation +participant Dataloader +autonumber + +Player ->> UI: Program starts +UI ->> Bridge: Godot autoloaders fire +Bridge ->> Dataloader: Signal to load Simulation +Dataloader ->> Simulation: Read in data from file(s) +Simulation ->> Bridge: Simulation finished loading data +Bridge ->> UI: Autoloaders finish +UI ->> Player: Display Main Menu +Player ->> UI: Press "New Game" or<br>"Load Game" button +UI ->> Bridge: Begin new Game Session +Bridge ->> Simulation: Start new Game Session +Simulation -->> Dataloader: Load previous savegame<br>(If necessary) +Dataloader -->> Simulation: +Simulation ->> Bridge: Provide information necessary<br>for UI and visual elements +Bridge ->> UI: Signal that Game Session<br> is ready for interaction +UI ->> Player: Present to Player + +loop Core Game Loop +Player ->> UI: Interact with game controls +UI ->> Bridge: Convey player intent<br>according to UI<br>handler functions +Bridge ->> Simulation: Relay changes to entities<br>controlled by the Player +Note over Simulation: When unpaused: +Simulation ->> Simulation: Advance to next in-game day<br>according to game speed<br>and update Simulation state +Simulation ->> Bridge: Inform of relevant<br>changes to game state +Bridge ->> UI: Update UI and map +UI ->> Player: Display new data +end + +opt Save Game +Player ->> UI: Press "Save Game" button<br>in the Game Session Menu +UI ->> Bridge: Demand that the current<br>game state is saved +Bridge ->> Simulation: Begin save routines +Simulation ->> Dataloader: Write current state to disk +Simulation ->> Bridge: Save routines completed +Bridge ->> UI: Trigger "successful save"<br>message +UI ->> Player: Give visual confirmation<br>of successful save +end + +Player ->> UI: Press "Exit Game" button +UI ->> Player: Give a "Confirm quit (Y/N)"<br>dialog window +Player ->> UI: Confirm intent to quit program +UI ->> Player: Program closes +```
\ No newline at end of file |