Getting Started

Prerequisites

  • Rust (stable toolchain, 1.85+)
  • wasm-pack for building WASM targets
  • Node.js 18+ and pnpm for website/docs development
  • A WebGPU-capable browser (Chrome 113+, Firefox 121+, Safari 18+, Edge 113+)

Install Tools

# Rust (if not installed)
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

# WASM target
rustup target add wasm32-unknown-unknown

# wasm-pack
cargo install wasm-pack

# pnpm (if not installed)
npm install -g pnpm

# Or use the Makefile
make install-tools

Clone and Build

git clone https://github.com/SiliconGhetto/siliconghetto.git
cd siliconghetto

# Build all crates
cargo build

# Run tests
cargo test

# Check lints
cargo clippy -- -D warnings

Run a Demo

Build a demo for the browser and serve it with cross-origin isolation headers:

# Build the sprite-lab demo
wasm-pack build demos/sprite-lab --target web --out-dir www/pkg

# Serve with required headers
cd demos/sprite-lab/www
python3 -c "
from http.server import HTTPServer, SimpleHTTPRequestHandler
class H(SimpleHTTPRequestHandler):
    def end_headers(self):
        self.send_header('Cross-Origin-Opener-Policy', 'same-origin')
        self.send_header('Cross-Origin-Embedder-Policy', 'require-corp')
        super().end_headers()
HTTPServer(('localhost', 8080), H).serve_forever()
"

Open http://localhost:8080 in your browser. You should see 500 bouncing sprites. Press Space to add more.

Build All Demos

make build-wasm

This builds all four demos (sprite-lab, topdown-prototype, scene3d, stress-lab) as WASM packages.

Project Structure

siliconghetto/
├── crates/           # Engine crates (the core library)
├── demos/            # Browser-playable demo games
├── apps/             # Website and docs (Astro)
├── platform/         # Future platform scaffolding
├── infra/            # Deployment infrastructure
├── docs-content/     # Documentation source (Markdown)
└── Cargo.toml        # Workspace root

Available Demos

DemoDescriptionControls
sprite-lab500+ bouncing sprites with collisionSpace: add sprites
topdown-prototypeTop-down movement with enemiesWASD: move
scene3dLit 3D cube with orbit camera(automatic rotation)
stress-labAuto-scaling performance benchmarkSpace: add entities

Development Workflow

# Format code
cargo fmt

# Check for errors
cargo check

# Run clippy lints
cargo clippy -- -D warnings

# Run tests
cargo test

# Full CI check
make ci

CLI Tool

The sg CLI helps with development tasks:

# Show help
cargo run --bin sg -- --help

# Validate a game manifest
cargo run --bin sg -- validate demos/sprite-lab/sg-game.toml

Next Steps