github akirahayabusa/ngb-pc-native-port-release v2.2.30
Ninja Gaiden Black Hurricane PC 2.2.30

47 minutes ago

《忍者龙剑传 黑之章》(含飓风版中文汉化 vb-zh-x2.1)与《忍者龙剑传》(2004)的非官方 Windows 原生移植。2.2.30。

2.2.30:修复“不随距离衰减”的 3D 音效被压低(第 7 章木板砸地无声)

玩家遇到的问题

黑之章第 7 章的过场动画里,木板塌下来砸到地上的那一瞬间听不到砸地声,只剩环境音。

原因(主机音频库代码与实测日志双重确认)

  • 这一声是 3D 音效:游戏给它设了位置(离听者约 142)、最小距离 9、最大距离 50,并把它的距离衰减系数设为 0(SetAllParameters)。
  • 主机的音频库(飓风版 x2.1 自带的 DirectSound 库)计算距离衰减时,把“听者的衰减系数 × 音效的衰减系数”直接相乘(0x37B26D:fld [听者+0x3C] / fmul [音效+0x48]),衰减量为 -2000 × log10(1 + 系数 × (距离 ÷ 最小距离 − 1)) 毫贝(0x37D5EF、0x37D1BA)。系数为 0 时结果是 0 dB,也就是这个声音不随距离变小,这是游戏有意的设置。
  • 移植版以前把系数 0 当成“没设置”,换成了 1,于是按距离多压了 14.9 dB。砸地声本身音量就是 -12.4 dB,再被压低后完全淹没在环境音里。
  • 实测日志:砸地那一刻(手柄满强度震动、随后逐次减弱)之前 0.13 秒,游戏确实播放了这个音效;它被算成的距离衰减正是 -1489 毫贝。

修复

  • 衰减系数按主机的做法直接使用,0 就是不衰减。系数的默认值仍是 1,游戏没设过系数的声音不受影响。
  • 影响范围:游戏里所有被设成“不随距离衰减”的 3D 音效都会恢复到主机上的音量。同一段过场里木板开始断裂的那一声也是这种情况。

新的测试开关

  • --log-sounds:记录每一次音效播放(默认只记前 60 次),以及每个 3D 音效的位置、听者位置、距离和最终算出的音量。只给排查问题用,玩家不需要,不加这个开关时没有任何影响。

测试

  • 第 7 章这段过场:修复前按日志定位到砸地声被压低 14.9 dB;修复后作者实际听到了砸地声,确认声音正确。
  • 发布包里的游戏程序启动正常。Windows Defender 扫描三个程序:无威胁。

发布包

  • ngb-hurricane-pc-2.2.30-win32.zip
  • 大小:3,065,098 字节
  • SHA-256:914a6c145a49b7a2d8b0c9b10cc328cde04eb363b2ef239aaa3e48da5c30fd2e
  • 符号包 ngb-hurricane-pc-2.2.30-win32-symbols.zip:26,613,758 字节
  • SHA-256:621b3fc753bd8ea2ec8b3c65f18eb0dc8cb6fab9b64cae3b484e2a874364a57d

作者:b站 哈雅布撒(QQ:2682557218)


English

An unofficial native Windows port of Ninja Gaiden Black (including the Hurricane Chinese translation vb-zh-x2.1) and Ninja Gaiden (2004). 2.2.30.

2.2.30: 3D sounds meant not to fall off with distance are no longer turned down (chapter 7's plank crash)

What a player ran into

In a chapter-7 cutscene of Ninja Gaiden Black, the plank crashing onto the ground made no sound; only the ambience was heard.

Cause (checked in the console's audio library and in a logged run)

  • The crash is a 3D sound: the game gives it a position (about 142 from the listener), minimum distance 9, maximum 50, and a rolloff factor of 0 (SetAllParameters).
  • The console's audio library (the DirectSound library in x2.1) multiplies the listener's rolloff by the voice's as they are (0x37B26D: fld [listener+0x3C] / fmul [voice+0x48]) and attenuates by -2000 log10(1 + rolloff (distance / min - 1)) millibels (0x37D5EF, 0x37D1BA). With rolloff 0 that is 0 dB: the sound does not fall off with distance, as the game intends.
  • The port took a rolloff of 0 as unset and used 1, which cut the sound by 14.9 dB. On top of its own -12.4 dB, the crash was lost under the ambience.
  • In the logged run, the game played the sound 0.13 s before the crash (the controller's full rumble, then weaker pulses), and its distance attenuation came out at -1489 millibels.

Fix

  • The rolloff factor is used as the console uses it: 0 means no falloff. The default is still 1, so sounds the game never gives a factor are unchanged.
  • Every 3D sound the game sets not to fall off now plays at the console's level, not only this one; the plank starting to break in the same cutscene is another.

New test switch

  • --log-sounds: logs every sound played (by default only the first 60) and, for 3D sounds, the position, the listener, the distance and the level the mixer gives them. For tracking problems down; players need not use it, and without it nothing changes.

Tests

  • The chapter-7 cutscene: before the fix the log showed the crash 14.9 dB down; after it the author heard the crash and confirmed it sounds right.
  • The packaged game starts normally. Windows Defender scan of the three programs: no threats.

Package

  • ngb-hurricane-pc-2.2.30-win32.zip
  • Size: 3,065,098 bytes
  • SHA-256: 914a6c145a49b7a2d8b0c9b10cc328cde04eb363b2ef239aaa3e48da5c30fd2e
  • Symbols ngb-hurricane-pc-2.2.30-win32-symbols.zip: 26,613,758 bytes
  • SHA-256: 621b3fc753bd8ea2ec8b3c65f18eb0dc8cb6fab9b64cae3b484e2a874364a57d

Author: 哈雅布撒 on Bilibili (QQ: 2682557218)

Don't miss a new ngb-pc-native-port-release release

NewReleases is sending notifications on new releases.