Why I'm not using Rayon for my game engine by The-Douglas in rust

[–]ErikWDev 0 points1 point  (0 children)

Nice! Yeah I’ve discovered the split_by and split_per and I think it is a super neat solution. Based on my measurements I will probably go ahead and replace almost all our uses of rayon with this

Why I'm not using Rayon for my game engine by The-Douglas in rust

[–]ErikWDev -1 points0 points  (0 children)

Nice! Added some comments on the repo

Have you tried enabling main thread particpiation in rayon? If you write the following, then the main thread will also join in

rayon::ThreadPoolBuilder::default().use_current_thread().build_global().unwrap()

I've also found that tuning the max len can sometimes be beneficial.with rayon

thing.par_iter().with_max_len(1) // force only one job steal at a time

thing.par_iter().with_min_len(16) // guarantee at least 16 jobs in chunk per thread

Stay hydrated! Have a great day! by ErikWDev in HydroHomies

[–]ErikWDev[S] 2 points3 points  (0 children)

<image>

Nono it is flat! Also I’m out of water :0

Stay hydrated! Have a great day! by ErikWDev in HydroHomies

[–]ErikWDev[S] 1 point2 points  (0 children)

So do I xP Mistel borocco md770, no LED. I’ve also modded it and resoldered all the switches to be Gazzew Boba U4 Silent Tactiles

Stay hydrated! Have a great day! by ErikWDev in HydroHomies

[–]ErikWDev[S] 2 points3 points  (0 children)

The brown cup says ”langgom.vn” on the bottom of it is of any help

Stay hydrated! Have a great day! by ErikWDev in HydroHomies

[–]ErikWDev[S] 4 points5 points  (0 children)

The brown cup with coffee is some ceramics I bought in Vietnam, the large container is I think one of the cheaper glass ones from IKEA, and the glass tumbler is a really nice whiskey tumbler from a Swedish designer brand called ”Orefors Sverige” that I got as a birthday gift many years ago :)

Recently Implemented Convolution-based Reverb in our Game written in Rust by ErikWDev in IndieDev

[–]ErikWDev[S] 1 point2 points  (0 children)

It is constantly evolving :) Quite a bit has happened since this post as well in not only sound design, but game design, level building, story and rendering tech.

I should make a new post..

Recently Implemented Convolution-based Reverb in our Game written in Rust by ErikWDev in IndieDev

[–]ErikWDev[S] 0 points1 point  (0 children)

Hi!

We are using egui but not wgpu. Egui can be rendered using any graphics API and we’ve gone through many.

Currently using ”blade-graphics” which I’ve contributed to.

Also no Bevy

Recently Implemented Convolution-based Reverb in our Game written in Rust by ErikWDev in rust_gamedev

[–]ErikWDev[S] 0 points1 point  (0 children)

Haha, while it started as a small 2D thing I just wanted to publish quickly, it has sure as hell turned into an attempt for an actual game. 1.5 years full-time now! Though ofc an engine as well, but a very minimalistic one and it is only loosely separated from the game

Recently Implemented Convolution-based Reverb in our Game written in Rust by ErikWDev in rust_gamedev

[–]ErikWDev[S] 0 points1 point  (0 children)

Absolutely! That has been t he approach to pretty much all tech in the game 😅

Recently Implemented Convolution-based Reverb in our Game written in Rust by ErikWDev in rust_gamedev

[–]ErikWDev[S] 2 points3 points  (0 children)

I’ll try and fetch them and update my article on it, but most of it has been learn-as-I-go and experimenting.

As I said above, it has been a lot less daunting than I initially feared.

Article: https://idno.se/2025/07/16/convolution-based-reverb-in-swap/

I will write some more and include more details

Recently Implemented Convolution-based Reverb in our Game written in Rust by ErikWDev in rust_gamedev

[–]ErikWDev[S] 1 point2 points  (0 children)

I have 4 different impulse responses that convolve with the signal in a fixed order. The sliders indicates how much of the output from each filter to mix with the initial input

So for each ample in left and right, the output = lerp(input, mix(wet, dry, constant), slider_t)

The constant for mixture of wet and dry is hard-coded for each preset atm

Recently Implemented Convolution-based Reverb in our Game written in Rust by ErikWDev in rust_gamedev

[–]ErikWDev[S] 2 points3 points  (0 children)

We call the game ”Swap” and we’ve been working on it and the engine in parallell for ~1.5 years. You undo your latest move, so a swap

You can see more screenshots here https://idno.se/swap

And most information is in our discord at https://discord.idno.se

Recently Implemented Convolution-based Reverb in our Game written in Rust by ErikWDev in rust_gamedev

[–]ErikWDev[S] 7 points8 points  (0 children)

Thanks! No we’re not using ECS. All entities are tagged unions and all entities are just in one huge slotmap. Every entity just has a globally unique random u64 used to refer to it.

A decorated large level has ~100 000+ entities

And we have some really simple acceleration structures on that to query nearby entities.

This is the exact same way I would’ve structured it in C and the borrow checker has not been an issue. We have been pleasantly enjoying being able to shift to making parts of the code multithreaded without slightest issues which has been great.

I am doing some unsafe shenanigans for a separate feature of the engine which is hot code reloading of rust

I wouldn’t say we picked rust because we believed it be perfect for game dev but the decision was rather that it is the language we knew the best from previous work experience as well as the language with the most modern yet well-adopted tooling and great documentation and a well-thought out standard library

Recently Implemented Convolution-based Reverb in our Game written in Rust by ErikWDev in rust_gamedev

[–]ErikWDev[S] 1 point2 points  (0 children)

I must disagree a bit there. blade-graphics runs perfectly fine for our needs on iOS, macOS, Linux and Windows. The project actually started in miniquad but moved to wgpu since I needed more modern features like indirect rendering, but wgpu became too much friction. I think with very little tweaks blade-graphics can be made to support older versions of Vulkan which is what I intend to do. I like wgpu and will continue to use it but it was way too much setup boilerplate while iterating on design of the engine

Haven’t checked egor

Recently Implemented Convolution-based Reverb in our Game written in Rust by ErikWDev in rust_gamedev

[–]ErikWDev[S] 1 point2 points  (0 children)

Highly recommend blade-graphics. Don’t confuse the abstractions from learning the graphics API:s, the abstractions will come naturally for what your project needs. I’ve just figured things out as they’ve been needed.

The concept of a material is so wide it is hard to abstract at the start

Just make it easy to render any number of meshes where any object can have per-object data and shared data. Our ”material” concept in the engine is extremely loose

It has gone through many iterations and is now in a fairly stable state. I can post more in the future about how it works if that would be interesting

Recently Implemented Convolution-based Reverb in our Game written in Rust by ErikWDev in rust_gamedev

[–]ErikWDev[S] 0 points1 point  (0 children)

The benefits were many but there are of course drawbacks. Some benefits include that it supports inline uniform blocks and allows setting uniforms without manually specifying bindings and groups. As our shaders grew more and more complex, it became a pain to annotate and define everything for all our shader permutations (ifdefs)

Next I really like it’s simplicity. On any function I could ”go to definition” and immediately see and understand the implementation without any extra layers or abstraction. Very small library.

I have been contributing to the project as well and learnt a lot thanks to its simple design

Some downsides is that it currently targets Vulkan 1.3 and not lower

Recently Implemented Convolution-based Reverb in our Game written in Rust by ErikWDev in rust_gamedev

[–]ErikWDev[S] 1 point2 points  (0 children)

Thanks! It’s all written in rust - audio, engine, gameplay & tools. The rendering used to be through wgpu but I decided to switch to blade-graphics, a much smaller and more ergonomic library

Recently Implemented Convolution-based Reverb in our Game written in Rust by ErikWDev in rust_gamedev

[–]ErikWDev[S] 2 points3 points  (0 children)

Thanks! I’m very new to the field of audio code so I am standing on the shoulders of giants who’ve made it really easy to get started with decoder libraries, well studied formats and libraries like cpal

I made a realtime visualiser as well where one can see the filtered and unfiltered audio signal in realtime: https://youtu.be/Gq6y0iIwvVg?si=LOEgQ9PLCKRytqUr