Engine simulation: programming the genuine sound of wroom

Engineers and tech people often think about “how things work”. Some of them find a nice challenge in solving problems. And some of them actually make something notable. Sometimes I think about making a cool sound synthesizer based on adding sine waves. Which ones you ask? Apply Fourier transform on a sound sample and you get a list of frequencies! Programming a synth based on this is one thing, but making a complete engine simulation is on another level.

need for speed underground 2
Before Eurobeat, we delivered tofu listening to Snoop Dogg or Xzibit

The original goal isn’t replicating instruments or making experimental electronic music, but programming the sound of a revving engine. Sure, sound engineers made a good job, but video games use sound samples, not simulation. They can only record sound in a limited number of places and scenarios and while those are real soundwaves from real cars, it’s a limiting factor too.

Engine simulator by Ange Yaghi

Luckily, someone much more qualified also thought, that there is some room for improvement, or maybe it’s a nice little task. In hindsight, the states it was “quite possibly the dumbest project I’ve ever undertaken”, but dumb projects like these are fascinating and you can learn a LOT from them too. Especially since it’s open-source any you can visit the codebase on GitHub.

Ange, the creator of Engine Sim took a different approach: don’t take samples from real engines and analyze, but build a full-featured rigid body simulation to support the sound generation. Yes, simulate EVERYTHING. This not only results in a really realistic sound, but an extreme challenge: 80 000 simulation step every second. And I’m glad he did it!

The results are truly fascinating. I especially love the builtin dyno, and everything is explained pretty well. The only thing I miss is the sound of the original engines, so we have to believe that they sound like the simulated ones. Since it’s not a lightweight thing, don’t expect it in any game soon. This won’t replace the old methods, but shows us: there is always a different way.

Engineering p0rn is an often overlooked topic, so I hope you learned something, or at least enjoyed as much as I did!