Skip to content

Releases: nmlgc/ssg

P0275

09 Mar 15:38
Compare
Choose a tag to compare

BGM can now be modded via BGM packs in the bgm/ subdirectory! Each track is identified by its two-digit Music Room number, followed by the extension – for example, the MIDI version of the title screen theme would be 01.mid. This was mainly implemented for in-game support of SC-88Pro recordings on future operating systems without a native MIDI synth.
"Screenshot of the BGM pack selection menu introduced in the Shuusou Gyoku P0275 build, highlighting the <Download> option.

Due to new filesystem- and threading-related code, this release requires Windows Vista or later, and no longer comes with an i586 build. If you are interested in continued official support for earlier Windows versions, feel free to provide funding or code contributions for #43, #53, and/or #58.

The detailed changelog:

BGM packs

  • BGM packs introduce support for waveform BGM. The system is based on thcrap's BGM modding support, with the following key differences:

    • Only FLAC (.flac) and Ogg Vorbis (.ogg) codecs are supported, with .flac taking precedence over .ogg.

    • Stacking is not supported.

    • Each track can be provided in waveform and MIDI versions. If both are present, the MIDI version is silently processed in the Music Room to provide note and spectrum analyzer visualization. This assumes that both waveform and MIDI files are perfectly synchronized with each other.

    • Track titles for in-game and Music Room display are taken from the Vorbis comment TITLE tag of the intro file.

  • Waveform tracks can provide a gain factor to optionally remove any volume differences between individual tracks of a BGM pack. This factor is read as a floating-point value from the optional GAIN FACTOR tag of the intro file.

    • The configuration menu disables the BGMVolNormalize option if the currently playing track does not define a gain.
  • Waveform tracks can link themselves to a MIDI file from the original MUSIC.DAT soundtrack. This allows recordings of these MIDIs to retain the original Music Room visualizations without needing to bundle the original file in the BGM pack and thus infringing copyright. This is done by providing the full 32-byte BLAKE3 hash of a MIDI file in the optional SOURCE MIDI tag of the intro file.

  • If no BGM pack is present, the Sound / Config menu provides a download option for SC-88Pro recordings of the original soundtrack. Currently, this simply opens a web page in the system's default browser.

General sound- and music-related changes

  • BGM and sound effect volume can now be adjusted in-game, separately from each other. The controls in the Sound / Config menu are modeled after the MIDI standard, using a squared volume curve with a range between 0 and 127. Unlike in Windows Touhou, the BGM volume setting also applies to MIDI.

    Screenshot of the Sound / Music menu of the Shuusou Gyoku P0275 build, showing off the new volume control and BGM pack selection options.

  • The in-game music title animation is no longer shown if BGM is disabled.

  • In-game music titles are now consistently right-aligned.
    Leading whitespace in 4 of the original MIDI Sequence Names suggests that pbg might have intended these titles to be centered within the 216 maximum pixels that the original code designated for music titles, but none of those had the correct amount of spaces that would have been required for exact centering. The code did have a formula for right alignment though, so this fix maintains consistency with the whitespace-trimmed title tags in the BGM packs. For shorter titles, this slightly changes the look of the animation; this might be fixed with #55.

    Original game:

    2024-03-09-SH01-Ingame-music-title-original.webm

    P0275 build:
    2024-03-09-SH01-Ingame-music-title-P0275.webm

MIDI playback

  • The original MIDI soundtrack from MUSIC.DAT now seamlessly loops instead of restarting at the end of each MIDI file. The necessary loop points were algorithmically detected using mly and are hardcoded into the executable as a map that associates the BLAKE3 hash of each individual MIDI file with a loop region.

  • Re-enabling MIDI BGM in the Sound / Music menu will now immediately play the title screen theme again.

  • MIDI files now play at their exact notated tempo.
    Shuusou Gyoku's original MIDI parser had an arithmetic error that caused every tempo value to be parsed as roughly ≈0.8% / ≈1 BPM slower than notated. As a result of pbg's Program Support role during the development of TH06, this bug is also present in every Windows Touhou game that supports MIDI playback.

  • The MIDI Port configuration option now shows a simple grayed-out > if BGM is disabled. Previously it showed ^^^^^^^^^^, which lined up with the 使用しない string from the MIDI option above, but this no longer works with the new BGM-related options between the two.

  • When the game window regains focus after losing it, MIDI playback now resumes at the exact position it was paused, instead of rewinding to the beginning of the track.

  • The MIDI TIMER in the Music Room now shows the current MIDI pulse value.
    In the original game, it simply showed the PASSED TIME value formatted in milliseconds. While this revealed the 10ms update interval of the game's MIDI player, it didn't provide any further information that related to the actual MIDI file being played. In contrast, the MIDI pulse value will jump back when reaching the loop point while the PASSED TIME value continues to increase in that case.

Menus

  • If any of Shuusou Gyoku's 5 original game data files are missing, the game now shows a new screen at startup with the full absolute paths to the .DAT files and an option to recheck without restarting the game. This means that the game will now at least show something if it's started by itself from any directory – previously, it simply crashed on the first attempt to load anything from a nonexistent .DAT file.

    The new 'missing game data' screen shown at startup in the P0275 build of Shuusou Gyoku, listing any missing files at their absolute directories and offering the possibility to recheck their existence without quitting the game.

  • The main menu help text now appears centered rather than left-aligned next to a nonexistent face sprite.

Troubleshooting

As of the P0256 build, D3DWindower can no longer be used with the SDL2/non-i586 version, but DxWnd still works. Import this configuration via File → Import, then adjust the path to your GIAN07.exe.

If the game runs slow on your system, or doesn't render anything at all:

  • Delete any reference to GIAN07.exe from the following registry keys:

    • HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers
    • HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers
  • Make sure that the 32-bit mode is activated in the Config → Graphic menu.

Additional credits

  • Elfin: English→Japanese localizations
  • Verinna: Spanish localization for BGM placement files

Summary blog post: https://rec98.nmlgc.net/blog/2024-03-09
Full changelog compared to the previous release: P0256...P0275
Previous release: https://github.com/nmlgc/ssg/releases/tag/P0256

P0256

30 Sep 21:26
Compare
Choose a tag to compare

This build starts the gradual migration to cross-platform low-level game libraries as part of the Linux port. SDL is now used for window creation, frame rate limiting, and input, while sound is handled through miniaudio.

Changes unique to the regular / cross-platform library build

  • The game now limits its frame rate by properly sleeping the process instead of the original's busy-waiting code that permanently used 100% of one CPU core to wait for the next frame. On modern systems, this should drop CPU usage into the 0%-2% range during regular gameplay.

  • Since the game no longer uses DirectInput 7, antivirus scanners shouldn't complain about the .EXE file anymore.

  • Thanks to SDL, the game should now support every possible controller, including more modern ones that maybe weren't supported by the original game.

  • The game now reads inputs from every connected controller, not just the one that is configured as the preferred device for older applications in the Control Panel.

    • All controllers can be freely hot-plugged and removed while the game is running, just like the single controller in the original game.
  • Sound effects are slightly crispier when upsampled to native sampling rates of ≥44100 Hz, due to miniaudio's differently implemented low-pass filter.

  • Direct3DWindower no longer works properly, but DxWnd does.

Changes present in both builds

  • When playing the game through external DirectDraw windowing tools, the game window can now be moved.

  • The original game's rapid-fire screenshot feature has been restored. The original game mapped this feature to the PrintScreen key, which invokes Windows' own focus-stealing screenshot UI in recent Windows versions. For this reason, it's remapped to the P key in this build, which is consistent with all Windows Touhou games since TH08.
    When holding the P key, the game will now save every rendered frame to a .BMP file.

  • The Joy Pad menu in the original game allowed joypad actions to be unmapped by pressing more than one button simultaneously. This was indicated with [Button 0], which might falsely suggest that the game starts numbering joypad buttons at 0, especially since the SpeedDown and ESC action start out in this unmapped state. This build replaces [Button 0] with a much clearer [--------] label.

    Joypad button unbinding in the P0256 build of Shuusou Gyoku, using a much clearer [--------] label

  • The game loop now keeps running at the end of the in-game Game Over animation, and doesn't freeze until pressing and releasing a key or joypad button anymore.

  • The game now immediately renders the High Score screen when entering it through the Score option in the main menu. The original game showed just a black screen until the ⏎ Return/Z key or corresponding joypad button was released.

  • When registering a new high score, any held ⏎ Return/Z or corresponding joypad inputs are now flushed before entering the High Score screen. This avoids an A being added to the name seemingly automatically when entering this screen by pressing one of those inputs after a Game Over.

  • Errors are now logged in UTF-8. To avoid mixed encodings in the originally Shift-JIS-encoded ErrLOG2.TXT file, new logs are written to ErrLOG_UTF8.TXT instead.

Troubleshooting

D3DWindower can no longer be used with the SDL2/non-i586 version, but DxWnd still works. Import this configuration via File → Import, then adjust the path to your GIAN07.exe.

If the game runs slow on your system, or doesn't render anything at all:

  • Delete any reference to GIAN07.exe from the following registry keys:

    • HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers
    • HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers
  • Make sure that the 32-bit mode is activated in the Config → Graphic menu.


Summary blog post: https://rec98.nmlgc.net/blog/2023-09-30
Full changelog compared to the previous release: P0251...P0256
Previous release: https://github.com/nmlgc/ssg/releases/tag/P0251

P0251

01 Aug 23:57
Compare
Choose a tag to compare

Tons of internal changes in preparation for migrating the codebase to SDL and its renderer abstraction, together with a few minor bug fixes:

  • The P0226 build had a bug that allowed invalid stages to be selected for replay recording. If the ReplaySave option was [O F F], pressing the ⬅️ left arrow key on the StageSelect option would overflow its value to 255. The effects of this weren't all too serious: The game would simply stay on the Weapon Select screen for an invalid stage number, or launch into the Extra Stage if you scrolled all the way to 131. Still, it's fixed in this build.

    Screenshot of the negative overflow bug that the P0226 build of Shuusou Gyoku accidentally introduced into the replay stage selection
    Whoops! That one was fully my fault.

  • Alt-Tabbing out of the ending won't mess up graphics anymore.
    See #19 for details of this bug.

  • Text rendering has been optimized by caching each piece of text on a DirectDraw surface (equivalent to a texture in modern 3D APIs) instead of directly rasterizing it onto the DirectDraw framebuffer every frame. This was necessary for porting the game away from DirectDraw later, but it also happened to increase the game's potential frame rate by roughly 3.5× in the Music Room, and 1.9× during in-game dialog.

  • The gradient on the in-game music title now renders roughly twice as fast, cutting down the lag before its animation.

  • The configuration file now uses a forwards-compatible versioning scheme, and a matching SSG_V??.CFG file name format. These new files don't use a checksum anymore, which allows the configuration to be freely hex-edited. The game now validates each value individually, and resets it to its default on a validation failure.

    • For backward compatibility, a build will always write any changed settings to all previous configuration file versions, including the original 秋霜CFG.DAT.

    • A bit depth setting of 32-bit is now automatically turned into 16-bit when writing to the original 秋霜CFG.DAT. On the original 秋霜玉.exe, any value apart from 8-bit or 16-bit would cause the entire file to fail validation, resetting the entire configuration to its defaults and re-locking the Extra Stage. This fully restores the backward compatibility to the original release that the P0226 build broke.

  • 8-bit mode now requires no special tweaks in DxWnd to run without glitches.
    To display the in-game music title with correct colors, the original game required the DirectX(2) → Fix DC palette setting, which was only introduced in version 2.05.95, released in April 2023.

  • The archive now includes an i586 build that can potentially run on vintage Windows systems. See the Setup section inside the archive for more details.

The original screenshot feature is still missing, as it also wasn't part of pbg's released source code.

Troubleshooting

  • If the game runs slow on your system, or doesn't render anything at all:

    • Delete any reference to GIAN07.exe from the following registry keys:

      • HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers
      • HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers
    • Make sure that the 32-bit mode is activated in the Config → Graphic menu.

  • If you're wondering why your antivirus is freaking out: I explained the reasons in #22, with some more background in #21.


Summary blog post: https://rec98.nmlgc.net/blog/2023-08-01
Full changelog compared to the previous release: P0226...P0251
Previous release: https://github.com/nmlgc/ssg/releases/tag/P0226

P0226

31 Dec 23:59
Compare
Choose a tag to compare

Now runs at full speed on modern Windows systems, by adding support for 32-bit rendering and defaulting to it if possible. If the game still runs slow on your system, or doesn't render anything at all:

  • Delete any reference to GIAN07.exe from the following registry keys:

    • HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers
    • HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers
  • Make sure that this new mode is activated in the Config → Graphic menu:

    The new 32-bit rendering option in the Shuusou Gyoku P0226 build.

Due to this additional mode, the 秋霜CFG.DAT files created on this build are no longer compatible with official versions of Shuusou Gyoku. They will fail to load there, re-locking the Extra Stage in the process.

This build also features a basic level of locale independence:

  • The game now unconditionally reads from the original Japanese configuration (秋霜CFG.DAT), score (秋霜SC.DAT), and replay (秋霜りぷ*.DAT) filenames. If you previously played the game on a non-Japanese locale, make sure to rename your old files before starting this build the first time.

  • Ending text mojibake is fixed. Originally, the game didn't specify what font to show in the endings, which could result in a different appearance on certain systems. This build chooses the font that would appear on a clean Windows installation.

  • The game's window title now correctly shows up as 秋霜玉 as well.

The additional unique issues compared to the original binary still remain:

  • The original screenshot feature is still missing, as it also wasn't part of pbg's released source code.
  • If you're wondering why your antivirus is freaking out: I explained the reasons in this issue, with some more background here.

Summary blog post: https://rec98.nmlgc.net/blog/2022-12-31
Full changelog compared to the previous release: M0002...P0226
Previous release: https://github.com/nmlgc/ssg/releases/tag/M0002

M0002

01 Nov 21:11
Compare
Choose a tag to compare

A minor performance increase compared to the last build: The compressed data of the three main packfiles (ENEMY.DAT, GRAPH.DAT, and MUSIC.DAT) is now only loaded once into memory and then kept there for the runtime of the game process. Previously, the P0217 build fully loaded each corresponding packfile whenever the game requested any single of its contained files. I don't know how slow your system would have to be for that optimization to be noticeable, but it was something that stuck out about my original packfile implementation.
While this does prevent hot reloading for traditional packfile mods, I have other plans for a safer and more controlled modding system. Treating the original packfiles as immutable blobs removes the redundancy of keeping modified files in both uncompressed and compressed formats during mod development, and makes it easier to redistribute mods while complying with the copyright on the original packfiles.

No additional features or bug fixes otherwise, just some internal code cleanup and initial portability preparations, balancing out the overtime that went into P0217 in at least somewhat of a productive way.

Full changelog compared to the previous release: P0217...M0002

Previous release: https://github.com/nmlgc/ssg/releases/tag/P0217

P0217

04 Sep 15:38
Compare
Choose a tag to compare

First build that works as a drop-in replacement for the original 秋霜玉.exe, reading and writing the original data formats. Still a strict downgrade compared to the original binary, as it still has all of its problems:

  • Separate Japanese locale emulation is still needed to correctly refer to the original names of the configuration (秋霜CFG.DAT), score (秋霜SC.DAT), and replay (秋霜りぷ*.DAT) files. It's also required for the ending text to not render as mojibake.
  • Running the game at full speed and without graphical glitches on modern Windows still requires a separate DirectDraw patch such as DDrawCompat. To eliminate any remaining flickering, configure the game to use 16-bit graphics in the Config → Graphic menu.

As well as some of its own:

  • The original screenshot feature is still missing, as it also wasn't part of pbg's released source code.
  • If you're wondering why your antivirus is freaking out: I explained the reasons in this issue, with some more background here.

So it's more of a symbolic release, signifying that we can now start doing actual work on this game.

Summary blog post: https://rec98.nmlgc.net/blog/2022-09-04

Full changelog: pbg...P0217