Increasing TorqueCurve points screws up engine soundpitch

  • Two Factor Authentication is now available on BeyondUnreal Forums. To configure it, visit your Profile and look for the "Two Step Verification" option on the left side. We can send codes via email (may be slower) or you can set up any TOTP Authenticator app on your phone (Authy, Google Authenticator, etc) to deliver codes. It is highly recommended that you configure this to keep your account safe.

Radiosity

Minty Fresh!
Jan 3, 2003
2,217
0
0
45
UK
www.radiant-studios.net
I'm working on a vehicle pack at the moment, and a couple of my wheeled vehicles require some pretty beefy horsepower and speed. I've adjusted my TorqueCurves so that the vehicles behave as I want, no problem. However, it seems that the enginesoundpitch range is directly linked to the TorqueCurve, as when I use the vehicles, the engine pitch is way too high and sounds more like an angry wasp than a vehicle.

Is there any way I can adjust the sound pitch for my vehicles? I've looked through the parent classes (ONSWheeledVehicle, ONSVehicle, SVehicle, etc) but I haven't seen anything that seems to do what I want. Thanks in advance.
 

Glacian

SquirrelKing
Nov 11, 2004
38
0
0
39
Waltham, MA
I don't know much about coding vehicles, but the way I'd tackle it is take one of the vehicle sounds, say for the hellbender, bring it into a good sound program, lower the pitch, and then use that for your super-beefy ride :D
 

[SAS]Solid Snake

New Member
Jun 7, 2002
2,633
0
0
40
New Zealand
www.digitalconfectioners.com
Hmmm, I don't really like the above suggestion.

The idling sound and movement sound are done via AmbientSound.

Code:
[b]ONSVehicle.uc[/b]
function KDriverEnter(Pawn p)
{
[i]abstract[/i]
    if ( IdleSound != None )
        AmbientSound = IdleSound;
[i]abstract[/i]

Thus the properties of AmbientSound are the things we need to look at and in this case the variable SoundPitch, defined in
Actor.uc.
Code:
var(Sound) byte         SoundPitch;				// Sound pitch shift, 64.0=none.

Thus, by changing the SoundPitch value differently to how ONSVehicle's normally do should achieve the effect you are after
in a more controllable degree. Looking at a few Onslaught vehicles, I have noted that several of the vehicles do in fact
do this already as they may have ran into problems similar to yours.

Looking at the ONSHoverBike.uc (Manta), we can see the following adjustments to the ambient sound defined in the Tick function.

Code:
simulated function Tick(float DeltaTime)
{
  local float EnginePitch;
  [i]abstract[/i]
        if ( Level.NetMode != NM_DedicatedServer )
	{
		EnginePitch = 64.0 + VSize(Velocity)/MaxPitchSpeed * 64.0;
		SoundPitch = FClamp(EnginePitch, 64, 128);
  [i]abstract[/i]

Thus it is clear to see here that the adjustments of the SoundPitch are adjusted by only Velocity. MaxPitchSpeed is a static defaultpropertie thus is not part of the dynamics. I believe this should provide you with enough information you require. If
not ask again after you have tried this.
 

Radiosity

Minty Fresh!
Jan 3, 2003
2,217
0
0
45
UK
www.radiant-studios.net
Thanks SolidSnake, that's exactly what I've done :) I moved onto another vehicle that subclasses ONSChopperCraft and noticed the Tick function while I was checking out the Raptor code. I haven't actually got it working yet, but I think I know why now, thanks to your post. Will post again when I've tested it again and see if it works or not.
 

Radiosity

Minty Fresh!
Jan 3, 2003
2,217
0
0
45
UK
www.radiant-studios.net
Just a quick bump to say that I fixed the problem a good deal easier than messing around with Tick().

All it took was increasing EngineSoundPitchRange. Now, logically I was thinking that increasing this would increase the pitch, but actually it decreases it, so by more or less tripling the value I now have a normal sound pitch for my vehicles :)

Thanks for the suggestions :D