# lifelandman/marinefpsdemo architecture

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

- Interactive diagram: https://gitdiagram.com/lifelandman/marinefpsdemo
- Repository: https://github.com/lifelandman/marinefpsdemo

## Overview

Marine FPS Demo is a Panda3D multiplayer FPS template. The principal workflow runs from the player’s menu into a host or client lobby, then starts a game world that loads a map and coordinates players, entities, HUD, audio, and game logic. Player movement and weapon behavior form a distinct gameplay branch; networking carries multiplayer messages between clients and the host. The README identifies the project as a template, but gives few behavioral details. Connections below are limited to sampled excerpts, SOURCE INDEX references, and explicit documentation.

Main entry points: [`code/game.py`](https://github.com/lifelandman/marinefpsdemo/blob/main/code/game.py) (Game world), [`code/lobby.py`](https://github.com/lifelandman/marinefpsdemo/blob/main/code/lobby.py) (Lobby UI), [`code/weapons/bulletBase.py`](https://github.com/lifelandman/marinefpsdemo/blob/main/code/weapons/bulletBase.py) (Bullet weapons), [`code/entities/playerEnts.py`](https://github.com/lifelandman/marinefpsdemo/blob/main/code/entities/playerEnts.py) (Player entities)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["Menus and lobby"]
  node_main["Application entry<br/>[main.py]"]
  node_menu["Main menu<br/>[main_menu.py]"]
  node_options["Options menu<br/>[option_menu.py]"]
  node_optionlists["Option definitions<br/>[option_lists.py]"]
  node_lobby["Lobby UI<br/>[lobby.py]"]
end

subgraph group_net["Multiplayer networking"]
  node_client["Client transport<br/>[client.py]"]
  node_host["Host transport<br/>[host.py]"]
  node_messages["Message protocol<br/>[commonMsg.py]"]
  node_tracking["Player tracking<br/>[netTracking.py]"]
end

subgraph group_gameplay["Game runtime"]
  node_game["Game world<br/>[game.py]"]
  node_world["World loading<br/>[worldLoader.py]"]
  node_logic["Game modes"]
  node_hud["HUD<br/>[hud.py]"]
  node_audio["3D audio"]
  node_audioassets["Sound registration<br/>[subAudio.py]"]
  node_rng["Random generation<br/>[rng.py]"]
end

subgraph group_entities["Entities and players"]
  node_playermgr["Player manager<br/>[playerMgr.py]"]
  node_entmgr["Entity manager<br/>[entMgr.py]"]
  node_entbase["Entity base<br/>[entBase.py]"]
  node_npent["Node entities<br/>[npEnt.py]"]
  node_entmodels["Entity models<br/>[entModels.py]"]
  node_funcs["World functions<br/>[funcs.py]"]
  node_playerents["Player entities<br/>[playerEnts.py]"]
  node_playermodel["Player model<br/>[playerModel.py]"]
  node_playernet["Networked players<br/>[playerNet.py]"]
end

subgraph group_weapons["Weapons and combat"]
  node_slots["Weapon slots<br/>[wpnSlots.py]"]
  node_weaponbase["Weapon base<br/>[wpnBase.py]"]
  node_ammo["Ammo and reload<br/>[wpnAmmo.py]"]
  node_trigger["Weapon timing<br/>[wpnTrgr.py]"]
  node_bullet["Bullet weapons<br/>[bulletBase.py]"]
  node_weaponset["Weapon set<br/>[as_wpns.py]"]
  node_damage["Damage types<br/>[damageTypes.py]"]
  node_decals["Impact decals<br/>[decalMgr.py]"]
end

node_player(("Player"))

node_player -->|"launches"| node_main
node_main -->|"opens"| node_menu
node_menu -->|"opens"| node_lobby
node_menu -->|"opens"| node_options
node_options -->|"loads options"| node_optionlists
node_lobby -->|"creates client"| node_client
node_lobby -->|"creates host"| node_host
node_lobby -->|"tracks players"| node_tracking
node_lobby -->|"starts game"| node_game
node_client -->|"uses protocol"| node_messages
node_host -->|"uses protocol"| node_messages
node_game -->|"loads map"| node_world
node_game -->|"initializes modes"| node_logic
node_game -->|"initializes HUD"| node_hud
node_game -->|"initializes audio"| node_audio
node_game -->|"creates manager"| node_playermgr
node_game -->|"creates manager"| node_entmgr
node_game -->|"creates manager"| node_rng
node_game -->|"creates manager"| node_decals
node_audio -->|"registers sounds"| node_audioassets
node_playermgr -->|"uses player classes"| node_playernet
node_entmgr -->|"uses functions"| node_funcs
node_entmodels -->|"uses node entities"| node_npent
node_entmodels -->|"uses functions"| node_funcs
node_npent -->|"extends"| node_entbase
node_funcs -->|"extends entities"| node_npent
node_playermodel -->|"uses models"| node_entmodels
node_playernet -->|"extends players"| node_playerents
node_playerents -->|"extends entities"| node_npent
node_playerents -->|"creates weapon manager"| node_slots
node_playerents -->|"uses weapons"| node_weaponset
node_bullet -->|"uses slot manager"| node_slots
node_bullet -->|"uses timing"| node_trigger
node_bullet -->|"uses ammo"| node_ammo
node_bullet -->|"calculates damage"| node_damage
node_ammo -->|"uses slot manager"| node_slots
node_ammo -->|"extends timing"| node_trigger
node_slots -->|"extends weapon base"| node_weaponbase
node_weaponset -->|"defines weapons"| node_bullet

click node_main "https://github.com/lifelandman/marinefpsdemo/blob/main/main.py"
click node_menu "https://github.com/lifelandman/marinefpsdemo/blob/main/code/main_menu.py"
click node_options "https://github.com/lifelandman/marinefpsdemo/blob/main/code/options/option_menu.py"
click node_optionlists "https://github.com/lifelandman/marinefpsdemo/blob/main/code/options/option_lists.py"
click node_lobby "https://github.com/lifelandman/marinefpsdemo/blob/main/code/lobby.py"
click node_client "https://github.com/lifelandman/marinefpsdemo/blob/main/code/servers/client.py"
click node_host "https://github.com/lifelandman/marinefpsdemo/blob/main/code/servers/host.py"
click node_messages "https://github.com/lifelandman/marinefpsdemo/blob/main/code/servers/commonMsg.py"
click node_tracking "https://github.com/lifelandman/marinefpsdemo/blob/main/code/netTracking.py"
click node_game "https://github.com/lifelandman/marinefpsdemo/blob/main/code/game.py"
click node_world "https://github.com/lifelandman/marinefpsdemo/blob/main/code/worldLoader.py"
click node_logic "https://github.com/lifelandman/marinefpsdemo/tree/main/code/logic"
click node_hud "https://github.com/lifelandman/marinefpsdemo/blob/main/code/hud.py"
click node_audio "https://github.com/lifelandman/marinefpsdemo/blob/main/code/audio/audioTriggerGlobal.py"
click node_audioassets "https://github.com/lifelandman/marinefpsdemo/blob/main/code/audio/subAudio.py"
click node_playermgr "https://github.com/lifelandman/marinefpsdemo/blob/main/code/playerMgr.py"
click node_entmgr "https://github.com/lifelandman/marinefpsdemo/blob/main/code/entities/entMgr.py"
click node_entbase "https://github.com/lifelandman/marinefpsdemo/blob/main/code/entities/entBase.py"
click node_npent "https://github.com/lifelandman/marinefpsdemo/blob/main/code/entities/npEnt.py"
click node_entmodels "https://github.com/lifelandman/marinefpsdemo/blob/main/code/entities/entModels.py"
click node_funcs "https://github.com/lifelandman/marinefpsdemo/blob/main/code/entities/funcs.py"
click node_playerents "https://github.com/lifelandman/marinefpsdemo/blob/main/code/entities/playerEnts.py"
click node_playermodel "https://github.com/lifelandman/marinefpsdemo/blob/main/code/entities/playerModel.py"
click node_playernet "https://github.com/lifelandman/marinefpsdemo/blob/main/code/entities/playerNet.py"
click node_slots "https://github.com/lifelandman/marinefpsdemo/blob/main/code/weapons/wpnSlots.py"
click node_weaponbase "https://github.com/lifelandman/marinefpsdemo/blob/main/code/weapons/wpnBase.py"
click node_ammo "https://github.com/lifelandman/marinefpsdemo/blob/main/code/weapons/wpnAmmo.py"
click node_trigger "https://github.com/lifelandman/marinefpsdemo/blob/main/code/weapons/wpnTrgr.py"
click node_bullet "https://github.com/lifelandman/marinefpsdemo/blob/main/code/weapons/bulletBase.py"
click node_weaponset "https://github.com/lifelandman/marinefpsdemo/blob/main/code/weapons/as_wpns.py"
click node_damage "https://github.com/lifelandman/marinefpsdemo/blob/main/code/weapons/damageTypes.py"
click node_decals "https://github.com/lifelandman/marinefpsdemo/blob/main/code/weapons/decalMgr.py"
click node_rng "https://github.com/lifelandman/marinefpsdemo/blob/main/code/rng.py"

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_main,node_menu,node_options,node_optionlists,node_lobby toneBlue
class node_client,node_host,node_messages,node_tracking toneAmber
class node_game,node_world,node_logic,node_hud,node_audio,node_audioassets,node_rng toneMint
class node_playermgr,node_entmgr,node_entbase,node_npent,node_entmodels,node_funcs,node_playerents,node_playermodel,node_playernet toneRose
class node_slots,node_weaponbase,node_ammo,node_trigger,node_bullet,node_weaponset,node_damage,node_decals,node_player toneIndigo
```

## Components

### Menus and lobby

- [Application entry](https://github.com/lifelandman/marinefpsdemo/blob/main/main.py): `main.py`
- [Main menu](https://github.com/lifelandman/marinefpsdemo/blob/main/code/main_menu.py): `code/main_menu.py`
- [Options menu](https://github.com/lifelandman/marinefpsdemo/blob/main/code/options/option_menu.py): `code/options/option_menu.py`
- [Option definitions](https://github.com/lifelandman/marinefpsdemo/blob/main/code/options/option_lists.py): `code/options/option_lists.py`
- [Lobby UI](https://github.com/lifelandman/marinefpsdemo/blob/main/code/lobby.py): `code/lobby.py`

### Multiplayer networking

- [Client transport](https://github.com/lifelandman/marinefpsdemo/blob/main/code/servers/client.py): `code/servers/client.py`
- [Host transport](https://github.com/lifelandman/marinefpsdemo/blob/main/code/servers/host.py): `code/servers/host.py`
- [Message protocol](https://github.com/lifelandman/marinefpsdemo/blob/main/code/servers/commonMsg.py): `code/servers/commonMsg.py`
- [Player tracking](https://github.com/lifelandman/marinefpsdemo/blob/main/code/netTracking.py): `code/netTracking.py`

### Game runtime

- [Game world](https://github.com/lifelandman/marinefpsdemo/blob/main/code/game.py): `code/game.py`
- [World loading](https://github.com/lifelandman/marinefpsdemo/blob/main/code/worldLoader.py): `code/worldLoader.py`
- [Game modes](https://github.com/lifelandman/marinefpsdemo/tree/main/code/logic): `code/logic`
- [HUD](https://github.com/lifelandman/marinefpsdemo/blob/main/code/hud.py): `code/hud.py`
- [3D audio](https://github.com/lifelandman/marinefpsdemo/blob/main/code/audio/audioTriggerGlobal.py): `code/audio/audioTriggerGlobal.py`
- [Sound registration](https://github.com/lifelandman/marinefpsdemo/blob/main/code/audio/subAudio.py): `code/audio/subAudio.py`
- [Random generation](https://github.com/lifelandman/marinefpsdemo/blob/main/code/rng.py): `code/rng.py`

### Entities and players

- [Player manager](https://github.com/lifelandman/marinefpsdemo/blob/main/code/playerMgr.py): `code/playerMgr.py`
- [Entity manager](https://github.com/lifelandman/marinefpsdemo/blob/main/code/entities/entMgr.py): `code/entities/entMgr.py`
- [Entity base](https://github.com/lifelandman/marinefpsdemo/blob/main/code/entities/entBase.py): `code/entities/entBase.py`
- [Node entities](https://github.com/lifelandman/marinefpsdemo/blob/main/code/entities/npEnt.py): `code/entities/npEnt.py`
- [Entity models](https://github.com/lifelandman/marinefpsdemo/blob/main/code/entities/entModels.py): `code/entities/entModels.py`
- [World functions](https://github.com/lifelandman/marinefpsdemo/blob/main/code/entities/funcs.py): `code/entities/funcs.py`
- [Player entities](https://github.com/lifelandman/marinefpsdemo/blob/main/code/entities/playerEnts.py): `code/entities/playerEnts.py`
- [Player model](https://github.com/lifelandman/marinefpsdemo/blob/main/code/entities/playerModel.py): `code/entities/playerModel.py`
- [Networked players](https://github.com/lifelandman/marinefpsdemo/blob/main/code/entities/playerNet.py): `code/entities/playerNet.py`

### Weapons and combat

- [Weapon slots](https://github.com/lifelandman/marinefpsdemo/blob/main/code/weapons/wpnSlots.py): `code/weapons/wpnSlots.py`
- [Weapon base](https://github.com/lifelandman/marinefpsdemo/blob/main/code/weapons/wpnBase.py): `code/weapons/wpnBase.py`
- [Ammo and reload](https://github.com/lifelandman/marinefpsdemo/blob/main/code/weapons/wpnAmmo.py): `code/weapons/wpnAmmo.py`
- [Weapon timing](https://github.com/lifelandman/marinefpsdemo/blob/main/code/weapons/wpnTrgr.py): `code/weapons/wpnTrgr.py`
- [Bullet weapons](https://github.com/lifelandman/marinefpsdemo/blob/main/code/weapons/bulletBase.py): `code/weapons/bulletBase.py`
- [Weapon set](https://github.com/lifelandman/marinefpsdemo/blob/main/code/weapons/as_wpns.py): `code/weapons/as_wpns.py`
- [Damage types](https://github.com/lifelandman/marinefpsdemo/blob/main/code/weapons/damageTypes.py): `code/weapons/damageTypes.py`
- [Impact decals](https://github.com/lifelandman/marinefpsdemo/blob/main/code/weapons/decalMgr.py): `code/weapons/decalMgr.py`

### Other components

- **Player**

## Connections

- Player → Application entry: launches (evidence: `main.py`)
- Application entry → Main menu: opens (evidence: `main.py`)
- Main menu → Lobby UI: opens (evidence: `code/main_menu.py`)
- Main menu → Options menu: opens (evidence: `code/main_menu.py`)
- Options menu → Option definitions: loads options (evidence: `code/options/option_menu.py`)
- Lobby UI → Client transport: creates client (evidence: `code/lobby.py`)
- Lobby UI → Host transport: creates host (evidence: `code/lobby.py`)
- Lobby UI → Player tracking: tracks players (evidence: `code/lobby.py`)
- Lobby UI → Game world: starts game (evidence: `code/lobby.py`)
- Client transport → Message protocol: uses protocol (evidence: `code/servers/client.py`)
- Host transport → Message protocol: uses protocol (evidence: `code/servers/host.py`)
- Game world → World loading: loads map (evidence: `code/game.py`)
- Game world → Game modes: initializes modes (evidence: `code/game.py`)
- Game world → HUD: initializes HUD (evidence: `code/game.py`)
- Game world → 3D audio: initializes audio (evidence: `code/game.py`)
- Game world → Player manager: creates manager (evidence: `code/game.py`)
- Game world → Entity manager: creates manager (evidence: `code/game.py`)
- Game world → Random generation: creates manager (evidence: `code/game.py`)
- Game world → Impact decals: creates manager (evidence: `code/game.py`)
- 3D audio → Sound registration: registers sounds (evidence: `code/audio/audioTriggerGlobal.py`)
- Player manager → Networked players: uses player classes (evidence: `code/playerMgr.py`)
- Entity manager → World functions: uses functions (evidence: `code/entities/entMgr.py`)
- Entity models → Node entities: uses node entities (evidence: `code/entities/entModels.py`)
- Entity models → World functions: uses functions (evidence: `code/entities/entModels.py`)
- Node entities → Entity base: extends (evidence: `code/entities/npEnt.py`)
- World functions → Node entities: extends entities (evidence: `code/entities/funcs.py`)
- Player model → Entity models: uses models (evidence: `code/entities/playerModel.py`)
- Networked players → Player entities: extends players (evidence: `code/entities/playerNet.py`)
- Player entities → Node entities: extends entities (evidence: `code/entities/playerEnts.py`)
- Player entities → Weapon slots: creates weapon manager (evidence: `code/entities/playerEnts.py`)
- Player entities → Weapon set: uses weapons (evidence: `code/entities/playerEnts.py`)
- Bullet weapons → Weapon slots: uses slot manager (evidence: `code/weapons/bulletBase.py`)
- Bullet weapons → Weapon timing: uses timing (evidence: `code/weapons/bulletBase.py`)
- Bullet weapons → Ammo and reload: uses ammo (evidence: `code/weapons/bulletBase.py`)
- Bullet weapons → Damage types: calculates damage (evidence: `code/weapons/bulletBase.py`)
- Ammo and reload → Weapon slots: uses slot manager (evidence: `code/weapons/wpnAmmo.py`)
- Ammo and reload → Weapon timing: extends timing (evidence: `code/weapons/wpnAmmo.py`)
- Weapon slots → Weapon base: extends weapon base (evidence: `code/weapons/wpnSlots.py`)
- Weapon set → Bullet weapons: defines weapons (evidence: `code/weapons/as_wpns.py`)
