How sarachehab/gluttonio works
Main components
1. FPGA Subsystem
• Quartus RTL design (clk_divider, debounce, fir, top.v)
• Hardware testbench (C++ testbench, script)
• On-board software apps (main.c, latency_app)
• VM simulation environment (Python scripts: demo.py, fir_tester.py, etc.)
2. Game Client (Unity)
• Scenes & Assets (Menu, SampleScene, GameOver, sprites, sounds)
• C# scripts (ServerConnect.cs, FpgaController.cs, PlayerMovement.cs, etc.)
• TextMesh Pro UI
3. Game Server
• Node.js / TypeScript service (Express / WS)
• Domain model (Game.ts, Player.ts, Blob.ts, Food.ts, Bot.ts, MessageType.ts)
• Utilities (db.ts for persistence, PlayerUtils.ts)
• Tests (Jest or ts-node tests under /tests)
• Dev-only simulation scripts (game_development/*.js, brownian_motion)
4. External services & deployment
• AWS (EC2 or Elastic Beanstalk for server)
• Database (could be AWS RDS or a file-based DB)
Component relationships and data flows
– The Unity client opens a WebSocket connection to the Game Server and
exchanges JSON-encoded messages (ClientMessage ↔ ServerMessage).
– The server updates game state (positions, scores, spawns) and writes
persistent data via the DB utility.
– FPGA subsystem is developed, tested, and optionally connected via
JTAG/UART; the Unity client’s FpgaController class can interface
directly with a hardware board or a VM simulation (demo.py).
– Dev scripts under server/game_development allow local JavaScript
prototyping of game logic before server deployment.
Architectural patterns & principles
– Separation of concerns:
• Hardware design | Hardware-side software | Simulation VM
• Front-end (Unity) | Back-end (Node.js) | Persistence (DB)
– Event-driven, bidirectional messaging via WebSockets
– Layered architecture:
• Presentation (Unity UI + input handling)
• Application (C# game logic, state sync)
• Domain services (Node.js game loop, rule enforcement)
• Data layer (database abstraction)
Final remarks
– Be exhaustive: include all directories only if they play a runtime role (skip Unity’s Meta files).