# cubickt/geneships architecture

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

- Interactive diagram: https://gitdiagram.com/cubickt/geneships
- Repository: https://github.com/cubickt/geneships

## Overview

GeneShips is an early-stage libGDX naval-ship simulation. The current workflow is desktop launch, click-to-generate a random-genome ship, create its Box2D body and physics updater, then advance and render it each frame. The README describes genetic evolution, biodiversity, tactical AI, race mode, and configurable game modes as plans; they are not evidenced as implemented runtime stages. The graph reflects sampled runtime code and documented roadmap items, not an inspected implementation of those plans.

Main entry points: [`core/src/main/java/io/github/GeneShips/entities/Ship.java`](https://github.com/cubickt/geneships/blob/master/core/src/main/java/io/github/GeneShips/entities/Ship.java) (Ship and Genome), [`core/src/main/java/io/github/GeneShips/Main.java`](https://github.com/cubickt/geneships/blob/master/core/src/main/java/io/github/GeneShips/Main.java) (Game Loop), [`core/src/main/java/io/github/GeneShips/generators/ShipGenerator.java`](https://github.com/cubickt/geneships/blob/master/core/src/main/java/io/github/GeneShips/generators/ShipGenerator.java) (Random Generator), [`core/src/main/java/io/github/GeneShips/generators/ShipBodyFactory.java`](https://github.com/cubickt/geneships/blob/master/core/src/main/java/io/github/GeneShips/generators/ShipBodyFactory.java) (Hull Body Factory)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_desktop["Desktop Runtime"]
  node_launcher["LWJGL Launcher"]
  node_startup["Startup Helper<br/>[StartupHelper.java]"]
end

subgraph group_simulation["Simulation Loop"]
  node_main["Game Loop<br/>[Main.java]"]
  node_world["Box2D World<br/>[Main.java]"]
  node_generator["Random Generator<br/>[ShipGenerator.java]"]
  node_bodyfactory["Hull Body Factory"]
  node_physics["Ship Physics<br/>[ShipPhysics.java]"]
  node_renderer["Ship Renderer<br/>[ShipRenderer.java]"]
end

subgraph group_vessels["Ship Model"]
  node_ship["Ship and Genome<br/>[Ship.java]"]
  node_physprops["Physics Properties<br/>[ShipPhysProp.java]"]
  node_shipstate["Ship State<br/>[ShipState.java]"]
  node_math["Value Mapping<br/>[MathUtils.java]"]
end

subgraph group_roadmap["Planned Capabilities"]
  node_roadmapitems["Evolution and Modes<br/>[README.md]"]
end

node_player(("Player"))

node_player -->|"clicks to spawn"| node_main
node_launcher -->|"checks restart"| node_startup
node_launcher -->|"starts app"| node_main
node_main -->|"steps physics"| node_world
node_main -->|"requests ship"| node_generator
node_main -->|"updates ships"| node_ship
node_main -->|"renders ships"| node_renderer
node_generator -->|"constructs"| node_ship
node_generator -->|"creates body"| node_bodyfactory
node_generator -->|"attaches updater"| node_physics
node_bodyfactory -->|"creates fixtures"| node_world
node_bodyfactory -->|"reads geometry"| node_ship
node_ship -->|"updates physics"| node_physics
node_physics -->|"syncs state"| node_ship
node_renderer -->|"reads shape and state"| node_ship
node_ship -->|"implements"| node_physprops
node_ship -->|"implements"| node_shipstate
node_ship -->|"maps genes"| node_math
node_physics -->|"maps speed"| node_math
node_bodyfactory -->|"maps hull"| node_math

click node_launcher "https://github.com/cubickt/geneships/blob/master/lwjgl3/src/main/java/io/github/GeneShips/lwjgl3/Lwjgl3Launcher.java"
click node_startup "https://github.com/cubickt/geneships/blob/master/lwjgl3/src/main/java/io/github/GeneShips/lwjgl3/StartupHelper.java"
click node_main "https://github.com/cubickt/geneships/blob/master/core/src/main/java/io/github/GeneShips/Main.java"
click node_world "https://github.com/cubickt/geneships/blob/master/core/src/main/java/io/github/GeneShips/Main.java"
click node_generator "https://github.com/cubickt/geneships/blob/master/core/src/main/java/io/github/GeneShips/generators/ShipGenerator.java"
click node_bodyfactory "https://github.com/cubickt/geneships/blob/master/core/src/main/java/io/github/GeneShips/generators/ShipBodyFactory.java"
click node_physics "https://github.com/cubickt/geneships/blob/master/core/src/main/java/io/github/GeneShips/entities/ShipPhysics.java"
click node_renderer "https://github.com/cubickt/geneships/blob/master/core/src/main/java/io/github/GeneShips/Renderers/ShipRenderer.java"
click node_ship "https://github.com/cubickt/geneships/blob/master/core/src/main/java/io/github/GeneShips/entities/Ship.java"
click node_physprops "https://github.com/cubickt/geneships/blob/master/core/src/main/java/io/github/GeneShips/Interfaces/ShipPhysProp.java"
click node_shipstate "https://github.com/cubickt/geneships/blob/master/core/src/main/java/io/github/GeneShips/Interfaces/ShipState.java"
click node_math "https://github.com/cubickt/geneships/blob/master/core/src/main/java/io/github/GeneShips/MathUtils.java"
click node_roadmapitems "https://github.com/cubickt/geneships/blob/master/README.md"

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_launcher,node_startup toneBlue
class node_main,node_world,node_generator,node_bodyfactory,node_physics,node_renderer toneAmber
class node_ship,node_physprops,node_shipstate,node_math toneMint
class node_roadmapitems toneRose
class node_player toneIndigo
```

## Components

### Desktop Runtime

- [LWJGL Launcher](https://github.com/cubickt/geneships/blob/master/lwjgl3/src/main/java/io/github/GeneShips/lwjgl3/Lwjgl3Launcher.java): `lwjgl3/src/main/java/io/github/GeneShips/lwjgl3/Lwjgl3Launcher.java`
- [Startup Helper](https://github.com/cubickt/geneships/blob/master/lwjgl3/src/main/java/io/github/GeneShips/lwjgl3/StartupHelper.java): `lwjgl3/src/main/java/io/github/GeneShips/lwjgl3/StartupHelper.java`

### Simulation Loop

- [Game Loop](https://github.com/cubickt/geneships/blob/master/core/src/main/java/io/github/GeneShips/Main.java): `core/src/main/java/io/github/GeneShips/Main.java`
- [Box2D World](https://github.com/cubickt/geneships/blob/master/core/src/main/java/io/github/GeneShips/Main.java): `core/src/main/java/io/github/GeneShips/Main.java`
- [Random Generator](https://github.com/cubickt/geneships/blob/master/core/src/main/java/io/github/GeneShips/generators/ShipGenerator.java): `core/src/main/java/io/github/GeneShips/generators/ShipGenerator.java`
- [Hull Body Factory](https://github.com/cubickt/geneships/blob/master/core/src/main/java/io/github/GeneShips/generators/ShipBodyFactory.java): `core/src/main/java/io/github/GeneShips/generators/ShipBodyFactory.java`
- [Ship Physics](https://github.com/cubickt/geneships/blob/master/core/src/main/java/io/github/GeneShips/entities/ShipPhysics.java): `core/src/main/java/io/github/GeneShips/entities/ShipPhysics.java`
- [Ship Renderer](https://github.com/cubickt/geneships/blob/master/core/src/main/java/io/github/GeneShips/Renderers/ShipRenderer.java): `core/src/main/java/io/github/GeneShips/Renderers/ShipRenderer.java`

### Ship Model

- [Ship and Genome](https://github.com/cubickt/geneships/blob/master/core/src/main/java/io/github/GeneShips/entities/Ship.java): `core/src/main/java/io/github/GeneShips/entities/Ship.java`
- [Physics Properties](https://github.com/cubickt/geneships/blob/master/core/src/main/java/io/github/GeneShips/Interfaces/ShipPhysProp.java): `core/src/main/java/io/github/GeneShips/Interfaces/ShipPhysProp.java`
- [Ship State](https://github.com/cubickt/geneships/blob/master/core/src/main/java/io/github/GeneShips/Interfaces/ShipState.java): `core/src/main/java/io/github/GeneShips/Interfaces/ShipState.java`
- [Value Mapping](https://github.com/cubickt/geneships/blob/master/core/src/main/java/io/github/GeneShips/MathUtils.java): `core/src/main/java/io/github/GeneShips/MathUtils.java`

### Planned Capabilities

- [Evolution and Modes](https://github.com/cubickt/geneships/blob/master/README.md): `README.md`

### Other components

- **Player**

## Connections

- Player → Game Loop: clicks to spawn (evidence: `core/src/main/java/io/github/GeneShips/Main.java`)
- LWJGL Launcher → Startup Helper: checks restart (evidence: `lwjgl3/src/main/java/io/github/GeneShips/lwjgl3/Lwjgl3Launcher.java`)
- LWJGL Launcher → Game Loop: starts app (evidence: `lwjgl3/src/main/java/io/github/GeneShips/lwjgl3/Lwjgl3Launcher.java`)
- Game Loop → Box2D World: steps physics (evidence: `core/src/main/java/io/github/GeneShips/Main.java`)
- Game Loop → Random Generator: requests ship (evidence: `core/src/main/java/io/github/GeneShips/Main.java`)
- Game Loop → Ship and Genome: updates ships (evidence: `core/src/main/java/io/github/GeneShips/Main.java`)
- Game Loop → Ship Renderer: renders ships (evidence: `core/src/main/java/io/github/GeneShips/Main.java`)
- Random Generator → Ship and Genome: constructs (evidence: `core/src/main/java/io/github/GeneShips/generators/ShipGenerator.java`)
- Random Generator → Hull Body Factory: creates body (evidence: `core/src/main/java/io/github/GeneShips/generators/ShipGenerator.java`)
- Random Generator → Ship Physics: attaches updater (evidence: `core/src/main/java/io/github/GeneShips/generators/ShipGenerator.java`)
- Hull Body Factory → Box2D World: creates fixtures (evidence: `core/src/main/java/io/github/GeneShips/generators/ShipBodyFactory.java`)
- Hull Body Factory → Ship and Genome: reads geometry (evidence: `core/src/main/java/io/github/GeneShips/generators/ShipBodyFactory.java`)
- Ship and Genome → Ship Physics: updates physics (evidence: `core/src/main/java/io/github/GeneShips/entities/Ship.java`)
- Ship Physics → Ship and Genome: syncs state (evidence: `core/src/main/java/io/github/GeneShips/entities/ShipPhysics.java`)
- Ship Renderer → Ship and Genome: reads shape and state (evidence: `core/src/main/java/io/github/GeneShips/Renderers/ShipRenderer.java`)
- Ship and Genome → Physics Properties: implements (evidence: `core/src/main/java/io/github/GeneShips/entities/Ship.java`)
- Ship and Genome → Ship State: implements (evidence: `core/src/main/java/io/github/GeneShips/entities/Ship.java`)
- Ship and Genome → Value Mapping: maps genes (evidence: `core/src/main/java/io/github/GeneShips/entities/Ship.java`)
- Ship Physics → Value Mapping: maps speed (evidence: `core/src/main/java/io/github/GeneShips/entities/ShipPhysics.java`)
- Hull Body Factory → Value Mapping: maps hull (evidence: `core/src/main/java/io/github/GeneShips/generators/ShipBodyFactory.java`)
