Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New DLL Testing Thread #65

Closed
drojf opened this issue Aug 14, 2021 · 3 comments
Closed

New DLL Testing Thread #65

drojf opened this issue Aug 14, 2021 · 3 comments

Comments

@drojf
Copy link
Contributor

drojf commented Aug 14, 2021

@DoctorDiablo here is the new DLL for Console with the "lipsync without spectrum file" feature for you to try out (for you to test while you're working on the next release):
Assembly-CSharp Console 2021-08-14 eb4e7df05f34a5ca3f840ff52ab9a759519dc4c7.zip

You can read the "Developer Info - Computed Lipsync" section below if you want to mess with the lipsync settings, but otherwise
you don't need to read anything below - I'm just recording for later use when I write the changelog.

Bug Fixes

  • Fix a crash if you toggle any art style options too many times (~10? times) without advancing the text

  • Original/Ryukishi mode fixes

    • Fix sprite positions not matching original game when there are 3 sprites on the screen at once.
      • Our base mod has spaced out some sprites to better fit the widescreen aspect ratio in some cases. This fix attempts to put them back to their original position when you are using 4:3 Original backgrounds.
    • Fix portrait (zoomed in sprite) images not being cropped when using 4:3 mode (you would need to use Console sprites with OG backgrounds)
    • Fix lipsync not working when using Console sprites with 4:3 Original backgrounds

Mod Menu Updates

  • Fixes issues raised in: Improve Graphics Options Usability / UX #61
  • Added tabs for Gameplay, Graphics, Audio, and Troubleshooting to separate options
  • Graphics presets are now "Console/Mangagamer/Original" instead of "ADV/NVL/Ryukishi"
  • Made sprite/background/text window options less confusing by making the following options independent of each other:
    • Sprite style (used to be changed when changing the "art set")
    • Background style (used to be changed via an override, and would reset when "art set" changed)
    • Background stretching (used to be part of the background selection)
    • Text window appearance (used to depend on the graphics preset)
  • Dedicated "Custom" graphics preset
    • Custom preset is no longer indicated by a asterisk (*) next to a default preset - instead it appears as its own preset
    • This preset is activated when you modify any of the default presets (or just click "Custom")
    • The values in the "Custom" preset are saved, even if you activate one of the default presets. This allows you to switch between your custom preset and any of the default presets to see how it looks

Old Menu

old-mod-menu

New Menu

new-graphics-options

Developer Info - Computed Lipsync

See #62 for some background on this feature

In the past, lipsync relied on .spectrum files, which the game would use to determine the mouth animation for each .ogg file.

The new computed lipsync method instead computes this on-the-fly, roughly as follows:

  • While the voice file is playing:
    • Check how far the current .ogg file has played
    • Get 50ms worth of audio data at the current play time
    • Get the maximum loudness (roughly) in that 50ms
      • If louder than the Expression 2 threshold, display Expression 2 (default thresh is 70% loudness)
      • If louder than the Expression 1 threshold, display Expression 1 (default threhs is 30% loudness)
      • Otherwise, display Expression 0
    • Delay 50ms before the next loop
  • When the voice file finishes, display Expression 0 (mouth closed)

This might be slightly different from the old method as:

  • The old method didn't synchronize with the voice file (it just read one expression from the .spectrum file every .66ms)
  • The old method might have used a different way to compute which epxression to display at any time

By default, computed lipsync only activates if there is no .spectrum file found, however there is a way to change this behaviour (see below).

Computed Lipsync Options

I've added some options both in the menu and as script commands which control the computed lipsync.

NOTE: The in-menu options are not saved when the game is closed. But you can use the script command to always use the same value on every startup.

Options in the Developer Tools section

  • Force Computed Lipsync: When computed lipsync is used as a fallback, it always checks for the presence of a .spectrum file. If we decided to remove the .spectrum files, we should remove this check so we don't have an extra disk access every time an audio file plays. To do this, we can set Force Computed Lipsync to True.

    • By default, "Force Computed Lipsync" (it's only used as a fallback, not all the time)
  • Lip sync thresholds: These are the volume levels above which expression 1 and expression 2 are displayed (specified as a floating point number between 0 and 1).

    • The default value for Expression 1 is .3 (that is, loudness > .3 but < .7 will display as expression 1)
      • loudness <= .3 will display as expression 0
    • The default value for Expression 2 is .7 (that is, loudness > .7 will display as expression 2)

Script Commands

There is a script command you can use to set the above values - please place it in the init.txt file:

ModGenericCall("LipSyncSettings", ".3, .7, true");

The above command would set the Expression 1 threshold to .3, Expression 2 threshold to .7, and set "Force Computed Lipsync" to true.

computed-lipsync-menu

Here is the new DLL for Console:
Assembly-CSharp Console 2021-08-14 eb4e7df05f34a5ca3f840ff52ab9a759519dc4c7.zip

@drojf
Copy link
Contributor Author

drojf commented Aug 23, 2021

I just noticed there was an error in the script command for the computed lipsync, it should have been:

ModGenericCall("LipSyncSettings", ".3, .7, true");

I've updated my first comment with that information

@drojf
Copy link
Contributor Author

drojf commented Sep 24, 2021

On the new DLL, in minagoroshi chapter 2, this choice is offset/not centered when using OG mode. I haven't re-tested on the current DLL, it might have always been this way.

I'm also not sure if it's all choices which have this problem, or just this one.

EDIT: user re-tested on current DLL, and the behavior is the same. Likely it was always like this

offset_choice_minagoroshi_ch2

@drojf
Copy link
Contributor Author

drojf commented Nov 6, 2021

I'm gonna close this issue now that the new DLL has been released

I didn't release the computed lipsync feature with the latest DLL release, but all the other changes are in there.

I didn't add an additional fix for the above offset text bug.

I'll reopen a new issue if/when the computed lipsync feature is released, or if/when it gets used in the console arcs.

@drojf drojf closed this as completed Nov 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant