Dune

Forum Platform development Bugs and fix requests How does all of this works?

How does all of this works? 📌 Pinned

mCmanu 24 Views

Sign in to post

Hello everyone,


In the spirit of transparency, I'd like to share a technical overview of Dune 2000 Online, explaining how the game client, multiplayer server, website, and API are built:


GAME CLIENT
  1. Language: TypeScript (ES2022), using a vanilla UI without React.
  2. Build tool: Vite 7.
  3. Main entry point: client/src/main.ts
  4. Rendering: 2D Canvas, using the game view and minimap.
  5. Game modes: Local gameplay with AI and Conquest, powered by a Web Worker, multiplayer lobby, and immersive mode.
  6. Shared simulation logic: Located in the shared/sim directory.
MULTIPLAYER SERVER
  1. Runtime: Node.js with TypeScript, executed through tsx.
  2. Main entry point: server/src/index.ts
  3. WebSocket server: Port 8787, using the /ws endpoint and the ws library.
  4. Features: Multiplayer rooms and lobby management.
  5. Persistence: MySQL through mysql2, combined with file-based storage.
WEBSITE AND ACCOUNTS
  1. Backend: PHP 8.1, with strict typing and no Composer dependencies.
  2. Account pages: Located in compte/.
  3. Shared PHP libraries: Located in php/lib/.
  4. Database access: MySQL through mysqli.
  5. Authentication: Secure session cookies named dune_session, HMAC-SHA256 signatures, and PHP password hashing through password_hash().
  6. Forum editor: A locally bundled version of Quill.
API

The API is located in compte/api/ and handles:

  1. Login and registration.
  2. Account information.
  3. Battle records.
  4. Forum image uploads.
  5. Immersive mode features.
  6. Password recovery and resets.
SHARED COMPONENTS
  1. Game simulation: shared/sim/
  2. Communication protocol: shared/protocol.ts
  3. Game balance configuration: shared/balance.ts
  4. Internationalization: French, English, Spanish, and German.
  5. Translation files: shared/locales/fr.json, shared/locales/en.json, shared/locales/es.json, and shared/locales/de.json.
  6. Generated translation dictionary


Hope it helps anyone technical understand the processes behind here! :D

Reply

Sign in to post