Repository navigation
Ported/refactored the engine and its editors/tools to Rust to get cross-platform runtimes with platform-native functionality and performance. - #86
Merged
Conversation
…w setup so I can take my time cleaning them up.
- Added consistent rust:web scripts for the published examples, FORM LAB, PARTICLE LAB, and Joy Editor, with configurable output directories for hosting sites. - Added a --dev override to the web builder so development servers could reuse release scripts while preserving each application's title and canvas configuration.
- Added reusable save slots that preserved unreadable or rejected data, skipped unchanged writes, and added replacement support. - Fixed browser modifier handling for Shift gestures and platform-specific shortcuts, including Command on Apple devices. - Kept touches that began on UI widgets assigned to the UI throughout the gesture, preventing gameplay input underneath. - Raised the engine and editor tools' minimum Rust version to 1.95 and updated fixed-size slice iteration for newer Clippy checks.
…ow (previously required a separate repository), and added a Claude rule file to tell it to please stop committing on its own. I don't like when robots show initiative.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Rust Runtime Default
Continuous Integration
Cloud Patch Delivery
Fixes
runtime::SaveSlot, which refuses ordinary writes after a failed read or a rejected save until the game explicitly replaces it, so an autosave can no longer overwrite progress that merely failed to load (a valid but unreadable save used to be replaced by a fresh one). See Rust storage.chunks_exactwith a constant size in favor ofas_chunks.Rust Engine
Frame::set_pointer_lockcaptures the cursor (winit's locked grab natively, falling back to confined;requestPointerLockin browsers),InputManager::pointer_motionreports raw relative mouse movement per frame while locked, andInputManager::pointer_lockedreports whether the lock is held, so a game can pause when the browser or window releases it.InputManager::touch_points, every active touch with its id, so on-screen sticks and look pads follow the finger that started on them.Math.tan,Math.acos, andMath.asintocore::js_math.AudioBank::set_master_volume, which scales sounds as they start, for game volume settings; VECTORS TO VICTORY's synthesized sound board is its first consumer.joy-engineRust crate (Cargo.tomlat the root,src/lib.rs), with Rust modules beside the TypeScript in the samesrc/folders and dependency layers, so games and tools run natively and in browsers (WebGPU with WebGL 2 fallback) from one codebase. The TypeScript engine keeps running existing games and tools until they move over.renderingmodule, a wgpu renderer matching the TypeScript frame: Lit, PBR, and Unlit material passes, filtered directional shadows on every backend, point lights, the procedural atmosphere, and the full display-processing chain from the same post-processing profiles. It is the single renderer for games, FORM content (FormAssetLibrary), level presentation (LevelScene), and tools; FORM stays renderer-free.environment,physics(rapier rigid bodies and raycast vehicles),gameplay(entities, controllers, levels, and grid navigation), andformmodules, checked against values recorded from the TypeScript engine, andruntime, aGameShell-style frame-phase runner with input, multi-touch, egui HUDs, a development overlay, and headless runs.scripts/rust/build-web.mjs(npm run rust:web) for static browser builds, aform-viewerexample, Rust layer checks innpm run checkthat reuse the TypeScript layer roots, and the Rust engine guide with parity notes and the migration path.Rust Tools
developmentmodule for FORM LAB, PARTICLE LAB, and Joy Editor: lab controls (exact number fields with scrubbing and Shift/Alt steps, bounded scalars, XYZ/RGBA groups, a linear-RGBA color picker, defaults and resets, rejected-draft tracking), property undo, a script editor with catalog highlighting, completion, hover help, and diagnostics, resizable panes, viewport gestures, native and browser file dialogs (rfd natively), and the Joy design tokens as an egui theme. See Rust authoring kit.particle-labpackage beside its TypeScript, natively and in browsers, drawing only through the engine renderer and hostable in Joy Editor. AddedRegionCamera, particle texture source encoding, runtime particle profiling toggles, andHeadlessShell::step_with_uifor driving tool interfaces in tests.form-labpackage beside its TypeScript, natively and in browsers:.formand.formlabdocuments with variants, the examples library, parameter, material, lighting, and output inspectors, and GLB (byte-identical to the TypeScript exporter), OBJ, PLY, JSON, and MaterialX exports, with the preview drawn by the engine renderer and hostable in Joy Editor. Added JPEG and WebP material maps,FormTextureCache, running-renderer sky and shadow setters, and FORM value validators for tools.joy-editorpackage ineditor/, a native application that replaces the Electron host: project discovery, the content browser, tabs with revision-checked saves, external-edit handling, and recovery copies, session restore, the schema-driven level editor with a move gizmo, and FORM LAB and PARTICLE LAB hosted as tabs throughdevelopment::AuthoringTool. Browser builds open bundled examples read-only. AddedGame::close_requestedso a game or tool can keep its window open for unsaved work.rust:webscripts to the published examples, FORM LAB, PARTICLE LAB, and Joy Editor, so a hosting site builds their Rust pages the same way it builds games (npm run rust:web -- --out <folder>);dist-rust/staging folders are ignored.build-web.mjs --devkeeps a script's title and canvas but builds with the fast dev profile, for development servers.Rust Examples
cargo run --example <name>,npm run rust:web -- --example <name>), each beside its TypeScript version with headless tests and captures intest/rust/. The building draws its FORM materials through the PBR pass, and the shadow-material fixture became a Rust render test.ShiftedCamera(lens shift beside side panels),Stopwatch,save_text_fileexports (Blob downloads in browsers),MeshAsset::from_asset_data, and per-quality tuning forSceneEffectsControls. HUD taps on egui widgets no longer also reach gameplay.