From 621a5ff67fa52da075ae12a922c59e4ed83363b6 Mon Sep 17 00:00:00 2001 From: ClarkeCode Date: Sun, 12 Mar 2023 04:02:15 -0400 Subject: Beginning of architecture file --- docs/general-program-architecture.md | 52 ++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 docs/general-program-architecture.md (limited to 'docs/general-program-architecture.md') 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
"Load Game" button +UI ->> Bridge: Begin new Game Session +Bridge ->> Simulation: Start new Game Session +Simulation -->> Dataloader: Load previous savegame
(If necessary) +Dataloader -->> Simulation: +Simulation ->> Bridge: Provide information necessary
for UI and visual elements +Bridge ->> UI: Signal that Game Session
is ready for interaction +UI ->> Player: Present to Player + +loop Core Game Loop +Player ->> UI: Interact with game controls +UI ->> Bridge: Convey player intent
according to UI
handler functions +Bridge ->> Simulation: Relay changes to entities
controlled by the Player +Note over Simulation: When unpaused: +Simulation ->> Simulation: Advance to next in-game day
according to game speed
and update Simulation state +Simulation ->> Bridge: Inform of relevant
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
in the Game Session Menu +UI ->> Bridge: Demand that the current
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"
message +UI ->> Player: Give visual confirmation
of successful save +end + +Player ->> UI: Press "Exit Game" button +UI ->> Player: Give a "Confirm quit (Y/N)"
dialog window +Player ->> UI: Confirm intent to quit program +UI ->> Player: Program closes +``` \ No newline at end of file -- cgit v1.2.3-56-ga3b1