Closed michurebmann closed 1 year ago
Would be awesome if you can generate more sound samples! Having different samples when powering/coasting and for the rev limiter sounds great. I think there might be problems though when switching between the samples like the sound crackling. But it is definitely worth trying out!
Turbo/super chargers are also a possibility. What we could do is similar to the turbos in assetto corsa. I have found some info on it here: https://www.gamedev.net/forums/topic/664785-car-physics-turbochargers-and-friends/
The problems then becomes, to know how much each engine makes torque without the turbo. Because we would basically have like 2 engines, the real car engine and "turbo engine". The turbo engine would just add its torque on top of the car engine, based off of throttle, engine RPM and whatnot.
But you are correct, some cars just need the turbo!
i think the best ist to outsource the sound effects on his own child Node of the car. there have to be so much different sound effects/logics, it would become messi in the Car.gd. Brake noise, reverse gear noise, plopping of exhaust when off-gas, turbo.
i saw one can control the audio bus with a lot of effects, maybe for on/off gas its a solution. back in unity a bought an car engine asset, he had 3x on gas 3x off gas (low mid high rev), idle ,limiter, turbo, ploppin offgas, h had for every sound a seperate player and blended them over...
i think we should not go too heavy on assets, they are expensive to made(imo) you cannot made 10 sounds per car.
i wil give it a try if you like it.
Yeah i think there should be a node/class like CarSounds or something like that. It would have all the audio players for different sounds like engine, tire, brake, gear sounds etc. as a child and the CarSounds script could have the logic for these.
Playing around with the audio bus effects is absolutely something to try. I have not even tried them at all yet. If the effects can be used to make coasting engine sounds from powering sound it would make managing the sound assets a lot easier.
For sounds like gears, tires, turbo whistle etc. we could also try to use the same sound samples between cars and maybe try the effects on these as well?
i tested allready with high and low pass filter to dampening the sound for costing. the results are at least good. im testing a exhaust plopping system based on noise and some parameters and it sounds great. for idle i have a idle-rpm noise implemented for simulating rpm fluctuationf like in racecars.
yes i think the brakes and turbo sounds we dont need much..... just export some treshold var's, for wether or not it shoult and how hard the effect should appear. and the car dynamics from the car will "animate" the sounds so it will stay interesting.
for the gears changes would be a big plopp cool on upshifting
this will add so much to the feeling!
i tested a lot. now many questions have arisen ;)
should I make the AudioStreamPlayers as a childs of the sound controller? that would allow spawning only those that are needed.
I think the squeaking of the tires is directly at the tire node implemented?! didn't implement that in the sound controller.
but i implemented brake disc squeal, gear change noise, exhaust popping, idle rpm fluctuation and wind drag noise
manipulating with audio-effects via bus was not very successful. the filters don't like being manipulated 60 times a second... unfortunately. I found an interim solution for coasting sound but it needs to be reconsidered....
because of the turbo.... I read the link you sent me. every performance curve of a turbo car is always specified with full boost pressure. But how to implement it is another question. I haven't implemented any turbo sound logic yet because the logic for it probably belongs to car.gd but should be easy to do. just add the top 40% or whatever newton meters depending on boost/max boost. and make a wind up and wind down/blow off timer/speed
i hope i have at the weekend a stable solution.
Hello! I took some time off from developing, sorry for not responding in a while.
Making the AudioStreamPlayers children of the sound controller sounds good. For tire squeal, maybe we could make a function in the wheel suspension script that would return how much tire is sliding. This could be used for tire squeals and smoke particle effects for example. And the sound controller would also place the AudioStreamPlayer3Ds at wheels position.
Could the audio-effects still be used in the ready function? Or do we need to adjust them every frame?
I noticed a few bugs in the car and drivetrain scripts. Clutch input was not taken into account when calculating drive inertia and all the forces were applied in the beginning of the frame instead of end of frame. Also made the drivetrain parameters and redid AWD drivetrain implementation. I already fixed these in Advanced Vehicle Demo and have ported the changes to Open Throttle as well, just haven't made a PR for them yet. I will try and make the PR today.
I can try to get some initial turbo charger script done after i get those fixes i mentioned done and finish making the car scenes. I have already played around with it and making a very simplistic turbo shouldn't be too hard. Hopefully i have something by the weekend.
I have seen the video you linked quite a few times, and oh man would it be awesome to procedurally generate the engine samples, but that is very hard. In the video, there is a complete simulation of the engine internals, including fluid simulation of intake, combustion, exhaust etc. if i understood it completely. I think that is way too hard and computationally expensive to do. Even if we could simplify the audio generation, it would still need to done in C++ as GdScript would probably be too slow. But there is a AudioStreamGenerator and AudioStreamGeneratorPlayback classes in Godot if one wishes to experiment with it ;)
some how i missed your last post completely...
believe it or not, i allready try to archive some kind of procedural engine generation, but as you mentioned it have to be at least in c#, better in c++ and require some sound relatet knowledge, which i dont have. so at first i will not test further in this direction ;(
but in this process i started a "engine designer" (in a seperate project). the goal is you can set some propertys like bore, stroke, normal/race-engine slider, cylinders, turbo and it will calculate/show the torque curve in real time, it should then generate a resource "engine" whit its own logic to simulate a propper engine behave. things like sesponsiveness, Turbo lag/pressure, torque output, sound(generated or sample based), engine brake and so on would be calculated inside the resource. its just an idea.... maybe at some time i will show it to you and if you like it i will make a pull
with turbo i tested around too a bit, in the sound samples allready is a turbo boost sound sample i made, but i dont have a propper blow off sample yet...
and im working on a small script to display data as 2d graph. (used in engine designer) attach it to any control and the script will show the data, you give in an array inside the control node.
maybe will be usefull
That is cool! I also have a "Engine Sim" project, where i mostly tried out different engine models and throttle models. Idea was that i would then somehow generate the engine audio during runtime, but like you said, it requires some knowledge about audio / audio generation that i do not have.
But maybe in the future we would have more knowledge ;) It would be really cool to have the engine audio be generated on the fly. AFAIK only sim doing so currently is Live For Speed and of course AngieTheGreats EngineSim.
I would totally take a look at what you have if you want to make a public repo for it or something.
its funny, we have a lot similar ideas ;)
i have basically nothing yet, first i had to figure out how to make the gui the way i wanna have it, then i startet to work on the 2d data graph script, which should be as generic as possible. the engine designer is just a idea for now, the only thin it does is calculate the displacement from bore and stroke...
in a seperate script i managed to squeeze some notes out of the speakers in a generative way. combined with fast-noise it produces some good sound for wind or turbo boost (almost like white noise). i had a hard time to make it work, the sound thing. if you dont managed to get it work i can give you the example. its just a few lines....
I will close this issue and make a separate issue about adding turbo/superchargers.
i have managed to compile the sound generator! (could not be easyer)
so i will try to make some good sounds for the cars if its ok. maybe some more expensive sound management? have samples on load ond not load and blend them. maybe seperate idle/revlimiter sound.
what about Turbo charcher and other chrching systems? would love th pfffff pfffff tshhhhhh tshhhhh on the rallyes??? the S1 whidout the turbo noise is a shame ;)