Inspiration
I was inspired by the gap between console-quality soccer games and what's possible in a web browser. While games like FIFA dominate consoles, there's no truly multiplayer 3D soccer experience that runs instantly in a browser with no downloads. I wanted to prove that Web technologies—specifically WebGL via Three.js—could deliver an immersive, competitive multiplayer experience with real physics, voice chat, and live matchmaking. The vision was to create something that feels like a broadcast presentation of a real match, not just a mini-game.
What it does
GOAL JOY is a browser-based 3D multiplayer soccer game that delivers a console-quality experience without any downloads. Players can:
Create and Join Matches: Start private rooms with shareable 6-character codes or use quick-match to find opponents instantly Play Real Soccer: Control players with realistic physics including sprinting, passing, shooting, heading, and defensive tackles Experience Live Matches: Watch games unfold with broadcast-style presentation featuring crowd reactions, stadium atmosphere, and professional camera angles Communicate via Voice Chat: Use built-in WebRTC voice chat to coordinate with teammates in real-time Compete in Ranked Seasons: Track progress through ranked sprints, squad nights, and creator cups with Elo-based matchmaking Customize Experience: Purchase VIP bundles, unlock cosmetics, and choose from 8 team kits with different patterns Earn Rewards: Complete daily challenges, earn in-game currency, and unlock premium features Record and Share: Capture gameplay footage and screenshots to share with friends The game runs entirely in the browser using WebGL for 3D rendering, with a Node.js backend handling real-time multiplayer synchronization via Socket.io and Redis for state management.
How we built it
I built GOAL JOY as a TypeScript monorepo with three main packages:
Shared Layer (@goaljoy/shared): Contains all TypeScript types, physics constants, and the ball/player physics engine. The physics uses a three-phase acceleration model: $$ v(t) = v_{walk} + (v_{sprint} - v_{walk}) \cdot \min(1, \frac{t}{t_{ramp}}) $$ where players ramp from walk to sprint speed over a realistic duration.
Client (@goaljoy/client): Built with Three.js + Vite, featuring:
2,000+ GPU-instanced crowd members with 6 pose variants and shader-driven reactions Multi-octave grass shader with distance fade and wear patterns Post-processing pipeline (SMAA, Bloom, Color-grade, Vignette, Film grain) WebRTC voice chat with STUN servers AdSense integration with fallback house ads Screen recording and screenshot capture Server (@goaljoy/server): Node.js + Socket.io + Redis backend with:
Room-based matchmaking with private and quick-match modes PayPal payment integration for VIP features Profile persistence and cosmetics store Health monitoring and rate limiting Regional deployment on Fly.io
Challenges we ran into
The biggest challenges were:
Multiplayer Synchronization: Getting ball position sync smooth across two browser tabs took multiple iterations. I implemented delta compression where only changed properties are sent, reducing bandwidth significantly: $$ \Delta = { (id, \partial P_1), (id, \partial P_2), \dots } $$ where ( \partial P_i ) represents only the changed properties of entity ( i ). Mobile Performance: The 3D scene initially overwhelmed mobile devices. I implemented adaptive quality tiers that automatically adjust crowd count, shadow resolution, and pixel budget based on device memory and GPU score. Reconnect Logic: Players losing connection for >30 seconds would get permanently stuck. I fixed this by implementing proper session tokens in Redis indexed by session:{token} for O(1) lookups and adding exponential backoff with clear failure states. Ad Integration: Balancing monetization with gameplay was tricky. I implemented smart ad placement—commercial breaks only after match completion, never during active gameplay—and fallback house ads when AdSense is blocked. Voice Chat Quality: WebRTC voice chat had initial quality issues. I added adaptive bitrate codecs, noise suppression, and proper peer connection management with TURN servers for NAT traversal.
Accomplishments that we're proud of
36,000+ Lines of TypeScript: Built a production-grade monorepo with shared types, physics engine, client rendering, and server logic—all type-safe and well-tested Real-time Multiplayer: Achieved smooth ball/player synchronization across browser tabs with delta compression reducing bandwidth by 60-80% 3D Graphics Engine: Created a custom Three.js scene with 2,000+ GPU-instanced crowd members, multi-octave grass shaders, and post-processing pipeline (SMAA, Bloom, Color-grade) Adaptive Performance: Implemented device-aware quality scaling that automatically adjusts graphics settings based on GPU memory and capabilities Voice Chat Integration: Built WebRTC-based voice communication with STUN/TURN servers for NAT traversal Payment System: Integrated PayPal for VIP purchases with proper verification and entitlement issuance Mobile QA: Developed automated mobile testing harness that verified functionality across 26 device configurations Production Deployment: Established isolated release workflow with Vercel for frontend and Fly.io for backend, including proper security headers and CSP Comprehensive Testing: Created 75+ unit tests with 94.9% pass rate, plus integration tests for the full multiplayer flow Internationalization: Support for multiple languages including Arabic with proper RTL layout and numeral system options
What we learned
Building GOAL JOY taught me several critical lessons:
WebGL Performance: Optimizing for 36,000+ lines of TypeScript across client/server/shared taught me that render targets, pixel ratios, and GPU instancing matter immensely. I learned to balance visual fidelity with frame rates, implementing adaptive quality tiers that scale from 2.1M to 8.3M pixels based on device capabilities. Networked Physics: Implementing authoritative server physics with client-side prediction was eye-opening. The three-phase acceleration model for player movement and delta snapshot encoding reduced bandwidth by $$ 60-80% $$ compared to full snapshots. Real-time Architecture: Socket.io + Redis for state synchronization taught me about session tokens for O(1) reconnects, rate limiting per IP, and graceful degradation when Redis is slow or unavailable. Monorepo Structure: Organizing 36,000+ lines into shared types, physics constants, client rendering, and server logic made the codebase maintainable and type-safe across boundaries.
What's next for GOAL JOY
WebGL Optimization: Learned that render target pixel ratios and GPU instancing are critical for performance. We implemented adaptive quality tiers that scale from 2.1M to 8.3M pixels based on device score. Networked Physics: Discovered that authoritative server physics with client-side prediction is essential for fair gameplay. The three-phase acceleration model and delta encoding were key to smooth multiplayer. State Management: Redis connection pooling and session token indexing (O(1) lookups) were crucial for handling reconnections gracefully under load. Monorepo Benefits: Shared types and physics constants across client/server eliminated boundary bugs and made refactoring safer. Mobile First Performance: Mobile devices required aggressive optimization—crowd count reduction, shadow quality scaling, and memory leak prevention. Ad Balance: Learned that ad placement timing matters—commercial breaks only after matches, never during active gameplay, resulted in better user experience. Voice Chat Complexity: WebRTC requires proper STUN/TURN server configuration, codec selection, and peer connection management for reliable audio. Testing Automation: Playwright-based integration tests caught critical bugs (like the Start button crash) that manual testing missed. Security Headers: CSP, X-Frame-Options, and other security headers are essential for production web applications. Deployment Isolation: Separating preview and production builds with verification steps prevented deploying untested code. What's next for GOAL JOY Based on the post-launch roadmap, here are the planned improvements:
Immediate Priorities:
Connection Pooling: Implement Redis connection pooling and circuit breakers to handle 100+ concurrent matchmaking requests without 500 errors Advanced Matchmaking: Add Elo-based ranking system and skill-aware matchmaking for balanced competitive play Enhanced Voice Chat: Improve audio quality with noise suppression, echo cancellation, and adaptive bitrate codecs Gameplay Features:
Additional Game Modes: Implement 1v1 duels, club leagues, and tournament modes Tactical System: Add formation changes (4-4-2, 4-3-3, 3-5-2, 5-3-2) and in-game tactics (attacking, defensive, counter) Replay System: Full match recording with camera controls and playback options Training Mode: Practice drills and skill challenges for solo players Technical Improvements:
Performance Profiling: Implement comprehensive metrics and monitoring for production debugging Mobile App: Native iOS and Android applications using React Native or similar frameworks AI Opponents: Add bot players for offline practice and filling incomplete matches Spectator Mode: Allow friends to watch live matches with dedicated spectator camera angles Monetization & Social:
Battle Pass: Seasonal progression system with exclusive rewards Clubs & Guilds: Team management and club competitions Tournament Hosting: User-created tournaments with entry fees and prize pools Social Features: Friend lists, messaging, and social media integration The roadmap prioritizes scalability and stability first, then expands gameplay depth and social features to build a long-term competitive community.
Log in or sign up for Devpost to join the conversation.