Steal This Fucking Source Code โ Because gaming deserves better.
v0.3.5 Alpha โ
The gaming industry has a problem. Bloated engines. Lazy optimization. "Good enough" performance. The result? Games that stutter, overheat devices, and frustrate players into piracy. STFSC exists because optimization and attention to detail shouldn't be optionalโthey should be the foundation.
This engine is built from the ground up for one audacious goal: open-world gaming on standalone VR hardware, pushing the Quest 3's 2.4 TFLOPS to its absolute limits.
"They said it couldn't be done. We're doing it anyway."
STFSC is being shaped for ambitious open-world games that need smooth simulation under pressure. The near-term engine target is Twilight, a Rust/Minecraft-like survival sandbox with seeded procedural worlds, object-based building, day/night danger, survival play, and god-mode creation tools.
The engine still keeps its 556-class goals: dense city streaming, vehicles, crowds, multiplayer-ready architecture, and standalone VR performance. Sandbox support is an added optimization profile, not a narrowing of the engine.
- Parallel Render Prep: Frustum culling, matrix math, and instancing batching now distributed across all CPU cores.
- Physics-to-ECS Sync: Multi-threaded updates from Rapier3D back to world transforms.
- Parallel AI Logic: High-density NPC (CrowdAgent) and Vehicle AI processed in parallel.
- Thread-safe Streaming: Procedural city chunk generation is multi-threaded for stutter-free travel.
- Full Undo/Redo System: All major operations (spawn, delete, move, properties) are tracked and reversible.
- Persistent Asset Pipeline: Automatic texture ingestion into
assets/textures/for project portability. - Real-time Material Sync: Instant inspection/tweaking of PBR properties and textures on Quest 3 without re-spawning.
- Missing Asset Diagnostics: Built-in warnings for missing project files with easy re-linking guidance.
- Parallel Viewport Prep: Smooth editor UI performance via multi-threaded viewport projection math.
- Seeded Chunk Planning: deterministic sandbox chunk plans for trees, resources, mobs, and build budgets.
- Survival/God Mode Rules: project metadata can distinguish resource-constrained survival from free-building creative play.
- Day/Night Runtime Clock: sandbox-aware clock hooks for hostile night spawning, lighting, and scripts.
- Parallel Planning Windows: chunk plan generation uses Rayon so wide sandbox worlds can stream without blocking the frame.
- Vulkan-based renderer with multiview stereo rendering
- PBR lighting pipeline with shadow mapping (PCF soft shadows)
- Reversed-Z depth buffer for maximum precision on large world scales (556 Downtown scale)
- Application Space Warp (AppSW) support for 36fpsโ72Hz upscaling
- Dynamic Lights (Point, Spot, Directional) with PCF Shadows and parallel UBO updates
- Instanced rendering with batched draw calls
- Rapier3D integration for high-performance rigid body dynamics
- Collision detection with scriptable event callbacks
- Static & dynamic bodies with configurable shapes
- 3D Spatial Audio with distance attenuation
- Multiple attenuation models (Inverse, Linear, Exponential)
- Streaming audio support for ambient sounds
- Native Rust scripting via
FuckScripttrait - Lifecycle hooks:
on_start,on_update,on_enable,on_disable - Fixed/late update hooks for physics-step logic and post-update pose following
- Collision callbacks:
on_collision_start,on_collision_end,on_trigger_start - XR callbacks and helpers: HMD/controller poses, abstract actions, edge events, and haptic requests through
ScriptContext - Built-in scripts: CrowdAgent, PoliceAgent, TrafficAI, VehicleAI, WeaponNPC, HeadAnchor, LeftHandAnchor, RightHandAnchor, TriggerHaptics
- Entity Component System (ECS) via
hecs - Runtime Task Graph for dependency-aware parallel frame work across simulation, physics, render prep, streaming, networking, and maintenance systems
- Frame Budget Pressure Controls for deferring non-critical jobs when a platform is close to missing frame time
- Platform-tuned async runtime so desktop and standalone VR builds size networking/blocking worker pools from the same concurrency profile
- LOD system with distance-based mesh switching
- Async Resource Loading for background mesh uploads (No ANRs)
| Component | Technology |
|---|---|
| Language | Rust ๐ฆ |
| Graphics API | Vulkan 1.1+ |
| XR Runtime | OpenXR |
| Physics | Rapier3D |
| Parallelism | Rayon |
| ECS | hecs |
| Target Platform | Meta Quest 3 / Quest 3S |
- Rust toolchain with
aarch64-linux-androidtarget - Android NDK
cargo-apkfor APK packaging
# Debug build
cargo build --target aarch64-linux-android
# Release build
cargo build --target aarch64-linux-android --release
# Package APK
cargo apk build --releaseadb install -r target/release/apk/stfsc_engine.apk
adb shell am start -n com.stfsc.engine/android.app.NativeActivityFor development and testing without a Quest headset:
cargo runThat's it! The Linux client provides a windowed preview with WASD + mouse controls for rapid iteration.
- Start the engine on Quest (or Linux desktop)
- Run the editor on your development machine:
cargo run --bin editor
- Connect via ADB port forwarding (Quest) or localhost (Linux):
adb forward tcp:8080 tcp:8080
- Deploy scenes in real-time!
| Metric | Target | Status |
|---|---|---|
| Frame Rate | 72 Hz (36 fps + AppSW) | โ Achieved |
| GPU Utilization | <80% | โ ~18% idle scene |
| Memory Budget | <500 MB | โ ~115 MB |
| Draw Calls | Batched/Instanced | โ Implemented |
| Stale Frames | 0 | โ Achieved |
- Dynamic lighting & 3D Audio
- Parallel Resource Loading
- Physics integration (Rapier3D)
- NPC AI framework (FuckScript)
- Full Parallel Core (Rendering, Physics Sync, AI)
- Undo/Redo System for Editor
- Robust Asset Persistence (Local textures, Search fallbacks)
- Real-time Material live-sync
- Persistent sandbox save/load state
- Object-based building placement and stability hooks
- Resource inventory and crafting interfaces
- Mob spawn scheduler and night threat director
- Navmesh/pathfinding support for mobs and NPCs
- Multiplayer netcode foundation
- GPU-side occlusion culling (Hi-Z)
- Compressed texture streaming (KTX2/ASTC)
- Complete open-world streaming for sandbox and city profiles
- Full multiplayer gameplay foundation
- Performance parity with consoles
Steal this fucking source code. Seriously.
If you're building a game and struggling with VR performance, take what you need. Learn from it. Improve on it. The goal isn't to hoard knowledgeโit's to prove that optimized, ambitious games are possible on mobile VR.
Piracy exists because players don't feel games are worth the price. The solution isn't more DRMโit's making games so good, so polished, so clearly crafted with care that players want to support them.
This project is provided as-is for educational and development purposes. See individual file headers for specific licensing where applicable.
Built with obsessive optimization for standalone VR gaming.
STFSC Engine โ Steal This Fucking Source Code