Skip to content

necat101/stfsc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

58 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

STFSC Engine

Steal This Fucking Source Code โ€” Because gaming deserves better.

v0.3.5 Alpha โ€”


Why STFSC?

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."


Target Projects

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.


โœจ Features (v0.3.5 Alpha)

๐ŸŽ๏ธ Turbo-Parallelization (Rayon-powered)

  • 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.

๐Ÿ› ๏ธ Professional Editor Workflow

  • 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.

Sandbox/Open-World Foundations

  • 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.

Rendering

  • 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

Physics

  • Rapier3D integration for high-performance rigid body dynamics
  • Collision detection with scriptable event callbacks
  • Static & dynamic bodies with configurable shapes

Audio

  • 3D Spatial Audio with distance attenuation
  • Multiple attenuation models (Inverse, Linear, Exponential)
  • Streaming audio support for ambient sounds

Scripting โ€” "Fuck Script" ๐Ÿ”ฅ

  • Native Rust scripting via FuckScript trait
  • 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

Engine Architecture

  • 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)

๐Ÿ› ๏ธ Tech Stack

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

๐Ÿ“ฆ Building

Prerequisites

  • Rust toolchain with aarch64-linux-android target
  • Android NDK
  • cargo-apk for APK packaging

Build Commands

# Debug build
cargo build --target aarch64-linux-android

# Release build
cargo build --target aarch64-linux-android --release

# Package APK
cargo apk build --release

Deploy to Quest

adb install -r target/release/apk/stfsc_engine.apk
adb shell am start -n com.stfsc.engine/android.app.NativeActivity

๐Ÿ–ฅ๏ธ Linux Desktop Build

For development and testing without a Quest headset:

cargo run

That's it! The Linux client provides a windowed preview with WASD + mouse controls for rapid iteration.


๐ŸŽ›๏ธ Editor Usage

  1. Start the engine on Quest (or Linux desktop)
  2. Run the editor on your development machine:
    cargo run --bin editor
  3. Connect via ADB port forwarding (Quest) or localhost (Linux):
    adb forward tcp:8080 tcp:8080
  4. Deploy scenes in real-time!

๐Ÿ“Š Performance Targets

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

๐Ÿ—บ๏ธ Roadmap

v0.2 - v0.3 โœ…

  • Dynamic lighting & 3D Audio
  • Parallel Resource Loading
  • Physics integration (Rapier3D)
  • NPC AI framework (FuckScript)

v0.3.5 (Turbo Update) โœ…

  • Full Parallel Core (Rendering, Physics Sync, AI)
  • Undo/Redo System for Editor
  • Robust Asset Persistence (Local textures, Search fallbacks)
  • Real-time Material live-sync

v0.4 (Sandbox & Persistence)

  • 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

v0.5 (Connected World)

  • Multiplayer netcode foundation
  • GPU-side occlusion culling (Hi-Z)
  • Compressed texture streaming (KTX2/ASTC)

v1.0 (Open-World Launch)

  • Complete open-world streaming for sandbox and city profiles
  • Full multiplayer gameplay foundation
  • Performance parity with consoles

๐Ÿค Philosophy

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.


๐Ÿ“„ License

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

About

experimental in development 3d game engine for quest 3

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors