Tom.K



Enabling Hypii on Linux version of Hypnospace Outlaw

If you've ever played Hypnospace Outlaw and ran it on Linux version, you probably wondered why Hypii is not working. Basically, devs couldn't find a way to enable TTS on Linux since it's so complex in general. This guide will try to at least give you some way to get Hypii functional again.


Credits

I did initially write this article on Discord server and here (but couldn't publish it on time), but I didn't manage to solve the issue with odd voice behavior, this was solved by Alyxx the Rat who made this guide on Steam.

Speech dispatcher

First of all, you need to install a speech dispatcher that provides access to text to speech engines.

You can use following commands as root based on your Linux distribution (check what's your distro based on if you can't find yours):

Debian:

$ sudo apt install speech-dispatcher

Fedora (Red Hat:

$ sudo dnf install speech-dispatcher

Arch Linux:

$ sudo pacman -Syu speech-dispatcher

At this point, it should be running without any issues.

To check if speech dispatcher is running, run it and see if it says that it's running:

$ speech-dispatcher

Speech engine

After installing the dispatcher, we also need an engine. In this case, we'll use eSpeak-NG.

$ sudo apt install speech-dispatcher-espeak-ng

At this point, we should be able to use TTS to play speech voice. Try it out with 'spd-say':

$ spd-say "Hello world"

Enabling speech dispatcher in Steam

Even with speech dispatcher enabled, the game won't perform any speech since it's not enabled. You'll have to enable speech dispatcher with a parameter before you run it.

  1. Open properties of "Hypnospace Outlaw" in Steam.
  2. In "General" -> "Launch options", add "--enable-speech-dispatcher" (no quotes) and close.

If you don't use Steam, launch the executable (or append to existing command) with "--enable-speech-dispatcher" parameter.

At this moment, if you have speech-dispatcher, you should be able to play sounds in game BIOS with speech buttons and in name editor on login screen at least.

However, you won't be able to play any speech in game yet since developers disabled this feature on Linux. Follow the part to resolve that.

Force enabling Hypii speech

Options for robot voice and captions are disabled and hardcoded if there are no voices.

To enable the voices, you'll have to do some steps for enabling toggle for robot and captions:

  1. Navigate to the game folder.
  2. Make a backup copy of package.nw first and then extract data.js from package.nw and open it in your preferred text editor.
  3. Search for HypiiRobot string in data.js.
  4. Check if the first search result is the following:
[3,154,null,623024275741261,false,[[1,[2,"HypiiRobot"]],[7,[0,1]]]],[80,187,null,854277302118531,false,[[10,6],[3,1]]],[81,187,null,176678765389064,false,[[10,6],[3,1]]]
  1. If this result matches yours, replace HypiiRobot with HypiiRobotHack
  2. On that same search result, look for string [3,1] that should be located after string 854277302118531 and replace 1 with 0 within that string.
  3. On that same search result, look for string [3,1] that should be located after string 176678765389064 and replace 1 with 0 within that string.
  4. Check if the first search result looks like this now:
[3,154,null,623024275741261,false,[[1,[2,"HypiiRobotHack"]],[7,[0,1]]]],[80,187,null,854277302118531,false,[[10,6],[3,0]]],[81,187,null,176678765389064,false,[[10,6],[3,0]]]
  1. Find the second search result for "HypiiRobot".
  2. Second result should be the following:
[3,154,null,694855591259663,false,[[1,[2,"HypiiRobot"]],[7,[0,1]]]]
  1. If this result matches yours, replace HypiiRobot with HypiiRobotHack.
  2. Check if the second search result looks like this now:
[3,154,null,694855591259663,false,[[1,[2,"HypiiRobotHack"]],[7,[0,1]]]]
  1. Save changes to data.js and add it back to package.nw by overwriting existing data.js in archive.

You should be able to launch the game by now.

Note that HypiiRobotHack is not a real command, it's just a dummy command to prevent HypiiRobot command from being invoked.

Hopefully, you should be able to disable robot voice in game settings and also be able to have Hypii saying stuff. Note that the first voice speech will be delayed due to initialization.

Fixing odd voice behavior

Even with voice being enabled and working, the output sounds wrong.

  1. Make a new file hypnos.conf in /usr/share/speech-dispatcher/conf/clients
  2. Add the following text in it:
BeginClient "*:HypnOS:*"
DefaultLanguage "en"
EndClient
  1. Save and close the file.
  2. Open existing file speechd.conf in /usr/share/speech-dispatcher/conf
  3. Find DefaultLanguage string, remove # comment and update it to this:
DefaultLanguage "en"
  1. Find DefaultModule string, remove # comment and update it to this:
DefaultModule "espeak"
  1. Restart and check if it's working now.

End

If everything is configured correctly, you can now use Hypii in Hypnospace Outlaw!