Good catch on that energy bug, patch is out to the web-game now!
The comment on sound effects has to do the the secondary sound engine in the game.
There is custom system that worked great on windows, but when I started testing the web assembly version of the game it broke.
It adds dynamic sounds for breaking, turning, and wind.
destrodox
Creator of
Recent community posts
Yep! Although I think about it more in terms of a spreadsheet.
Glossing over a bunch of the fine details, it is effectively a 96x96 grid.
Each cell in that grid stores a velocity in x and y, a density of fluid, a gravity variable, and the old density, velocity x and velocity y.
The 100% realistic equations are too complex so instead it is estimated.
We solve for a rough 'force' from density, then the same from velocity.
Then 50 iterations are preformed on the overall grid to solve for all the cell 'pressures'.
The leftover error after all of this is the 'residual' in the performance tab.
Because this is so computationally intense, a smoothing post processing is run to bring it up to the final resolution.
At 8x scaling, the smoothing currently takes about 2x the time as the grid. If I instead increased the grid resolution by 8x, it would increase the time by 64x. The memory requirements would also be problematic for a web game.
From a technical perspective, its all C++, and SDL2. SDL3 is out now, but there are a lot more SDL2 tutorials.
Feel free to ask any additional questions, I should probably make an explainer once the code is re-worked and commented.