# 9kyo-hwang/consolegameproject architecture

> Architecture diagram of the GitHub repository 9kyo-hwang/consolegameproject, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-10). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/9kyo-hwang/consolegameproject
- Repository: https://github.com/9kyo-hwang/consolegameproject

## Overview

This repository is a Windows console-game framework and a collection of games built on it, with a multiplayer Z1 client/server extension. The typical path is a game executable starting its game object, which runs the CraftEngine loop to process input, update a level, check collisions, and render; sound is another engine capability. Z1 multiplayer adds a network client, shared packet formats, and a server-side simulation. The README documents product-level relationships; sampled source confirms the engine loop and key networking operations. Several game-specific call chains are unsampled and are therefore not expanded.

Main entry points: [`CraftEngine/Engine/Engine.cpp`](https://github.com/9kyo-hwang/consolegameproject/blob/main/CraftEngine/Engine/Engine.cpp) (Engine Loop), [`Z1Server/Server.cpp`](https://github.com/9kyo-hwang/consolegameproject/blob/main/Z1Server/Server.cpp) (Z1 Server), [`Z1/Game/Game.cpp`](https://github.com/9kyo-hwang/consolegameproject/blob/main/Z1/Game/Game.cpp) (Z1 Game), [`Z1/Network/NetworkClient.cpp`](https://github.com/9kyo-hwang/consolegameproject/blob/main/Z1/Network/NetworkClient.cpp) (Network Client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_engine["CraftEngine"]
  node_engine_loop["Engine Loop<br/>[Engine.cpp]"]
  node_level_runtime["Level Runtime<br/>[Level.cpp]"]
  node_actor_components["Actor Components<br/>[Actor.cpp]"]
  node_input["Input<br/>[Input.cpp]"]
  node_collision["Collision"]
  node_renderer["Console Renderer<br/>[Renderer.cpp]"]
  node_tilemap["Tilemaps<br/>[Tilemap.cpp]"]
  node_sound["Sound System<br/>[Sound.cpp]"]
end

subgraph group_games["Game Content"]
  node_shooting["Shooting Game<br/>[GameLevel.cpp]"]
  node_sokoban["Sokoban Game<br/>[GameLevel.cpp]"]
  node_z1_game["Z1 Game<br/>[Game.cpp]"]
  node_z1_levels["Z1 Levels<br/>[DungeonLevel.cpp]"]
  node_z1_world["Z1 World Maps<br/>[OverworldMap.cpp]"]
  node_z1_actors["Z1 Actors<br/>[Pawn.cpp]"]
end

subgraph group_client_net["Z1 Networking"]
  node_network_client["Network Client<br/>[NetworkClient.cpp]"]
  node_network_gameplay["Networked Gameplay"]
end

subgraph group_server["Server Runtime"]
  node_server["Z1 Server<br/>[Server.cpp]"]
  node_simulation["World Simulation"]
  node_session["Client Sessions<br/>[Session.cpp]"]
  node_completion_port["IOCP<br/>[CompletionPort.cpp]"]
end

subgraph group_shared["Network Foundation"]
  node_socket_lib["Socket Library<br/>[Socket.cpp]"]
  node_protocol["Shared Protocol<br/>[PacketCodec.h]"]
end

node_user(("Player"))

node_user -->|"plays"| node_shooting
node_user -->|"plays"| node_sokoban
node_user -->|"plays"| node_z1_game
node_shooting -->|"runs on"| node_engine_loop
node_sokoban -->|"runs on"| node_engine_loop
node_z1_game -->|"runs on"| node_engine_loop
node_z1_game -.->|"uses"| node_z1_levels
node_z1_levels -.->|"uses"| node_z1_world
node_z1_levels -.->|"uses"| node_z1_actors
node_engine_loop -->|"polls"| node_input
node_engine_loop -->|"ticks"| node_level_runtime
node_engine_loop -->|"dispatches"| node_collision
node_engine_loop -->|"draws via"| node_renderer
node_engine_loop -->|"plays audio"| node_sound
node_level_runtime -.->|"updates actors"| node_actor_components
node_z1_game -.->|"uses"| node_network_gameplay
node_network_gameplay -.->|"dispatches"| node_network_client
node_network_client -->|"sends and receives"| node_socket_lib
node_network_client -->|"encodes packets"| node_protocol
node_server -->|"accepts clients"| node_socket_lib
node_server -->|"parses packets"| node_protocol
node_server -->|"manages sessions"| node_session
node_server -->|"registers I/O"| node_completion_port
node_server -->|"ticks world"| node_simulation
node_server -->|"serves multiplayer"| node_network_client

click node_shooting "https://github.com/9kyo-hwang/consolegameproject/blob/main/ShootingGame/Level/GameLevel.cpp"
click node_sokoban "https://github.com/9kyo-hwang/consolegameproject/blob/main/SokobanGame/Level/GameLevel.cpp"
click node_z1_game "https://github.com/9kyo-hwang/consolegameproject/blob/main/Z1/Game/Game.cpp"
click node_z1_levels "https://github.com/9kyo-hwang/consolegameproject/blob/main/Z1/Level/DungeonLevel.cpp"
click node_z1_world "https://github.com/9kyo-hwang/consolegameproject/blob/main/Z1/World/OverworldMap.cpp"
click node_z1_actors "https://github.com/9kyo-hwang/consolegameproject/blob/main/Z1/Actor/Pawn.cpp"
click node_engine_loop "https://github.com/9kyo-hwang/consolegameproject/blob/main/CraftEngine/Engine/Engine.cpp"
click node_level_runtime "https://github.com/9kyo-hwang/consolegameproject/blob/main/CraftEngine/Level/Level.cpp"
click node_actor_components "https://github.com/9kyo-hwang/consolegameproject/blob/main/CraftEngine/Actor/Actor.cpp"
click node_input "https://github.com/9kyo-hwang/consolegameproject/blob/main/CraftEngine/Core/Input.cpp"
click node_collision "https://github.com/9kyo-hwang/consolegameproject/blob/main/CraftEngine/Physics/CollisionSystem.cpp"
click node_renderer "https://github.com/9kyo-hwang/consolegameproject/blob/main/CraftEngine/Render/Renderer.cpp"
click node_tilemap "https://github.com/9kyo-hwang/consolegameproject/blob/main/CraftEngine/Tilemaps/Tilemap.cpp"
click node_sound "https://github.com/9kyo-hwang/consolegameproject/blob/main/SoundSystem/SoundSystem/Sound.cpp"
click node_network_client "https://github.com/9kyo-hwang/consolegameproject/blob/main/Z1/Network/NetworkClient.cpp"
click node_network_gameplay "https://github.com/9kyo-hwang/consolegameproject/blob/main/Z1/Network/NetworkOverworldLevel.cpp"
click node_socket_lib "https://github.com/9kyo-hwang/consolegameproject/blob/main/Sockets/Sockets/Socket.cpp"
click node_protocol "https://github.com/9kyo-hwang/consolegameproject/blob/main/Z1Shared/PacketCodec.h"
click node_server "https://github.com/9kyo-hwang/consolegameproject/blob/main/Z1Server/Server.cpp"
click node_simulation "https://github.com/9kyo-hwang/consolegameproject/blob/main/Z1Server/OverworldSimulation.cpp"
click node_session "https://github.com/9kyo-hwang/consolegameproject/blob/main/Z1Server/Session.cpp"
click node_completion_port "https://github.com/9kyo-hwang/consolegameproject/blob/main/Z1Server/CompletionPort.cpp"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_engine_loop,node_level_runtime,node_actor_components,node_input,node_collision,node_renderer,node_tilemap,node_sound toneBlue
class node_shooting,node_sokoban,node_z1_game,node_z1_levels,node_z1_world,node_z1_actors toneAmber
class node_network_client,node_network_gameplay toneMint
class node_server,node_simulation,node_session,node_completion_port toneRose
class node_socket_lib,node_protocol,node_user toneIndigo
```

## Components

### CraftEngine

- [Engine Loop](https://github.com/9kyo-hwang/consolegameproject/blob/main/CraftEngine/Engine/Engine.cpp): `CraftEngine/Engine/Engine.cpp`
- [Level Runtime](https://github.com/9kyo-hwang/consolegameproject/blob/main/CraftEngine/Level/Level.cpp): `CraftEngine/Level/Level.cpp`
- [Actor Components](https://github.com/9kyo-hwang/consolegameproject/blob/main/CraftEngine/Actor/Actor.cpp): `CraftEngine/Actor/Actor.cpp`
- [Input](https://github.com/9kyo-hwang/consolegameproject/blob/main/CraftEngine/Core/Input.cpp): `CraftEngine/Core/Input.cpp`
- [Collision](https://github.com/9kyo-hwang/consolegameproject/blob/main/CraftEngine/Physics/CollisionSystem.cpp): `CraftEngine/Physics/CollisionSystem.cpp`
- [Console Renderer](https://github.com/9kyo-hwang/consolegameproject/blob/main/CraftEngine/Render/Renderer.cpp): `CraftEngine/Render/Renderer.cpp`
- [Tilemaps](https://github.com/9kyo-hwang/consolegameproject/blob/main/CraftEngine/Tilemaps/Tilemap.cpp): `CraftEngine/Tilemaps/Tilemap.cpp`
- [Sound System](https://github.com/9kyo-hwang/consolegameproject/blob/main/SoundSystem/SoundSystem/Sound.cpp): `SoundSystem/SoundSystem/Sound.cpp`

### Game Content

- [Shooting Game](https://github.com/9kyo-hwang/consolegameproject/blob/main/ShootingGame/Level/GameLevel.cpp): `ShootingGame/Level/GameLevel.cpp`
- [Sokoban Game](https://github.com/9kyo-hwang/consolegameproject/blob/main/SokobanGame/Level/GameLevel.cpp): `SokobanGame/Level/GameLevel.cpp`
- [Z1 Game](https://github.com/9kyo-hwang/consolegameproject/blob/main/Z1/Game/Game.cpp): `Z1/Game/Game.cpp`
- [Z1 Levels](https://github.com/9kyo-hwang/consolegameproject/blob/main/Z1/Level/DungeonLevel.cpp): `Z1/Level/DungeonLevel.cpp`
- [Z1 World Maps](https://github.com/9kyo-hwang/consolegameproject/blob/main/Z1/World/OverworldMap.cpp): `Z1/World/OverworldMap.cpp`
- [Z1 Actors](https://github.com/9kyo-hwang/consolegameproject/blob/main/Z1/Actor/Pawn.cpp): `Z1/Actor/Pawn.cpp`

### Z1 Networking

- [Network Client](https://github.com/9kyo-hwang/consolegameproject/blob/main/Z1/Network/NetworkClient.cpp): `Z1/Network/NetworkClient.cpp`
- [Networked Gameplay](https://github.com/9kyo-hwang/consolegameproject/blob/main/Z1/Network/NetworkOverworldLevel.cpp): `Z1/Network/NetworkOverworldLevel.cpp`

### Server Runtime

- [Z1 Server](https://github.com/9kyo-hwang/consolegameproject/blob/main/Z1Server/Server.cpp): `Z1Server/Server.cpp`
- [World Simulation](https://github.com/9kyo-hwang/consolegameproject/blob/main/Z1Server/OverworldSimulation.cpp): `Z1Server/OverworldSimulation.cpp`
- [Client Sessions](https://github.com/9kyo-hwang/consolegameproject/blob/main/Z1Server/Session.cpp): `Z1Server/Session.cpp`
- [IOCP](https://github.com/9kyo-hwang/consolegameproject/blob/main/Z1Server/CompletionPort.cpp): `Z1Server/CompletionPort.cpp`

### Network Foundation

- [Socket Library](https://github.com/9kyo-hwang/consolegameproject/blob/main/Sockets/Sockets/Socket.cpp): `Sockets/Sockets/Socket.cpp`
- [Shared Protocol](https://github.com/9kyo-hwang/consolegameproject/blob/main/Z1Shared/PacketCodec.h): `Z1Shared/PacketCodec.h`

### Other components

- **Player**

## Connections

- Player → Shooting Game: plays (evidence: `README.md`)
- Player → Sokoban Game: plays (evidence: `README.md`)
- Player → Z1 Game: plays (evidence: `README.md`)
- Shooting Game → Engine Loop: runs on (evidence: `README.md`)
- Sokoban Game → Engine Loop: runs on (evidence: `README.md`)
- Z1 Game → Engine Loop: runs on (evidence: `README.md`)
- Z1 Game → Z1 Levels: uses
- Z1 Levels → Z1 World Maps: uses
- Z1 Levels → Z1 Actors: uses
- Engine Loop → Input: polls (evidence: `CraftEngine/Engine/Engine.cpp`)
- Engine Loop → Level Runtime: ticks (evidence: `CraftEngine/Engine/Engine.cpp`)
- Engine Loop → Collision: dispatches (evidence: `CraftEngine/Engine/Engine.cpp`)
- Engine Loop → Console Renderer: draws via (evidence: `CraftEngine/Engine/Engine.cpp`)
- Engine Loop → Sound System: plays audio (evidence: `CraftEngine/Engine/Engine.cpp`)
- Level Runtime → Actor Components: updates actors
- Z1 Game → Networked Gameplay: uses
- Networked Gameplay → Network Client: dispatches
- Network Client → Socket Library: sends and receives (evidence: `Z1/Network/NetworkClient.cpp`)
- Network Client → Shared Protocol: encodes packets (evidence: `Z1/Network/NetworkClient.cpp`)
- Z1 Server → Socket Library: accepts clients (evidence: `Z1Server/Server.cpp`)
- Z1 Server → Shared Protocol: parses packets (evidence: `Z1Server/Server.cpp`)
- Z1 Server → Client Sessions: manages sessions (evidence: `Z1Server/Server.cpp`)
- Z1 Server → IOCP: registers I/O (evidence: `Z1Server/Server.cpp`)
- Z1 Server → World Simulation: ticks world (evidence: `Z1Server/Server.cpp`)
- Z1 Server → Network Client: serves multiplayer (evidence: `README.md`)
