A lightweight sandbox sim written in Rust.

Overview

Rusty Sandbox

A lightweight sandbox sim written in Rust.

Play via Browser (WASM) | Compile by yourself

This is a quick hobby project written to practice three things: Rust, Macroquad and Maths!


Dev Builds

Prerequisites: The Rust Toolchain (stable preferred).

Local Compile (For your architecture)
git clone https://github.com/JSKitty/rusty-sandbox.git && cd rusty-sandbox
cargo run --release
cargo build --release
WASM Compile (For web-based usage like this!)
git clone https://github.com/JSKitty/rusty-sandbox.git && cd rusty-sandbox
rustup target add wasm32-unknown-unknown
cargo build --release --target wasm32-unknown-unknown

Aim / Goals

The primary aims of the project being:

  • Minimalistic codebase: easy to follow, easy to learn from, a 'living' tutorial.
  • Low Dependency: as much written in-house as possible, such as physics algorithms, etc.
  • Lightweight: should compile super fast, and execute super fast by users.
  • Fun: should be pretty fun to play with! Both in code and in user-land.
You might also like...
A JVM written in Rust.

Kate Kate is a JVM written in Rust, it's a passion project that aims to improve my knowledge of systems development and JVM internals. Contributions a

A simple interpreter language written in Rust.

Glang Backstory Hello and welcome to the Glang git repository. Game Slang or in short Glang is a super simple interpreted language written in Rust wit

 ⚡ Fast Web Security Scanner written in Rust based on Lua Scripts 🌖 🦀
⚡ Fast Web Security Scanner written in Rust based on Lua Scripts 🌖 🦀

⚡ Fast Web Security Scanner written in Rust based on Lua Scripts 🌖 🦀

Lua bytecode parser written in Rust using nom, part of metaworm's lua decompiler

luac-parser (中文) lua字节码解析器, 目前支持 lua51, lua53, lua54 这是目前效果最好的lua反编译器 metaworm's luadec 的一部分 可以基于此代码定制你所需的lua字节码解析器,编译成WASM,让metaworm's luadec加载使用,来反编

Freeze.rs is a payload toolkit for bypassing EDRs using suspended processes, direct syscalls written in RUST
Freeze.rs is a payload toolkit for bypassing EDRs using suspended processes, direct syscalls written in RUST

Freeze.rs More Information If you want to learn more about the techniques utilized in this framework, please take a look at SourceZero Blog and the or

Slitter is a C- and Rust-callable slab allocator implemented primarily in Rust, with some C for performance or to avoid unstable Rust features.

Slitter is a less footgunny slab allocator Slitter is a classically structured thread-caching slab allocator that's meant to help write reliable long-

A Rust crate for automatically generating C header files from Rust source file.

Please be aware that this crate is no longer actively maintained, please look into the much more feature rich cbindgen instead. rusty-cheddar rusty-ch

Rust-ffi-guide - A guide for doing FFI using Rust

Using unsafe for Fun and Profit A guide to traversing the FFI boundary between Rust and other languages. A rendered version is available here. This gu

Rust library for build scripts to compile C/C++ code into a Rust library

A library to compile C/C++/assembly into a Rust library/application.

Comments
  • Engine loop scales worse than expected

    Engine loop scales worse than expected

    The engine loop (consisting of both Physics and Rendering) is a fair bit slower than I'd expect with the hardware it runs on, often fully maxing out a CPU core with a decent simulation; I suspect there's a lot of optimisations that could be done to help with this, such as better re-sim protection (perhaps only track 'changed state' particles rather than ALL rendered particles?).

    We could also potentially implement a system to 'deactivate' buried particles, since if a particle is surrounded below (y + 1) or either side (x +/-) then it cannot possibly move, yet is still included within full physics computation.

    And lastly, which is most effective but highly challenging; we could potentially think about multi-threading the engine, but due to it's high reliance on a singular state (how would we be able to simulate two particles at once on two separate threads without a 'desync' in physics determinism?) this may be fairly hard to do.

    Live Task List:

    • [x] Optimise the re-sim protection by only tracking particle state changes.
    • [ ] 'Deactivate' still particles (i.e; unable to move) from the physics loop.
    • [ ] Introduce multi-threading in some form.
    enhancement help wanted 
    opened by JSKitty 2
  • Occasional crashes when resizing window

    Occasional crashes when resizing window

    The sandbox is intended to scale 'on-demand' to how the user shapes their window: adding X/Y coords when the screen exceeds the world space, however, when particles sometimes spill into 'newly-generated' screen space, there can be out-of-bounds panics.

    Likely an issue with the on-demand screen space generation, and likely very easy to fix. (when I'm not dead sleepy). :zzz:

    bug good first issue 
    opened by JSKitty 0
Owner
JSKitty
I make stuff and I meow.
JSKitty
Sol is a lightweight language primarily designed for scripting environments

☀️ Sol A dynamically-typed (for now) and procedural programming language. About Sol is a lightweight language primarily designed for scripting environ

Joshua 3 Jul 25, 2022
Native Ruby extensions written in Rust

Ruru (Rust + Ruby) Native Ruby extensions in Rust Documentation Website Have you ever considered rewriting some parts of your slow Ruby application? J

Dmitry Gritsay 812 Dec 26, 2022
A script language like Python or Lua written in Rust, with exactly the same syntax as Go's.

A script language like Python or Lua written in Rust, with exactly the same syntax as Go's.

null 1.4k Jan 1, 2023
An npm scripts runner written in Rust.

dum replaces npm run. Instead of waiting 200ms for your npm client to start, it will start immediately. ?? You can help the author become a full-time

EGOIST 1.3k Jan 9, 2023
swc is a super-fast compiler written in rust; producing widely-supported javascript from modern standards and typescript.

Make the web (development) faster. SWC (stands for Speedy Web Compiler) is a super-fast TypeScript / JavaScript compiler written in Rust. It's a libra

swc 25.4k Dec 31, 2022
A Web-App written in Rust with Yew, using the same SyntaxHighlighter from Google Code Archive as planetb.ca

PlanetB SyntaxHighlighter About This is a small app, providing static files to have a frontend to format your code so you can paste it with styles to

Christof Weickhardt 2 Dec 14, 2022
A simple Pascal interpreter written in rust.

rascal A simple Pascal interpreter written in rust. Usage Download the latest rascal executable from the release page. Run the executable. rascal.exe

null 47 Dec 7, 2022
My 'Lugli' language compiler for learning purposes, written in rust. 🥰🤠

Lugli language compiler My 'Lugli' language compiler for learning purposes, written in rust. This language is to be a subset for other purposes, for e

Vinicios Lugli 3 Nov 2, 2022
A parser, compiler, and virtual machine evaluator for a minimal subset of Lua; written from scratch in Rust.

lust: Lua in Rust This project implements a parser, compiler, and virtual machine evaluator for a minimal subset of Lua. It is written from scratch in

Phil Eaton 146 Dec 16, 2022
RustPython - A Python Interpreter written in Rust

RustPython A Python-3 (CPython >= 3.9.0) Interpreter written in Rust ?? ?? ?? . Usage Check out our online demo running on WebAssembly. RustPython req

null 13.3k Jan 2, 2023