# aywen1/video-battle-ia-minecraft architecture

> Architecture diagram of the GitHub repository aywen1/video-battle-ia-minecraft, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-05-15). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/aywen1/video-battle-ia-minecraft
- Repository: https://github.com/aywen1/video-battle-ia-minecraft

## Overview

1. This repository is not one application; it contains four independent browser games, one per AI model: `chatgpt/`, `claude/`, `gemini/`, and `grok/`. Each folder has its own `index.html`, `package.json`, TypeScript config, and source tree, so there is no shared runtime or shared code between the four implementations.

2. All four projects are client-side voxel/Minecraft-style games meant to run in the browser. The architectural center is always the same domain shape: a block world, a player/avatar, moving entities or mobs, inventory/UI, and a rendering layer that turns chunked world data into visuals.

3. The `chatgpt` project is organized as an engine-style monolith under `src/engine/`. It has a central `Engine` plus a shared `EventBus`, and then feature subsystems for world, physics, rendering, player control, audio, inventory, crafting, interactions, NPCs, mobs, dropped items, lighting, textures, and UI. This is the most “modular engine” layout in the repo.

4. In `chatgpt`, the world pipeline is explicit: block definitions and constants feed chunk data, `WorldGenerator` and its biome/noise/feature helpers create terrain, `ChunkManager` manages active chunks, and `VoxelMesher` converts voxel data into renderable geometry. Gameplay systems like breaking blocks, debris, dropped items, and physics sit on top of that world representation.

5. `chatgpt` also shows a strong interaction boundary between simulation and presentation. Player input and interactions flow through `PlayerController`, `BlockInteractor`, and similar systems into world state; UI modules such as HUD, dialogue, trading, and game state react to that state, while renderer/audio systems provide the visible and audible output.

6. The `claude` project uses a more traditional game-engine layering. It separates `core` (engine and input), `world` (chunk/world generation and structures), `entities` (mob manager, AI, combat, spawning, models), `player` (physics and status effects), `rendering` (meshing, particles, lighting, weather, water, post-processing), `audio`, `textures`, and `ui`.

7. `claude` is broader in presentation systems than `chatgpt`: it includes shadowing, SSAO, weather, sky, water, torch lighting, particles, and several UI overlays such as inventory, minimap, pause/menu screens, death screen, achievements, commands, and XP. That suggests a pipeline where the game state drives multiple visual post-effects and HUD layers.

8. The `gemini` project is the most React-centric architecture. `src/App.tsx` is the top-level UI composition, and the game is split into reusable React components for player, chunks, mobs, and UI. State is centralized in `store/` slices for inventory, achievements, and mobs, with hooks like `useKeyboard` and `useAchievementCheck` bridging browser input into app state.

9. In `gemini`, the simulation layer is relatively compact: `game/world.ts`, `game/physics.ts`, and `game/constants.ts` hold core mechanics, while `textures/TextureFactory.ts` and texture mapping utilities feed rendering. This makes the data flow more declarative: input hooks update store/game state, React components read from that state, and UI/game components re-render accordingly.

10. The `grok` project is the smallest and most minimal. It appears to be a lightweight React/Vite demo with a `BasicVoxelWorld`, a `SimpleVoxelWorld`, and a `Crosshair` UI component. This suggests a proof-of-concept architecture focused on displaying a voxel scene rather than a full game simulation stack.

11. Across the repo, the most important architectural boundary is between voxel simulation and presentation. Chunk/world modules own block data and generation; meshing modules convert chunks into geometry; UI modules render inventory/HUD/menus; player and entity modules update state based on input and physics; audio and lighting act as cross-cutting subsystems.

12. Another consistent characteristic is that these are all front-end-only applications. There is no backend service, database, or network layer in the repository tree. Any persistence, progression, or game state appears to be local/in-memory within the browser app.

13. If you were drawing a diagram, the main top-level boxes should be the four independent apps, and inside each one the dominant flow is: browser input → player/simulation systems → world/entity state → meshing/rendering/UI/audio. The exact subsystem granularity differs, but that overall client-side game loop is the shared architecture pattern.

Main entry points: [`chatgpt/src/engine/core/Engine.ts`](https://github.com/aywen1/video-battle-ia-minecraft/blob/main/chatgpt/src/engine/core/Engine.ts) (Engine), [`claude/src/core`](https://github.com/aywen1/video-battle-ia-minecraft/tree/main/claude/src/core) (Core), [`chatgpt/src/engine/world`](https://github.com/aywen1/video-battle-ia-minecraft/tree/main/chatgpt/src/engine/world) (World), [`claude/src/rendering`](https://github.com/aywen1/video-battle-ia-minecraft/tree/main/claude/src/rendering) (Rendering)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_chatgpt["chatgpt"]
  node_chatgpt_engine["Engine<br/>runtime<br/>[Engine.ts]"]
  node_chatgpt_world[("World<br/>simulation")]
  node_chatgpt_player["Player<br/>input/sim"]
  node_chatgpt_entities["Entities<br/>simulation"]
  node_chatgpt_ui["UI<br/>presentation"]
  node_chatgpt_render["Render<br/>presentation"]
  node_chatgpt_support["Support<br/>systems"]
end

subgraph group_claude["claude"]
  node_claude_core["Core<br/>runtime"]
  node_claude_world[("World<br/>simulation")]
  node_claude_entities["Entities<br/>simulation"]
  node_claude_player["Player<br/>input/sim"]
  node_claude_rendering["Rendering<br/>presentation"]
  node_claude_ui["UI<br/>presentation"]
  node_claude_support["Support<br/>systems"]
end

subgraph group_gemini["gemini"]
  node_gemini_app["App<br/>react shell<br/>[App.tsx]"]
  node_gemini_state[("Store<br/>state")]
  node_gemini_game["Game<br/>simulation"]
  node_gemini_components["Components<br/>presentation"]
  node_gemini_textures["Textures<br/>presentation"]
end

subgraph group_grok["grok"]
  node_grok_app["App<br/>react shell<br/>[App.tsx]"]
  node_grok_world[("Voxel World<br/>presentation/sim")]
  node_grok_ui["UI<br/>presentation"]
end

node_chatgpt_engine -->|"updates"| node_chatgpt_world
node_chatgpt_engine -->|"drives"| node_chatgpt_player
node_chatgpt_engine -->|"ticks"| node_chatgpt_entities
node_chatgpt_engine -->|"feeds state"| node_chatgpt_ui
node_chatgpt_engine -->|"renders via"| node_chatgpt_render
node_chatgpt_engine -->|"orchestrates"| node_chatgpt_support
node_chatgpt_player -->|"interacts with"| node_chatgpt_world
node_chatgpt_world -->|"meshes into"| node_chatgpt_render
node_chatgpt_entities -->|"lives in"| node_chatgpt_world
node_chatgpt_support -->|"supports"| node_chatgpt_ui
node_claude_core -->|"runs"| node_claude_world
node_claude_core -->|"routes input"| node_claude_player
node_claude_core -->|"coordinates"| node_claude_entities
node_claude_core -->|"feeds frames"| node_claude_rendering
node_claude_core -->|"updates"| node_claude_ui
node_claude_world -->|"meshes into"| node_claude_rendering
node_claude_player -->|"affects"| node_claude_world
node_claude_entities -->|"appears in"| node_claude_rendering
node_claude_support -->|"enables"| node_claude_rendering
node_gemini_app -->|"reads/writes"| node_gemini_state
node_gemini_app -->|"uses"| node_gemini_game
node_gemini_app -->|"composes"| node_gemini_components
node_gemini_components -->|"subscribes to"| node_gemini_state
node_gemini_game -->|"drives world"| node_gemini_components
node_gemini_game -->|"uses"| node_gemini_textures
node_grok_app -->|"renders"| node_grok_world
node_grok_app -->|"shows"| node_grok_ui
node_grok_world -.->|"paired with"| node_grok_ui

click node_chatgpt_engine "https://github.com/aywen1/video-battle-ia-minecraft/blob/main/chatgpt/src/engine/core/Engine.ts"
click node_chatgpt_world "https://github.com/aywen1/video-battle-ia-minecraft/tree/main/chatgpt/src/engine/world"
click node_chatgpt_player "https://github.com/aywen1/video-battle-ia-minecraft/tree/main/chatgpt/src/engine/player"
click node_chatgpt_entities "https://github.com/aywen1/video-battle-ia-minecraft/tree/main/chatgpt/src/engine/mobs"
click node_chatgpt_ui "https://github.com/aywen1/video-battle-ia-minecraft/tree/main/chatgpt/src/engine/ui"
click node_chatgpt_render "https://github.com/aywen1/video-battle-ia-minecraft/tree/main/chatgpt/src/engine/render"
click node_chatgpt_support "https://github.com/aywen1/video-battle-ia-minecraft/tree/main/chatgpt/src/engine"
click node_claude_core "https://github.com/aywen1/video-battle-ia-minecraft/tree/main/claude/src/core"
click node_claude_world "https://github.com/aywen1/video-battle-ia-minecraft/tree/main/claude/src/world"
click node_claude_entities "https://github.com/aywen1/video-battle-ia-minecraft/tree/main/claude/src/entities"
click node_claude_player "https://github.com/aywen1/video-battle-ia-minecraft/tree/main/claude/src/player"
click node_claude_rendering "https://github.com/aywen1/video-battle-ia-minecraft/tree/main/claude/src/rendering"
click node_claude_ui "https://github.com/aywen1/video-battle-ia-minecraft/tree/main/claude/src/ui"
click node_claude_support "https://github.com/aywen1/video-battle-ia-minecraft/tree/main/claude/src"
click node_gemini_app "https://github.com/aywen1/video-battle-ia-minecraft/blob/main/gemini/src/App.tsx"
click node_gemini_state "https://github.com/aywen1/video-battle-ia-minecraft/tree/main/gemini/src/store"
click node_gemini_game "https://github.com/aywen1/video-battle-ia-minecraft/tree/main/gemini/src/game"
click node_gemini_components "https://github.com/aywen1/video-battle-ia-minecraft/tree/main/gemini/src/components"
click node_gemini_textures "https://github.com/aywen1/video-battle-ia-minecraft/tree/main/gemini/src/textures"
click node_grok_app "https://github.com/aywen1/video-battle-ia-minecraft/blob/main/grok/src/App.tsx"
click node_grok_world "https://github.com/aywen1/video-battle-ia-minecraft/tree/main/grok/src/components/voxel"
click node_grok_ui "https://github.com/aywen1/video-battle-ia-minecraft/tree/main/grok/src/components/ui"

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_chatgpt_engine,node_chatgpt_world,node_chatgpt_player,node_chatgpt_entities,node_chatgpt_ui,node_chatgpt_render,node_chatgpt_support toneBlue
class node_claude_core,node_claude_world,node_claude_entities,node_claude_player,node_claude_rendering,node_claude_ui,node_claude_support toneAmber
class node_gemini_app,node_gemini_state,node_gemini_game,node_gemini_components,node_gemini_textures toneMint
class node_grok_app,node_grok_world,node_grok_ui toneRose
```

## Components

### chatgpt

Engine-style browser voxel game

- [Engine](https://github.com/aywen1/video-battle-ia-minecraft/blob/main/chatgpt/src/engine/core/Engine.ts): runtime · Central game loop and subsystem coordinator · `chatgpt/src/engine/core/Engine.ts`
- [World](https://github.com/aywen1/video-battle-ia-minecraft/tree/main/chatgpt/src/engine/world): simulation · Chunks, generation, meshing, and block data · `chatgpt/src/engine/world`
- [Player](https://github.com/aywen1/video-battle-ia-minecraft/tree/main/chatgpt/src/engine/player): input/sim · First-person control and block interaction · `chatgpt/src/engine/player`
- [Entities](https://github.com/aywen1/video-battle-ia-minecraft/tree/main/chatgpt/src/engine/mobs): simulation · NPCs, mobs, dropped items, and interactions · `chatgpt/src/engine/mobs`
- [UI](https://github.com/aywen1/video-battle-ia-minecraft/tree/main/chatgpt/src/engine/ui): presentation · HUD, dialogue, trading, and game state views · `chatgpt/src/engine/ui`
- [Render](https://github.com/aywen1/video-battle-ia-minecraft/tree/main/chatgpt/src/engine/render): presentation · Voxel rendering and visual output · `chatgpt/src/engine/render`
- [Support](https://github.com/aywen1/video-battle-ia-minecraft/tree/main/chatgpt/src/engine): systems · Audio, inventory, crafting, lighting, textures, and events · `chatgpt/src/engine`

### claude

Layered browser voxel game

- [Core](https://github.com/aywen1/video-battle-ia-minecraft/tree/main/claude/src/core): runtime · Engine and input coordination · `claude/src/core`
- [World](https://github.com/aywen1/video-battle-ia-minecraft/tree/main/claude/src/world): simulation · World state, chunks, generation, structures, and drops · `claude/src/world`
- [Entities](https://github.com/aywen1/video-battle-ia-minecraft/tree/main/claude/src/entities): simulation · Mob AI, combat, spawning, and models · `claude/src/entities`
- [Player](https://github.com/aywen1/video-battle-ia-minecraft/tree/main/claude/src/player): input/sim · Player physics and status effects · `claude/src/player`
- [Rendering](https://github.com/aywen1/video-battle-ia-minecraft/tree/main/claude/src/rendering): presentation · Meshing, particles, lighting, weather, water, and post-processing · `claude/src/rendering`
- [UI](https://github.com/aywen1/video-battle-ia-minecraft/tree/main/claude/src/ui): presentation · HUD, inventory, menus, achievements, commands, and overlays · `claude/src/ui`
- [Support](https://github.com/aywen1/video-battle-ia-minecraft/tree/main/claude/src): systems · Audio, textures, blocks, recipes, and utilities · `claude/src`

### gemini

React-centric browser voxel game

- [App](https://github.com/aywen1/video-battle-ia-minecraft/blob/main/gemini/src/App.tsx): react shell · Top-level React composition · `gemini/src/App.tsx`
- [Store](https://github.com/aywen1/video-battle-ia-minecraft/tree/main/gemini/src/store): state · Central slices for inventory, achievements, and mobs · `gemini/src/store`
- [Game](https://github.com/aywen1/video-battle-ia-minecraft/tree/main/gemini/src/game): simulation · World, physics, and constants · `gemini/src/game`
- [Components](https://github.com/aywen1/video-battle-ia-minecraft/tree/main/gemini/src/components): presentation · Player, chunks, mobs, and UI React components · `gemini/src/components`
- [Textures](https://github.com/aywen1/video-battle-ia-minecraft/tree/main/gemini/src/textures): presentation · Texture factory and mapping utilities · `gemini/src/textures`

### grok

Minimal voxel demo

- [App](https://github.com/aywen1/video-battle-ia-minecraft/blob/main/grok/src/App.tsx): react shell · Minimal React entry point · `grok/src/App.tsx`
- [Voxel World](https://github.com/aywen1/video-battle-ia-minecraft/tree/main/grok/src/components/voxel): presentation/sim · Basic and simple voxel world components · `grok/src/components/voxel`
- [UI](https://github.com/aywen1/video-battle-ia-minecraft/tree/main/grok/src/components/ui): presentation · Crosshair and minimal HUD · `grok/src/components/ui`

## Connections

- Engine → World: updates · Coordinates chunk/world lifecycle
- Engine → Player: drives · Runs input and player control
- Engine → Entities: ticks · Advances mobs, NPCs, and drops
- Engine → UI: feeds state · Pushes game state to HUD and menus
- Engine → Render: renders via · Hands simulation state to renderer
- Engine → Support: orchestrates · Uses shared systems like audio and crafting
- Player → World: interacts with · Breaks blocks and changes world state
- World → Render: meshes into · Chunk data becomes geometry
- Entities → World: lives in · NPCs and mobs depend on world state
- Support → UI: supports · Inventory, crafting, dialogue, and trade UIs
- Core → World: runs · Owns chunk/world lifecycle
- Core → Player: routes input · Connects controls to player physics
- Core → Entities: coordinates · Advances entity spawning and AI
- Core → Rendering: feeds frames · Passes world and entity state to visuals
- Core → UI: updates · Synchronizes HUD and menus
- World → Rendering: meshes into · Chunk geometry enters rendering pipeline
- Player → World: affects · Physics and movement interact with terrain
- Entities → Rendering: appears in · Mob models, particles, and combat visuals
- Support → Rendering: enables · Textures, audio, and block definitions back presentation
- App → Store: reads/writes · React app binds to centralized store
- App → Game: uses · Consumes core mechanics and constants
- App → Components: composes · Builds the UI and scene from components
- Components → Store: subscribes to · Components render from shared store state
- Game → Components: drives world · World and physics state inform gameplay views
- Game → Textures: uses · Texture factory supports rendering
- App → Voxel World: renders · App mounts minimal voxel scene
- App → UI: shows · Adds minimal crosshair overlay
- Voxel World → UI: paired with · Scene and overlay form the demo experience
