r/rust_gamedev • • 20h ago

Fog and rope physics in my Rust 2D engine

45 Upvotes

Finally happy with how the fog and rope physics are handled in the game I've been working on, it's built with Rust and wgpu. The fluids use a 2D stable fluids solver in WGSL, and ropes use Verlet integration w/ fixed length links. Would love to hear what you think :)


r/rust_gamedev • • 16h ago

question What exactly happened to LogLog Games?

8 Upvotes

For those who don't know LogLog Games article "Leaving Rust Gamedev"

I'm not a Rust expert; I come from the C++ world. I know the basics of compilers, but I don't understand much of the technical language used in the article.

How is it that they write over 100,000 lines of Rust code and then abandon all that technology for the "greater" iteration offered by C#?.

This makes me doubt whether game development with Rust is worthwhile. Rust has been around for over a decade and I still haven't seen a "Greatest Hit" game; the only somewhat popular project I've come across is Veloren and yet its development remains quite slow, the development of the Bevy Engine is also proving incredibly slow, I know that open-source projects usually progress slowly, but Godot Engine uses C++ and I've seen many more iterations faster than Bevy, even though they have almost the same popularity.

My question is, can ambitious games be made without Rust's friction killing you along the way? Are LogLog Games complaints justified, or are they just excuses to blame the tool instead of themselves?.


r/rust_gamedev • • 50m ago

oxijolt update: prebuilt binaries, wasm32 and batch body ops (safe Jolt Physics bindings for Rust)

1 Upvotes

A month and a half ago I posted oxijolt 1.0 here, safe Rust bindings to Jolt Physics 5.6. Since then it got six minor releases, so a short update on what changed.

Prebuilt binaries. The biggest practical one. Until now the crate compiled Jolt from source, which meant CMake and a C++ toolchain on every machine. Since 1.2 the build script downloads a prebuilt static library for your target and checks it against a sha256 recorded in the crate. Falls back to building from source if nothing matches. Windows (MSVC), Linux (glibc 2.35+), macOS (aarch64).

wasm32. As of 1.6 there is a prebuilt target for wasm32-unknown-unknown, so browser builds work without a local emscripten dance. This was the most requested thing after 1.0.

Batch body operations. Creating or removing bodies one by one takes a broad-phase update per body. New add_bodies / remove_bodies do it in one batch with a single broad-phase subtree build, in deterministic id order. Plus create_body_detached if you want to prepare bodies before they enter the world.

Live character tuning. CharacterMut can now change settings on a live character (mass, slope angle, shape, supporting volume and more) without recreating it and losing contacts and ids. set_shape even tests whether the new shape fits and refuses if it does not.

Queries. cast_ray_all and cast_shape_all return every hit sorted by fraction, not just the closest one. QueryFilter::body_filter takes a closure over BodyId, so you can filter bodies inline in any query.

Plus a pile of smaller things: deactivate_bodies (put a list of bodies to sleep in one call), Shape::mass_properties, Shape::local_bounds, active_body_states for reading all awake bodies under one lock.

Everything keeps the same rules as 1.0: every call validates its inputs, errors change nothing, and the determinism tests still pass bit for bit across thread counts.

Where it runs in practice: my minesweeper-on-a-living-sea game (posted here earlier) uses oxijolt in the browser build, buoyancy and all, on wasm32. Playable at https://pockerhead.github.io/rune-minesweeper/, source at https://github.com/pockerhead/rune-minesweeper

And a teaser: I'm building a showcase game around the library, a city sandbox with destructible buildings (video attached, that's real Jolt debris, not baked animation). The destruction and buoyancy systems from it will ship as a Bevy plugin, fully open source on GitHub.

Crate: https://crates.io/crates/oxijolt Repo: https://github.com/pockerhead/oxijolt

If you tried it after the 1.0 post, I'd like to hear what broke or what is missing. The issue tracker is open and half of these features came from it.


r/rust_gamedev • • 16h ago

My AI agents passed every check while the water was broken: a retrospective from my space-frontier adventure sim (Rust + Bevy)

Post image
0 Upvotes

I build my space-frontier adventure sim mostly through a pipeline of AI agents. I write the tasks, they write the code, I look at the frames and decide. Most of the time it works. This week the frames were the only part of the pipeline that told the truth.

I started on visuals and went to polish the water. I went under to see it myself. At -52 m the star dome was right above me and the "atmosphere" sat under my feet. Underwater the game had switched the sky off. Not dimmed or tinted, just gone, with space and stars above me.

The code behind that answered one question: is the camera in water or in air? At the surface it was right every time. At -52 m it answered "air".

Green checks, broken water

Every automated check was green. The water in the game was broken: milky white from some angles, invisible when the camera skimmed the surface, foam too thick.

The cause sat in the foundation. The code that tells the camera where the ground is treated the planet as a flat plane. In a game about round planets. The error was about half a chunk of terrain across.

The first fix held for 1.5-2 m below the water line, then flipped back.

The auto-checks missed it because they rendered water from one angle only. Nobody looked straight down at a river, at a lake, or at a beach from the side.

My favorite part: one agent's self-check pointed at an environment variable that nothing in the code reads. It reported success for a setting that had no effect. The next agent, who actually read the code, admitted it.

To be fair, the agents reproduced my bug report pose exactly: camera 0.32 m above the seabed. Then it turned out my own screenshot was taken with collision off, about a meter inside the ground. The pose was accurate. The floor was not.

The bill

One QA agent burned about 700M tokens on this epic. Useful output: roughly 0.25%. One piece of it alone took 507 calls at ~292k average context, 148M tokens. I pulled that agent off QA.

The fix was smaller than the bug

The real fix did not build a better way to decide whether the camera is underwater. It removed the need for one.

The atmosphere is drawn from an origin point. Underwater that point sat inside the planet and the sky went out. Now any origin between half the planet radius and the radius gets pushed back onto the surface:

p = p * (R + 0.001) / |p| for 0.5R <= |p| < R

Five places in the shaders, plus one CPU copy of the same rule. No new state that says "this camera is underwater now".

After the fix: before/after frames at -49, -141 and -135 m on two planets. A full scan of the planet floor (237,000 chunks) found water at -143.28 m, which my manual check in 8 directions never found.

Still broken

The underwater atmosphere is rebuilt and waits for me to look at three frames. The water shader gets rewritten from scratch after that. The ground check, the flat planet one, is still broken. Separate task.

Green means the checks I wrote passed. Nothing about how the game actually runs. I still look at the frames myself

Screenshot from the lagoon level with the debug grid, water is transparent now:

Devlog with frames and numbers: https://x.com/HeadPocker40580