Overview
WPM Typing Tutor is built using Unity 2019.4.41f2 LTS and compiled to WebGL for browser-based gameplay. This page covers the Unity project structure, build settings, and WebGL configuration used in the game.Unity Version: 2019.4.41f2 LTSTarget Platform: WebGL (browsers)Company: DefaultCompanyProduct Name: mecanografia
Unity Project Information
The game is configured with the following project settings:Build Configuration
The project is currently set to
developmentBuild: true, which enables console logging and debugging features. For production deployments, consider setting this to false.WebGL Build Configuration
Graphics API Support
The game supports both modern and legacy WebGL implementations:- WebGL 2.0
- WebGL 1.0
Primary graphics API with better performance and features. Supported by:
- Chrome 56+
- Firefox 51+
- Edge 79+
- Safari 15+
GraphicsAPI Configuration
Build Artifacts
The Unity build process generates the following files:INTEGRADORA.json
Size: ~530 bytesMain configuration file containing build metadata, Unity version, and loader settings. This file is loaded first by
UnityLoader.js to initialize the game.INTEGRADORA.data.unityweb
Size: ~5.5 MB (compressed)Contains game assets including:
- Scenes and scene data
- Sprites and textures
- Audio files
- Text assets and levels
- Resource files
INTEGRADORA.wasm.code.unityweb
Size: ~14.6 MB (compressed)WebAssembly code module containing:
- Compiled C# scripts
- Unity engine runtime
- Game logic and mechanics
- Physics and rendering systems
UnityLoader System
The Unity WebGL loader handles game initialization, asset loading, and browser compatibility checking.Compression Support
UnityLoader includes built-in decompression for:Loading Process
Initialize UnityLoader
The
UnityLoader.js script is loaded first, providing the core loading functionality.Download & Decompress
UnityLoader downloads and decompresses the
.unityweb files:- Detects compression type (Gzip/Brotli/none)
- Downloads files asynchronously
- Decompresses using Web Workers
- Reports progress to callback
Initialize WebGL Context
Creates the WebGL context with specified attributes:
- Selects WebGL 2.0 or 1.0 based on browser support
- Initializes canvas element
- Sets up rendering context
Browser Compatibility
System Requirements
- Supported Browsers
- Not Supported
Fully Supported:
- Chrome 56+ (recommended)
- Firefox 51+
- Edge 79+
- Safari 15+
- Safari 10.1-14.x (WebGL 1.0 only)
- Older Firefox/Chrome versions (performance issues)
Compatibility Checking
UnityLoader includes automatic compatibility detection:Compatibility Detection
The loader displays user-friendly error messages if the browser doesn’t meet requirements, with suggestions to upgrade or switch browsers.
Development vs Production
Development Build
The current configuration uses a development build:- Console logging and debug output
- Unity Profiler support
- Symbol information for debugging
- Unoptimized code for faster iteration
Production Build Recommendations
For production deployment, modify the build configuration:Enable Code Optimization
Set code optimization to “Master” or “Release” in build settings for:
- Smaller file sizes
- Better performance
- No debug symbols
Configure Compression
Choose compression method in Unity Player Settings:
- Brotli: Best compression (~30% better than Gzip)
- Gzip: Good compatibility, decent compression
- Disabled: Fastest loading but largest files
Error Handling
Common Build Errors
WebGL not supported
WebGL not supported
Error: Browser does not support WebGLSolution:
- Upgrade to a modern browser
- Enable hardware acceleration
- Update graphics drivers
- Check if WebGL is disabled in browser settings
Out of memory
Out of memory
Error: Cannot allocate enough memory for WebGL contentSolution:
- Close other browser tabs
- Restart browser
- Reduce WebGL memory allocation in Unity Player Settings
- Use a 64-bit browser
Failed to download
Failed to download
Error: Failed to download .unityweb filesSolution:
- Check network connection
- Verify server is running and accessible
- Check CORS headers on server
- Verify file paths in INTEGRADORA.json
Decompression failed
Decompression failed
Error: Failed to decompress build filesSolution:
- Verify files are not corrupted
- Check server compression settings
- Ensure Unity build completed successfully
- Try different compression method (Gzip vs Brotli)
Performance Optimization
Loading Performance
Enable Compression
Use Brotli compression for ~30% smaller files than Gzip. Configure in Unity WebGL Player Settings.
Server Configuration
Configure your web server to:
- Serve .unityweb files pre-compressed
- Set proper MIME types
- Enable HTTP/2 for parallel loading
- Use CDN for global distribution
Code Stripping
Enable “Strip Engine Code” in Player Settings to remove unused Unity engine features and reduce build size.
Asset Optimization
Optimize game assets:
- Compress textures
- Use sprite atlases
- Reduce audio quality for non-critical sounds
- Remove unused assets
Runtime Performance
Performance Tips
Next Steps
React Native Integration
Learn how the mobile app integrates Unity WebGL
Deployment Guide
Deploy the game to production hosting
React Native Setup
Configure mobile development environment
Platform Overview
Learn about web platform features