We Know the Devil

We Know the Devil

View Stats:
Hair Gay 27 Feb, 2021 @ 10:22am
Trying to get this working on Big Sur
Recently got a new laptop running the ♥♥♥♥ that is Apple's new OS, and having difficulty getting WKTD up and running. I'm fine getting my hands dirty with Electron, but figured I'd post here first to see if anyone has any knowledge to offer. The important things to say, I think, are:

1. I do not care if you think I should have not gotten a mac.

2. OS X is a ♥♥♥♥. The latest two releases are especially ♥♥♥♥♥. Javascript is a ♥♥♥♥. Combine that and you get a painful mega♥♥♥♥. I welcome pain.

3. None of the executables seem to be 32-bit. I don't know why Steam has WKTD flagged as a 32-bit thing.

4. I can't even diagnose the problem, seeing as it doesn't look like WKTD saves any logs and I can't get any command line launch with hopefully a log functioning. Directly launching WKTD's Electron executable from the command line immediately segfaults even on an earlier OS WKTD works fine-ish on. It would be helpful to know how Steam launches WKTD, args and all. This information is presumably stored in Steam's files somewhere, but I haven't the foggiest where.

5. I cannot figure out how WKTD is laid out. If my understanding of Electron is right, there should be javascript source files somewhere for it to run. I can find none.

6. I had hoped to get Steam's CLI running, for maybe finer control over things. That is proving problematic.

Edit: I suspect actually Learning How Electron Works is probably a significant way to figure out 4. This is the next obvious step, which I will follow when I get the time.
Last edited by Hair Gay; 27 Feb, 2021 @ 10:44am
< >
Showing 1-7 of 7 comments
Hair Gay 27 Feb, 2021 @ 3:44pm 
Eventually got it working. Had to unpack the source (in We Know The Devil.app/Contents/Resources/app.asar), get npm to try and run it through a fresh install of Electron, and wrestle with npm and the source code for a bit. Also had to toss in a weird hack to convince the code it was not in fact the htmlvn version of the game. All seems to be fine now, though.
ecramin2 16 May, 2022 @ 7:04pm 
ik this is from a year ago whoops but is there any way you can share the downloadable version? im having the same problem and i know nothing about code so i don't think i'd be able to get it working myself.
TrinityPulse 20 Mar, 2023 @ 1:14pm 
Hello! I could also use help getting this to work!!
cosmicAbsurdism 17 Jun, 2024 @ 3:43pm 
hi! i know this is from a couple years ago, but i was wondering if you could share the specifics of how you got it working?
Hair Gay 17 Jun, 2024 @ 7:24pm 
Hi all, sorry I missed things. I'll mess around tomorrow to see if I can reproduce what I did. Heads up it will involve a bit of terminal use and an installation of .... npm I think? Also no idea how to get get Steam's DRM (and consequently achievements) working.
Last edited by Hair Gay; 17 Jun, 2024 @ 7:28pm
Hair Gay 20 Jun, 2024 @ 10:17pm 
Alright, the following solution is pretty hacky, and could definitely be made to work better by someone who actually knows node and electron, but works well enough.

I don't know how much technical experience you have, so for you and anyone in the future reading this, when I say to type/enter/run a command I mean type/copy it into a terminal window and hit enter, and to edit text files you can use any standard text editor. I use vim, but using it is going to be opague af to anyone without experience with it already, so I'd recommend using TextEdit (which should be in your Applications folder already) if you don't know what vim or emacs is.

You will need npm, and some way of mass converting .ogg files to .m4a, I'm using ffmpeg. The easiest way to install these is probably with Homebrew, but anything should work.

Step 1: extract the game.
You'll first need to make a "working" folder, then type into a terminal:
npx @electron/asar extract ~/Library/Application\ Support/Steam/steamapps/common/We\ Know\ the\ Devil/We\ Know\ the\ Devil.app/Contents/Resources/app.asar [Path To Your Working Folder]
(If you do not know the path, just drag the folder from finder to the terminal window, it'll automatically put the path in.) It will probably ask to install asar, just let it do so. Now, in that terminal window or any other, type
cd [Path To Your Working Folder]
to focus/move to that folder. ALL TERMINAL COMMANDS HEREAFTER are to be done right there. If you close the terminal window, just cd to the working folder again.

Step 2: build ♥♥♥♥
Run
npm i --save-dev electron
Now replace the contents of the file package.json with the following.
{ "name": "wktd", "version": "1.0.0", "description": "", "main": "index.js", "scripts": { "start": "electron ." } }

Step 3: debug stuff
At this point you can try to run it, but it throws a bunch of errors, probably because you're trying to run it in a very different environment. The following is a couple disgusting hacks I apparently did a couple years ago after carefully reading through error messages and code.

First, open index.js, comment out or delete everything from line 5 (var app = ...) to line 15 (require('crash-reporter').start();) and add the following two lines above line 3:
var electron = require('electron'); const app = electron.app; const BrowserWindow = electron.BrowserWindow;

Now add the following line to script/wktd.js. It's convinced it's the online in-browser version, for reasons I still cannot fathom. This forces it to change its mind.
__HTMLVN_PRODUCTION__ = false;

Finally, convert all the .ogg audio files to .m4a. The following command uses ffmpeg, and will probably take a few minutes. Make Sure You Are In Your Working Directory For This Step Especially. If you are not, it will search the entire directory the session is currently in for all .oggs and convert them to .m4as. You probably do not want to do this to every single .ogg on your hard drive.
for f in $(find . -name '*.ogg'); do ffmpeg -i "$f" "${f%.*}.m4a"; done

And that should do it! To actually boot the game, you should just need to execute:
npm run start
If you close the terminal session, just cd to the working folder again first. Manually launching the game from a terminal is obviously not the most elegant solution, but eh?
Last edited by Hair Gay; 20 Jun, 2024 @ 10:42pm
cosmicAbsurdism 7 Jul, 2024 @ 11:22am 
tysm!!!!! this is so helpful
< >
Showing 1-7 of 7 comments
Per page: 1530 50