# hyunjin0814/undercover-team4-project architecture

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

- Interactive diagram: https://gitdiagram.com/hyunjin0814/undercover-team4-project
- Repository: https://github.com/hyunjin0814/undercover-team4-project

## Overview

One-Star Precinct is a six-player cooperative first-person game. Players prepare in a lobby, identify wanted suspects in the field using observation and scanning (with HQ support from CCTV and radio), subdue and tow targets, then jail them for a round result. The README also documents dynamic events, items, NPC behaviors, localization, and shared ragdoll behavior. Relationships below rely on README statements; source excerpts were unavailable, so undocumented implementation links are omitted.

Main entry points: [`Assets/Scripts/Player`](https://github.com/hyunjin0814/undercover-team4-project/tree/main/Assets/Scripts/Player) (Subdue and tow), [`Assets/Scripts/HQ`](https://github.com/hyunjin0814/undercover-team4-project/tree/main/Assets/Scripts/HQ) (HQ surveillance), [`Assets/Scripts/NPC`](https://github.com/hyunjin0814/undercover-team4-project/tree/main/Assets/Scripts/NPC) (NPC behavior), [`Assets/Scripts/Core`](https://github.com/hyunjin0814/undercover-team4-project/tree/main/Assets/Scripts/Core) (App facade)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_roundplay["Round gameplay"]
  node_lobby["Lobby preparation"]
  node_round["Round flow"]
  node_wanted["Wanted briefing"]
  node_identification["Suspect identification"]
  node_settlement["Round settlement"]
  node_events["Random events"]
  node_items["Gameplay items"]
end

subgraph group_field["Field systems"]
  node_scanner["Attribute scanner"]
  node_npc["NPC behavior"]
  node_hq["HQ surveillance"]
  node_interaction["Subdue and tow"]
end

subgraph group_shared["Shared runtime"]
  node_ragdoll["Shared ragdoll"]
  node_localization[("Localization")]
  node_app["App facade"]
end

subgraph group_services["Online services"]
  node_network["Co-op networking"]
  node_gaming_services["Unity Gaming Services"]
end

node_players(("Co-op players"))
node_jail["Jail custody"]

node_players -->|"prepare in"| node_lobby
node_lobby -->|"select round"| node_round
node_round -->|"present target"| node_wanted
node_players -->|"observe suspects"| node_identification
node_players -->|"scan attributes"| node_scanner
node_npc -.->|"populate suspects"| node_identification
node_hq -->|"share surveillance"| node_players
node_players -->|"monitor and report"| node_hq
node_players -->|"subdue and tow"| node_interaction
node_interaction -->|"apply ragdoll"| node_ragdoll
node_interaction -->|"deliver target"| node_jail
node_jail -->|"count bounty"| node_settlement
node_round -->|"trigger surprises"| node_events
node_players -->|"use items"| node_items
node_network -->|"uses services"| node_gaming_services
node_players -->|"join co-op"| node_network
node_app -.->|"access shared runtime"| node_localization

click node_npc "https://github.com/hyunjin0814/undercover-team4-project/tree/main/Assets/Scripts/NPC"
click node_hq "https://github.com/hyunjin0814/undercover-team4-project/tree/main/Assets/Scripts/HQ"
click node_interaction "https://github.com/hyunjin0814/undercover-team4-project/tree/main/Assets/Scripts/Player"
click node_ragdoll "https://github.com/hyunjin0814/undercover-team4-project/tree/main/Assets/Scripts/Common/Ragdoll"
click node_app "https://github.com/hyunjin0814/undercover-team4-project/tree/main/Assets/Scripts/Core"

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_lobby,node_round,node_wanted,node_identification,node_settlement,node_events,node_items toneBlue
class node_scanner,node_npc,node_hq,node_interaction toneAmber
class node_ragdoll,node_localization,node_app toneMint
class node_network,node_gaming_services toneRose
class node_players,node_jail toneIndigo
```

## Components

### Round gameplay

- **Lobby preparation**
- **Round flow**
- **Wanted briefing**
- **Suspect identification**
- **Round settlement**
- **Random events**
- **Gameplay items**

### Field systems

- **Attribute scanner**
- [NPC behavior](https://github.com/hyunjin0814/undercover-team4-project/tree/main/Assets/Scripts/NPC): `Assets/Scripts/NPC`
- [HQ surveillance](https://github.com/hyunjin0814/undercover-team4-project/tree/main/Assets/Scripts/HQ): `Assets/Scripts/HQ`
- [Subdue and tow](https://github.com/hyunjin0814/undercover-team4-project/tree/main/Assets/Scripts/Player): `Assets/Scripts/Player`

### Shared runtime

- [Shared ragdoll](https://github.com/hyunjin0814/undercover-team4-project/tree/main/Assets/Scripts/Common/Ragdoll): `Assets/Scripts/Common/Ragdoll`
- **Localization**
- [App facade](https://github.com/hyunjin0814/undercover-team4-project/tree/main/Assets/Scripts/Core): `Assets/Scripts/Core`

### Online services

- **Co-op networking**
- **Unity Gaming Services**

### Other components

- **Co-op players**
- **Jail custody**

## Connections

- Co-op players → Lobby preparation: prepare in
- Lobby preparation → Round flow: select round
- Round flow → Wanted briefing: present target
- Co-op players → Suspect identification: observe suspects
- Co-op players → Attribute scanner: scan attributes
- NPC behavior → Suspect identification: populate suspects
- HQ surveillance → Co-op players: share surveillance
- Co-op players → HQ surveillance: monitor and report
- Co-op players → Subdue and tow: subdue and tow
- Subdue and tow → Shared ragdoll: apply ragdoll
- Subdue and tow → Jail custody: deliver target
- Jail custody → Round settlement: count bounty
- Round flow → Random events: trigger surprises
- Co-op players → Gameplay items: use items
- Co-op networking → Unity Gaming Services: uses services
- Co-op players → Co-op networking: join co-op
- App facade → Localization: access shared runtime
