# callofcreator/newmod architecture

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

- Interactive diagram: https://gitdiagram.com/callofcreator/newmod
- Repository: https://github.com/callofcreator/newmod

## Overview

1. **Project shape and runtime**
   - `NewMod` is a single C# class library (`NewMod.csproj` in `NewMod.sln`) that is loaded into Among Us as a mod.
   - The repo is organized around game-client extension points rather than a standalone app: most code either patches game methods, defines role logic, or adds UI/gameplay artifacts.
   - The presence of `newmod-win.bundle` and `newmod-android.bundle` indicates platform-specific asset packaging for Windows and Android support.

2. **Mod entry and global coordination**
   - `NewMod.cs` is the likely root bootstrap for the mod.
   - Shared cross-cutting services live in files like `NewModEventHandler.cs`, `PendingEffectManager.cs`, `DiscordStatus.cs`, `ModCompatibility.cs`, and `DebugWindow.cs`.
   - These pieces coordinate lifecycle, status reporting, deferred effects, compatibility checks, and developer-facing diagnostics.

3. **Role system is the main gameplay subsystem**
   - The repo is built around custom roles grouped by faction: `CrewmateRoles`, `ImpostorRoles`, and `NeutralRoles`.
   - Each role has a dedicated class under `NewMod/Roles`, with companion configuration in `NewMod/Options/Roles`.
   - `INewModRole.cs` suggests a common interface or contract that role implementations follow, making roles a pluggable domain layer.

4. **Ability/action layer is separated from role definitions**
   - Under `NewMod/Buttons`, each role’s active abilities are implemented as button/action classes such as `AegisButton`, `DrainButton`, `StrikeButton`, `ReviveButton`, `FeignDeathButton`, and `CaptureButton`.
   - This separation implies roles describe identity and rules, while buttons encapsulate in-game interaction, cooldowns, and triggers.
   - Several roles have multi-step abilities, e.g. `OverloadButton` plus `FinalButton`, or `Revenant` with both feign and awakening actions.

5. **UI and world-space gameplay components**
   - `NewMod/Components` contains reusable in-game objects that appear in the world or UI layer: zones, traps, domes, shields, trays, NPCs, and toast notifications.
   - Examples include `ShadowZone`, `ShieldArea`, `SupressionDomeArea`, `WitnessTrapArea`, and `WraithCallerNpc`.
   - These components act as interaction surfaces and visual feedback for role mechanics, rather than being tied to one specific role class.

6. **Patch layer hooks into Among Us behavior**
   - `NewMod/Patches` is the integration boundary with the base game.
   - Patches are organized by game area: chat, clipboard, main menu, quitting, stats popup, end game, role display, meeting HUD, cosmetics, and specific role behaviors.
   - This is the core adapter layer that modifies vanilla Among Us flow to support custom roles, UI changes, and new game states.

7. **Networking and RPC are used for synchronized effects**
   - `NewMod/Networking/BeaconPulseRpc.cs` and `CustomRPC.cs` indicate explicit network messages for mod-specific state changes.
   - The architecture likely uses RPCs to replicate role actions, map pulses, and other transient effects across clients.
   - This is an important boundary: local player input in buttons/components is translated into networked events so other players see the same outcome.

8. **Modifiers add orthogonal status effects**
   - `NewMod/Modifiers` defines temporary or persistent gameplay states such as `Adrenaline`, `Drowsy`, `Explosive`, `FalseForm`, and `Sticky`.
   - These appear to be independent from roles, meaning they can layer onto players regardless of faction.
   - `NewMod/Options/Modifiers` mirrors that subsystem with tunable settings, so modifiers are configurable gameplay primitives rather than hardcoded one-offs.

9. **Custom game mode support**
   - `NewMod/CustomGameModes/RevivalRoyale.cs` suggests at least one alternate game mode beyond role additions.
   - Game modes are likely top-level rule-set changes that alter how roles, death, revival, or win conditions work.
   - Related types like `NewModEndReasons.cs`, `NewModFaction.cs`, and `MissionType.cs` support higher-level match state and outcome classification.

10. **Configuration is split by feature area**
    - `NewMod/Options` is a large settings subsystem, with general options, compatibility toggles, NPC options, role options, and modifier options.
    - This makes the mod highly data-driven: most gameplay features can be tuned without changing core logic.
    - `LocalSettings/NewModLocalSettings.cs` indicates some settings are client-specific rather than host/game-wide.

11. **Compatibility is an explicit concern**
    - `ModCompatibility.cs` and `Options/CompatibilityOptions.cs` show the mod checks for and adapts to other mods.
    - The README lists support for several external mods, so interoperability is part of the architecture rather than an afterthought.
    - `Patches/Compatibility` contains targeted patches for startup/game launch integration with specific mod loaders or frameworks.

12. **Assets are bundled with feature-specific resources**
    - `Resources` contains role icons, notification icons, sounds, and platform bundles.
    - The sound assets map directly to role actions and effects, reinforcing that the visual/audio layer is tightly coupled to gameplay feedback.
    - `NewModAsset.cs` likely centralizes asset lookup or registration for these packaged resources.

13. **Specialized screen effects and presentation**
    - `Components/ScreenEffects` contains visual overlays such as glitch, distortion, earthquake, shadow flux, and pulse hue effects.
    - These effects are probably triggered by roles, modifiers, or game events to provide immediate sensory feedback.
    - Together with toast components and debug UI, the mod includes a strong presentation layer on top of raw role logic.

14. **Build and release tooling**
    - The repo includes GitHub Actions CI (`.github/workflows/ci.yml`) and `nuget.config`, so build/release is automated and package restore is customized.
    - The repository is packaged for public distribution, with documented release artifacts and versioned downloads in the README.
    - From an architecture perspective, this means the mod is treated as a distributable binary with reproducible builds rather than a hand-built local patch.

15. **High-level data flow**
    - Player input starts in role buttons or patched UI.
    - Button logic validates conditions, updates local state, and emits RPCs when the effect must be synchronized.
    - Patches and components translate those state changes into game behavior, visuals, and sounds.
    - Options and compatibility layers gate which roles/effects are active, while event handlers and pending-effect management coordinate timing across the match.

Main entry points: [`NewMod/Buttons/RevivedKillButton.cs`](https://github.com/callofcreator/newmod/blob/main/NewMod/Buttons/RevivedKillButton.cs) (Action buttons), [`NewMod/Patches/RolePatch.cs`](https://github.com/callofcreator/newmod/blob/main/NewMod/Patches/RolePatch.cs) (Patches), [`NewMod/Components/Toast.cs`](https://github.com/callofcreator/newmod/blob/main/NewMod/Components/Toast.cs) (Components), [`NewMod/NewModEventHandler.cs`](https://github.com/callofcreator/newmod/blob/main/NewMod/NewModEventHandler.cs) (Event handler)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_core["Core mod"]
  node_newmod_cs["Mod entry<br/>bootstrap<br/>[NewMod.cs]"]
  node_event_handler["Event handler<br/>lifecycle"]
  node_pending_effects["Pending effects<br/>timing"]
  node_discord_status["Discord status<br/>presence<br/>[DiscordStatus.cs]"]
  node_general_options["General options<br/>config<br/>[GeneralOption.cs]"]
end

subgraph group_roles["Roles"]
  node_role_options["Role options<br/>config<br/>[AegisOptions.cs]"]
  node_faction_roles["Faction roles<br/>role families<br/>[INewModRole.cs]"]
  node_crewmate_roles["Crewmate<br/>role family<br/>[Aegis.cs]"]
  node_impostor_roles["Impostor<br/>role family<br/>[Edgeveil.cs]"]
  node_neutral_roles["Neutral<br/>role family<br/>[Egoist.cs]"]
end

subgraph group_gameplay["Gameplay systems"]
  node_buttons["Action buttons<br/>actions"]
  node_components["Components<br/>world-ui<br/>[Toast.cs]"]
  node_modifiers["Modifiers<br/>status effects<br/>[StickyModifier.cs]"]
  node_game_modes["Game modes<br/>ruleset<br/>[RevivalRoyale.cs]"]
  node_modifier_options["Modifier options<br/>config"]
end

subgraph group_integration["Game integration"]
  node_compatibility["Compat layer<br/>interop"]
  node_rpc["RPCs<br/>networking<br/>[CustomRPC.cs]"]
  node_beacon_rpc["Beacon RPC<br/>[BeaconPulseRpc.cs]"]
  node_patches["Patches<br/>adapter<br/>[RolePatch.cs]"]
  node_chat_patch["Chat patch<br/>[ChatPatch.cs]"]
  node_role_patch["Role patch<br/>[RolePatch.cs]"]
  node_meeting_patch["Meeting HUD<br/>patch<br/>[MeetingHudPatch.cs]"]
end

subgraph group_assets["Assets"]
  node_assets["Assets<br/>resources<br/>[newmod-win.bundle]"]
end

node_newmod_cs -->|"initializes"| node_event_handler
node_newmod_cs -->|"checks"| node_compatibility
node_newmod_cs -->|"loads"| node_general_options
node_event_handler -->|"queues"| node_pending_effects
node_event_handler -->|"updates"| node_discord_status
node_patches -->|"enables"| node_buttons
node_patches -->|"renders"| node_components
node_patches -->|"contains"| node_role_patch
node_patches -->|"contains"| node_meeting_patch
node_patches -->|"contains"| node_chat_patch
node_faction_roles -->|"groups"| node_crewmate_roles
node_faction_roles -->|"groups"| node_impostor_roles
node_faction_roles -->|"groups"| node_neutral_roles
node_crewmate_roles -->|"configured by"| node_role_options
node_impostor_roles -->|"configured by"| node_role_options
node_neutral_roles -->|"configured by"| node_role_options
node_crewmate_roles -->|"uses"| node_buttons
node_impostor_roles -->|"uses"| node_buttons
node_neutral_roles -->|"uses"| node_buttons
node_buttons -->|"syncs"| node_rpc
node_buttons -->|"syncs"| node_beacon_rpc
node_buttons -->|"spawns"| node_components
node_components -->|"uses"| node_assets
node_modifiers -->|"configured by"| node_modifier_options
node_modifiers -->|"manifest as"| node_components
node_game_modes -->|"orchestrates"| node_event_handler
node_compatibility -->|"selects"| node_patches
node_assets -->|"drives"| node_components

click node_newmod_cs "https://github.com/callofcreator/newmod/blob/main/NewMod/NewMod.cs"
click node_event_handler "https://github.com/callofcreator/newmod/blob/main/NewMod/NewModEventHandler.cs"
click node_pending_effects "https://github.com/callofcreator/newmod/blob/main/NewMod/PendingEffectManager.cs"
click node_discord_status "https://github.com/callofcreator/newmod/blob/main/NewMod/DiscordStatus.cs"
click node_compatibility "https://github.com/callofcreator/newmod/blob/main/NewMod/ModCompatibility.cs"
click node_rpc "https://github.com/callofcreator/newmod/blob/main/NewMod/CustomRPC.cs"
click node_beacon_rpc "https://github.com/callofcreator/newmod/blob/main/NewMod/Networking/BeaconPulseRpc.cs"
click node_patches "https://github.com/callofcreator/newmod/blob/main/NewMod/Patches/RolePatch.cs"
click node_chat_patch "https://github.com/callofcreator/newmod/blob/main/NewMod/Patches/ChatPatch.cs"
click node_role_patch "https://github.com/callofcreator/newmod/blob/main/NewMod/Patches/RolePatch.cs"
click node_meeting_patch "https://github.com/callofcreator/newmod/blob/main/NewMod/Patches/Roles/MeetingHudPatch.cs"
click node_buttons "https://github.com/callofcreator/newmod/blob/main/NewMod/Buttons/RevivedKillButton.cs"
click node_components "https://github.com/callofcreator/newmod/blob/main/NewMod/Components/Toast.cs"
click node_modifiers "https://github.com/callofcreator/newmod/blob/main/NewMod/Modifiers/StickyModifier.cs"
click node_game_modes "https://github.com/callofcreator/newmod/blob/main/NewMod/CustomGameModes/RevivalRoyale.cs"
click node_general_options "https://github.com/callofcreator/newmod/blob/main/NewMod/Options/GeneralOption.cs"
click node_role_options "https://github.com/callofcreator/newmod/blob/main/NewMod/Options/Roles/AegisOptions.cs"
click node_modifier_options "https://github.com/callofcreator/newmod/blob/main/NewMod/Options/ModifiersOptions.cs"
click node_faction_roles "https://github.com/callofcreator/newmod/blob/main/NewMod/Roles/INewModRole.cs"
click node_crewmate_roles "https://github.com/callofcreator/newmod/blob/main/NewMod/Roles/CrewmateRoles/Aegis.cs"
click node_impostor_roles "https://github.com/callofcreator/newmod/blob/main/NewMod/Roles/ImpostorRoles/Edgeveil.cs"
click node_neutral_roles "https://github.com/callofcreator/newmod/blob/main/NewMod/Roles/NeutralRoles/Egoist.cs"
click node_assets "https://github.com/callofcreator/newmod/blob/main/NewMod/Resources/newmod-win.bundle"

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_newmod_cs,node_event_handler,node_pending_effects,node_discord_status,node_general_options toneBlue
class node_role_options,node_faction_roles,node_crewmate_roles,node_impostor_roles,node_neutral_roles toneAmber
class node_buttons,node_components,node_modifiers,node_game_modes,node_modifier_options toneMint
class node_compatibility,node_rpc,node_beacon_rpc,node_patches,node_chat_patch,node_role_patch,node_meeting_patch toneRose
class node_assets toneIndigo
```

## Components

### Core mod

Entry point and cross-cutting coordination for the mod runtime.

- [Mod entry](https://github.com/callofcreator/newmod/blob/main/NewMod/NewMod.cs): bootstrap · Root mod initializer and startup coordination. · `NewMod/NewMod.cs`
- [Event handler](https://github.com/callofcreator/newmod/blob/main/NewMod/NewModEventHandler.cs): lifecycle · Central event wiring and match lifecycle reactions. · `NewMod/NewModEventHandler.cs`
- [Pending effects](https://github.com/callofcreator/newmod/blob/main/NewMod/PendingEffectManager.cs): timing · Queues and resolves delayed gameplay effects. · `NewMod/PendingEffectManager.cs`
- [Discord status](https://github.com/callofcreator/newmod/blob/main/NewMod/DiscordStatus.cs): presence · Updates external presence or status reporting. · `NewMod/DiscordStatus.cs`
- [General options](https://github.com/callofcreator/newmod/blob/main/NewMod/Options/GeneralOption.cs): config · Shared gameplay and feature configuration. · `NewMod/Options/GeneralOption.cs`

### Roles

Faction-based role definitions and their configuration.

- [Role options](https://github.com/callofcreator/newmod/blob/main/NewMod/Options/Roles/AegisOptions.cs): config · Per-role tunables and activation settings. · `NewMod/Options/Roles/AegisOptions.cs`
- [Faction roles](https://github.com/callofcreator/newmod/blob/main/NewMod/Roles/INewModRole.cs): role families · Crewmate, impostor, and neutral role implementations. · `NewMod/Roles/INewModRole.cs`
- [Crewmate](https://github.com/callofcreator/newmod/blob/main/NewMod/Roles/CrewmateRoles/Aegis.cs): role family · Crewmate-aligned custom roles. · `NewMod/Roles/CrewmateRoles/Aegis.cs`
- [Impostor](https://github.com/callofcreator/newmod/blob/main/NewMod/Roles/ImpostorRoles/Edgeveil.cs): role family · Impostor-aligned custom roles. · `NewMod/Roles/ImpostorRoles/Edgeveil.cs`
- [Neutral](https://github.com/callofcreator/newmod/blob/main/NewMod/Roles/NeutralRoles/Egoist.cs): role family · Neutral-aligned custom roles. · `NewMod/Roles/NeutralRoles/Egoist.cs`

### Gameplay systems

Buttons, components, modifiers, and custom game modes that implement behavior.

- [Action buttons](https://github.com/callofcreator/newmod/blob/main/NewMod/Buttons/RevivedKillButton.cs): actions · Player-triggered abilities and multi-step role actions. · `NewMod/Buttons/RevivedKillButton.cs`
- [Components](https://github.com/callofcreator/newmod/blob/main/NewMod/Components/Toast.cs): world-ui · Reusable world-space objects, UI feedback, and screen effects. · `NewMod/Components/Toast.cs`
- [Modifiers](https://github.com/callofcreator/newmod/blob/main/NewMod/Modifiers/StickyModifier.cs): status effects · Orthogonal gameplay states that can layer onto players. · `NewMod/Modifiers/StickyModifier.cs`
- [Game modes](https://github.com/callofcreator/newmod/blob/main/NewMod/CustomGameModes/RevivalRoyale.cs): ruleset · Alternate match rule sets and outcome classification. · `NewMod/CustomGameModes/RevivalRoyale.cs`
- [Modifier options](https://github.com/callofcreator/newmod/blob/main/NewMod/Options/ModifiersOptions.cs): config · Configuration for modifier behaviors and balance. · `NewMod/Options/ModifiersOptions.cs`

### Game integration

Patches, networking, and compatibility boundaries into Among Us.

- [Compat layer](https://github.com/callofcreator/newmod/blob/main/NewMod/ModCompatibility.cs): interop · Checks and adapts behavior for other mods or loaders. · `NewMod/ModCompatibility.cs`
- [RPCs](https://github.com/callofcreator/newmod/blob/main/NewMod/CustomRPC.cs): networking · Custom synchronized messages for mod-specific state. · `NewMod/CustomRPC.cs`
- [Beacon RPC](https://github.com/callofcreator/newmod/blob/main/NewMod/Networking/BeaconPulseRpc.cs): rpc · Network message for beacon or pulse-related effects. · `NewMod/Networking/BeaconPulseRpc.cs`
- [Patches](https://github.com/callofcreator/newmod/blob/main/NewMod/Patches/RolePatch.cs): adapter · Core Harmony-style integration layer for vanilla game behavior. · `NewMod/Patches/RolePatch.cs`
- [Chat patch](https://github.com/callofcreator/newmod/blob/main/NewMod/Patches/ChatPatch.cs): patch · Chat and messaging integration points. · `NewMod/Patches/ChatPatch.cs`
- [Role patch](https://github.com/callofcreator/newmod/blob/main/NewMod/Patches/RolePatch.cs): patch · Hooks that alter role display and role-driven flow. · `NewMod/Patches/RolePatch.cs`
- [Meeting HUD](https://github.com/callofcreator/newmod/blob/main/NewMod/Patches/Roles/MeetingHudPatch.cs): patch · Meeting and vote-time HUD changes. · `NewMod/Patches/Roles/MeetingHudPatch.cs`

### Assets

Packaged resources and platform-specific bundles.

- [Assets](https://github.com/callofcreator/newmod/blob/main/NewMod/Resources/newmod-win.bundle): resources · Icons, sounds, and platform bundles used by gameplay feedback. · `NewMod/Resources/newmod-win.bundle`

## Connections

- Mod entry → Event handler: initializes · Bootstraps lifecycle coordination.
- Mod entry → Compat layer: checks · Adapts startup behavior for other mods.
- Mod entry → General options: loads · Reads feature settings early.
- Event handler → Pending effects: queues · Defers and applies timed effects.
- Event handler → Discord status: updates · Keeps external presence in sync.
- Patches → Action buttons: enables · UI/game hooks expose role actions.
- Patches → Components: renders · Patches drive world and HUD feedback.
- Patches → Role patch: contains · Role-related integration hooks.
- Patches → Meeting HUD: contains · Meeting-time UI changes.
- Patches → Chat patch: contains · Chat and messaging hooks.
- Faction roles → Crewmate: groups · Crewmate role implementations.
- Faction roles → Impostor: groups · Impostor role implementations.
- Faction roles → Neutral: groups · Neutral role implementations.
- Crewmate → Role options: configured by · Each role has tunable settings.
- Impostor → Role options: configured by · Each role has tunable settings.
- Neutral → Role options: configured by · Each role has tunable settings.
- Crewmate → Action buttons: uses · Role abilities are exposed through buttons.
- Impostor → Action buttons: uses · Role abilities are exposed through buttons.
- Neutral → Action buttons: uses · Role abilities are exposed through buttons.
- Action buttons → RPCs: syncs · Action outcomes are replicated across clients.
- Action buttons → Beacon RPC: syncs · Beacon-related effects are networked.
- Action buttons → Components: spawns · Abilities create zones, NPCs, and effects.
- Components → Assets: uses · Visual/audio feedback relies on packaged resources.
- Modifiers → Modifier options: configured by · Modifier tuning lives in options.
- Modifiers → Components: manifest as · Statuses show up through effects and overlays.
- Game modes → Event handler: orchestrates · Alternate rules interact with lifecycle events.
- Compat layer → Patches: selects · Compatibility-specific hooks alter startup and gameplay behavior.
- Assets → Components: drives · Icons, sounds, and bundles support presentation.
