Skip to content

Commit

Permalink
add readme to wasm port
Browse files Browse the repository at this point in the history
  • Loading branch information
ading2210 committed May 30, 2024
1 parent ca123ec commit b8a53b9
Showing 1 changed file with 53 additions and 0 deletions.
53 changes: 53 additions & 0 deletions wasm/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# SuperTuxKart WASM Port

Currently this port is still incomplete.

Working features:
- The game launches
- OpenGL ES 2 graphics (GLES 3 doesn't work)
- Audio
- Persistent user data
- Caching data and asset files in IndexedDB

TODO:
- Fix GLES 3 (maybe someone with more experience in webgl could help here)
- Webpage theming
- Better compression for assets
- Lazy load assets during gameplay
- Networking

Caveats:
- The RAM usage is rather high because the assets are always loaded in memory
- The performance isn't great, probably because the legacy renderer is still being used
- There is a large ~700MB download required immediately
- Some options, like anything related to online multiplayer, may hang the game

## Building
1. First, get a copy of the emsdk (it might help to have emscripten already installed with `sudo apt install emscripten`):
```
wasm/get_emsdk.sh
```
2. Compile all the dependencies:
```
wasm/build_deps.sh
```
3. Compile STK:
```
wasm/build.sh
```
4. Bundle the game data and assets:
```
wasm/pack_assets.sh ../stk-assets
```
5. Host a web server:
```
cd wasm/web
python3 ../run_server.py
```

## Project Structure:
- /wasm/build - Files for building the dependencies
- /wasm/prefix - Headers and library files
- /wasm/web - Web server root directory
- /wasm/emsdk - Emscripten SDK
- /wasm/fragments - Patches for emscripten's generated JS

0 comments on commit b8a53b9

Please sign in to comment.