Complete Feature Documentation

A comprehensive technical overview of the WeAD Retro Games Platform - every feature, capability, and innovation explained in detail.

Platform Introduction

WeAD Retro Games Platform is a browser-based emulation system that enables users to play classic console games directly in their web browser without any downloads or installations. The platform integrates natively with Telegram and Discord, providing access to over 950 million combined users across both platforms.

Core Value Proposition

Zero-friction gaming access through existing social platforms, combined with industry-first streaming multiplayer technology that enables cross-device play regardless of hardware capabilities.

System Architecture

The platform is built on a modern web stack optimized for real-time gaming and social integration.

Backend Stack

Runtime: Node.js v18+
Framework: Express.js
Database: SQLite3
Real-time: WebSocket + Socket.IO
Bot Framework: Telegraf + Discord.js v14

Frontend Stack

Core: Vanilla JavaScript ES6+
Emulator: EmulatorJS (WebAssembly)
Multiplayer: WebRTC
Storage: IndexedDB

Distribution Channels

The platform operates through three primary distribution channels, each optimized for its specific audience and use case.

Primary Telegram Mini Apps

Direct integration as a Telegram Mini App accessible to 800+ million Telegram users. Users launch the game directly within the Telegram interface without leaving the app. Deep linking preserves user identity, group context, and enables seamless social features.

Primary Discord Activities

Native Discord Activity integration reaching 150+ million Discord users. Server administrators can deploy the platform as an embedded activity. Slash commands enable user registration, game launching, and leaderboard queries without leaving Discord.

Secondary Direct Web Access

Standalone web application accessible via any modern browser. Supports anonymous users and provides the full gaming experience without platform affiliation. Ideal for users who prefer direct access or discovery through search.

Telegram Integration

The Telegram integration is a core distribution channel providing access to the largest encrypted messaging platform globally.

Bot Commands

CommandFunction
/startWelcome message with game link and registration
/playDirect link to game interface with user context
/registerRegister user in tournament system
/leaderboardDisplay tournament participants
/screenshotUpload and share game screenshot to group
/setchannelConfigure screenshot destination channel
/rotateManually rotate tournament game [Admin]
/load [game]Load specific game by name [Admin]
/stopgameRemove current game from rotation [Admin]

Multi-Group Architecture

The platform supports unlimited simultaneous Telegram groups. Each group maintains its own:

  • Leaderboard: Group-specific participant rankings
  • Screenshot Channel: Configurable destination for shared screenshots
  • Branding: Dynamic title and UI adaptation to group name
  • Tournament Context: Group-aware tournament participation

Discord Integration

Native Discord integration enables deployment across unlimited Discord servers with server-specific customization.

Slash Commands

CommandFunction
/registerRegister Discord user in tournament
/playLaunch game with Discord user context
/leaderboardDisplay server-specific rankings
/screenshotShare screenshot to configured channel
/setchannelConfigure screenshot channel [Admin]
/rotateRotate tournament game [Admin]

Server Isolation

Each Discord server operates as an independent instance with isolated user data, leaderboards, and configuration while participating in the global tournament system.

Viral Mechanics

The platform architecture enables organic viral growth through built-in social mechanics.

Cross-Group User Flow

Users can seamlessly move between Telegram groups and Discord servers while maintaining their gaming session. When a user shares their gaming activity, recipients in other groups can click to join, automatically discovering the platform. This creates an exponential growth loop where each user becomes a potential acquisition channel for multiple communities.

Viral Growth Mechanisms

  • Screenshot Sharing: Game screenshots shared to groups include platform branding and join links
  • Leaderboard Competition: Cross-group leaderboards encourage users to invite friends for competitive advantage
  • Tournament Notifications: Automated tournament announcements expose the platform to all group members
  • Deep Linking: Every shared link preserves context, reducing friction for new user onboarding

Multiplayer System

The multiplayer system represents a breakthrough in browser-based retro gaming, enabling real-time synchronized play between two players regardless of device capabilities.

Industry First: Streaming Multiplayer

Player 2 does not run an emulator instance. Instead, Player 2 receives a real-time video stream of Player 1's game via WebRTC, while their inputs are transmitted back to Player 1's device for processing. This architecture enables multiplayer on any device regardless of processing power.

Player Roles

Player 1 - Host

Runs the actual emulator instance. Captures game video/audio and streams to Player 2 via WebRTC. Receives input from Player 2 and processes both player inputs locally. Responsible for game state and save data.

Player 2 - Client

Receives video stream from Player 1. No local emulation required. Sends input commands to Player 1 via WebRTC data channel. Can play on any device with video playback capability, including low-powered mobile devices.

Streaming Architecture

The streaming multiplayer system is built on WebRTC for low-latency peer-to-peer communication.

Connection Flow

  1. Player 1 creates room via WebSocket message to server
  2. Server generates unique room code and stores room state
  3. Player 2 joins room using code via WebSocket
  4. Server validates and connects both players
  5. Both players signal ready state
  6. Host initiates WebRTC connection setup
  7. SDP offer/answer exchange via WebSocket signaling
  8. ICE candidate exchange for NAT traversal
  9. Peer connection established
  10. Host begins streaming video/audio track
  11. Data channel established for input transmission

Latency Optimization

  • Sub-50ms typical latency for input round-trip
  • Frame delay compensation: 2-frame delay for input synchronization
  • Input queuing: Maintains synchronization during network jitter
  • Adaptive bitrate: Video quality adjusts to network conditions

WebRTC Implementation

Technical details of the WebRTC peer-to-peer connection system.

Video Codec: VP8/VP9 (adaptive)
Audio Codec: Opus
Data Channel: Reliable ordered for inputs
Signaling: WebSocket via platform server
STUN/TURN: Google STUN servers

Media Capture

The host captures the emulator canvas using captureStream() API, creating a MediaStream that includes both video and audio tracks. This stream is attached to the RTCPeerConnection and transmitted to Player 2.

Emulation Technology

Game emulation is powered by EmulatorJS, a browser-based emulation framework utilizing WebAssembly cores for near-native performance.

Core Technology

  • WebAssembly: Compiled emulator cores run at near-native speed
  • Automatic Core Selection: File extension determines appropriate emulator core
  • BIOS Support: Optional BIOS files for enhanced compatibility (PS1)
  • Save States: Browser-based save/load via IndexedDB

Supported Consoles

ConsoleCoreExtensions
Nintendo Entertainment Systemfceumm.nes
Super Nintendosnes9x.smc, .sfc
Game Boy / Colorgambatte.gb, .gbc
Game Boy Advancemgba.gba
Nintendo 64mupen64plus_next.n64, .z64, .v64
Sega Genesis / Mega Drivegenesis_plus_gx.md, .smd, .gen
Sega Master Systemsmsplus.sms
PlayStation 1pcsx_rearmed.cue, .bin, .chd, .pbp
PlayStation Portableppsspp.iso, .cso

CHD Format Support

PlayStation 1 games support CHD (Compressed Hunks of Data) format, reducing file sizes by up to 70% compared to raw BIN/CUE while maintaining full compatibility. This optimization is critical for mobile performance where bandwidth and storage are constrained.

Smart Caching System

The GameCache system uses IndexedDB for persistent local storage of game ROMs, enabling instant replay without re-downloading.

Cache Features

  • First Play: Game downloaded and cached automatically
  • Subsequent Plays: Game loads from cache in under 1 second
  • Storage Management: Users can view cached games and clear cache
  • Large File Support: Handles files up to 500MB+ (PS1/PSP games)
  • Progress Tracking: Download progress displayed during initial load
Storage API: IndexedDB
Database Name: WeAD_GameCache
Max Size: ~50% of available storage
Persistence: Until browser data cleared

Tournament System

The automated tournament system enables continuous gaming events across all connected groups and servers.

Game Rotation

  • Weekday Schedule: Games rotate on Monday-Friday schedule
  • Weekend Schedule: Separate game pool for Saturday-Sunday
  • Automatic Rotation: Scheduled job rotates games at configured times
  • Legal Compliance: Rotation prevents permanent hosting of any single title
  • Manual Override: Admins can force rotation or load specific games

Cross-Platform Leaderboard

The unified leaderboard combines participants from Telegram and Discord into a single ranking system. Each user's platform source is tracked and displayed, enabling cross-platform competition while maintaining platform-specific context.

Mobile Optimization

Extensive optimization ensures playable performance across mobile devices, with browser-specific tuning for optimal experience.

Device Detection

  • Platform Detection: iOS, Android, desktop identification
  • Browser Detection: Chrome, Safari, Samsung Browser specific handling
  • Orientation Detection: Portrait/landscape adaptive settings

Performance Tuning

SettingDesktopMobile
Audio Latency64ms192-256ms
Audio Sample Rate44100 Hz22050 Hz
Audio SyncEnabledDisabled
Shader Quality2xScaleHQNone (landscape)
Canvas ResolutionNativeReduced

Touch Controls

EmulatorJS provides virtual gamepad overlay for touch devices. Button layout adapts to current console (NES 2-button vs SNES 6-button vs PlayStation controller).

Audio System

Audio handling is critical for retro gaming experience and requires careful optimization for mobile browsers.

Browser Audio Context

Modern browsers require user interaction before playing audio. The platform initializes AudioContext early and handles resume events to ensure audio plays correctly across all browsers.

Mobile Audio Optimization

  • Samsung Browser: 256ms latency (both orientations)
  • Chrome Mobile: 192ms portrait, 256ms landscape
  • iOS Safari: Special handling for audio context suspension
  • Audio Sync Disabled: Prevents lag on mobile devices

API Reference

The platform exposes RESTful APIs for integration and management.

Game APIs

EndpointMethodDescription
/api/tournament/currentGETCurrent featured game with rotation info
/api/current-romGETROM path for current game
/api/scan-romsGETList available ROM files

User APIs

EndpointMethodDescription
/api/register-userPOSTRegister or update user
/api/player/:userIdGETGet player data
/api/leaderboardGETGet all participants

Multiplayer APIs

EndpointMethodDescription
/api/multiplayer/roomsGETList active rooms
/api/multiplayer/create-roomPOSTCreate multiplayer room
/api/multiplayer/join-roomPOSTJoin existing room

Security

The platform implements multiple security layers to protect users and prevent abuse.

Security Measures

  • Rate Limiting: express-rate-limit middleware prevents abuse
  • CORS: Configured for specific allowed origins
  • Helmet: Security headers for common vulnerabilities
  • Input Sanitization: DOMPurify for user-generated content
  • Parameterized Queries: SQL injection prevention
  • File Validation: Type and size checks for uploads

Authentication Model

The platform uses platform-native identity (Telegram ID, Discord ID) rather than custom authentication. This eliminates password management while leveraging the security of established platforms. Anonymous users receive generated identifiers for session tracking.