Poll

Would you like this sound to be added?

Yes, I'm in favor of this
7 (53.8%)
No, but a single quick sound upon reaching minimum / 99 is okay
0 (0%)
No, no sounds at all for RR change
2 (15.4%)
Don't care
4 (30.8%)

Total Members Voted: 13

Author Topic: [SUG][PLAYER] Sound For Release Rate Increase/Decrease  (Read 8679 times)

0 Members and 1 Guest are viewing this topic.

Offline WillLem

  • Posts: 3345
  • Unity isn't sameness, it's togetherness
    • View Profile
Re: [SUG][PLAYER] Sound For Release Rate Increase/Decrease
« Reply #15 on: January 31, 2023, 03:25:21 PM »
Quote
would it be possible for the skill select button sounds to also increase/decrease in pitch when scrolling left and right

This one is not going to happen. While the underlying audio library probably has support for such a feature, the code NL uses to manage / play sounds does not, and that'd be a major thing to add at this point

Fair enough. Are we still on for potentially adding sound to the release rate button though?

A simple "silent buttons" checkbox in F2 could turn all button sounds on and off, for those that prefer no sound. The audio feedback from buttons is important for a number of reasons including real-time play, speedrunning/challenge play, knowing you've skipped up to max or down to min rate without looking, and the fact it's just generally in keeping with the audio feedback elsewhere in the engine.

Note this topic that I started ages ago.
« Last Edit: March 08, 2023, 10:30:55 PM by WillLem »

Offline WillLem

  • Posts: 3345
  • Unity isn't sameness, it's togetherness
    • View Profile
Re: [SUG][PLAYER] Sound For Release Rate Increase/Decrease
« Reply #16 on: March 08, 2023, 10:30:37 PM »
Just making a note of this here:

COMBASSFXLibrary

It's a BASS wraparound that allows deeper audio processing such as pitch shifting, etc. Not sure if BASS.dll already supports that, but this one definitely does.

There's also this one:

RubberBandLibrary

There's also BASS_fx.dll, which apparently includes a pitch-shifting component.
« Last Edit: March 08, 2023, 11:00:42 PM by WillLem »

Offline WillLem

  • Posts: 3345
  • Unity isn't sameness, it's togetherness
    • View Profile
Re: [SUG][PLAYER] Sound For Release Rate Increase/Decrease
« Reply #17 on: March 29, 2023, 01:49:30 AM »
This, in LemGame.pas, implements this feature (EDIT: see next message, the following isn't the best way to do it):

Code: [Select]
/// Line 6617 in SLX ///

procedure TLemmingGame.CheckAdjustSpawnInterval;
var
  NewSI: Integer;
begin
  if SpawnIntervalModifier = 0 then Exit;

  NewSI := CurrSpawnInterval + SpawnIntervalModifier;
  if CheckIfLegalSI(NewSI) then
    RecordSpawnInterval(NewSI);
    CueSoundEffect(SFX_ASSIGN_SKILL);                <------------------- {new line here}
end;

Note that it's almost certainly worth using a gentler sound effect whilst NL doesn't support pitch-shifting. I've attached one here that I'm currently using as a placeholder in SLX whilst I hunt for a better sound. Eventually, I'm hoping to use the bass_fx.dll plugin to implement pitch-shifting up and down, but this is a way off yet. I've got lots to learn about sound library programming.



EDIT: The sound plays whilst in normal speed, but not whilst paused. The reason for this isn't apparent.
« Last Edit: April 03, 2023, 03:27:04 AM by Will »

Offline WillLem

  • Posts: 3345
  • Unity isn't sameness, it's togetherness
    • View Profile
Re: [SUG][PLAYER] Sound For Release Rate Increase/Decrease
« Reply #18 on: April 03, 2023, 03:24:45 AM »
OK, there is a much better place to cue the sound effect. Previously, the sound would continue to cue (when holding the button down) even when Min/Max RR was reached.

This fixes that particular issue, but the sound still won't trigger when the game is paused:

Code: [Select]
//// line 6140 in SLX ////

procedure TLemmingGame.AdjustSpawnInterval(aSI: Integer);
begin
  if (aSI <> currSpawnInterval) and CheckIfLegalSI(aSI) then
    currSpawnInterval := aSI;

  CueSoundEffect(SFX_CHANGE_RR);             <-------------------------------------------------- new line here
end;