At Dead Of Night

At Dead Of Night

评价数不足
How to play At Dead Of Night on MacOS !natively! (no streaming, no emulators, no Wine, no Parallels etc)
由 VityaSchel 制作
In this tutorial you will learn how to run At Dead Of Night on macos without emulators or wine.
   
奖励
收藏
已收藏
取消收藏
Tutorial
In this tutorial you will learn how to run At Dead Of Night on macos without emulators or wine. Basically run natively (if you can call browsers rendering a native thing).



So how does this work? Read technical details below. Or just download .app to play now.
Method 1. Just download .app that I already made
Since I don't want to redistribute the game for free and fall under piracy laws, you have to authorize with Steam account having at dead of night in Steam library. There are also links to other mods on this website.

https://adonmods.utidteam.com ↢ download macos port from here

Caveats

1. "This app is corrupted" error — Remove quarantine attribute by running this in terminal:
xattr -d com.apple.quarantine /path/to/nwjs.app
(replace path to nwjs.app by actual path on your computer)
2. It asks for permissions like downloads folder etc. — Refuse them. I have no idea why it asks for such permissions, but looks like it's optional to give them.
Method 2. Port it yourself (+ learn how it works)
So first of all I spent several days figuring out how ADON works with nwjs. We'll start with explanation of terms so you don't get confused very quickly:

- at dead of night is a browser game that runs inside of chromium (like Contradiction, Omori etc)
- as any other web thing, it uses javascript and javascript uses v8 engine to compile itself to machine code and run on your computer
- nwjs is a thing that allows you to run browser games in native windows. but actually if you press F12 (with dev mode unlocked) you'll get the same chromium devtools, inspect element, javascript console in At Dead Of Night as in your google chrome browser. you may be familiar with discord which is the same thing, but running on electron and not nwjs (because electron is slightly less ♥♥♥♥♥♥ than nwjs)

Now you ask me, so it's possible to make a website and play at dead of night instead of installing the game? What's the problem with porting adon on basically any existing platform that supports google chrome then? you see, Tim Follin, At Dead Of Night developer, obfuscated the game's code and the result of that is js/app.bin you can see in your game's folder when you download it. These bin files generated by nwjs are actually v8 snapshots, basically images of operation system memory, something between abstract v8 bytecode and machine code (assembler). AFAIK he wanted to make mac version but it seems there was some problem with tools or shell.

Luckily, after 2 days reverse engineering these v8 snapshots, it turns out they ARE crossplatform. How is this possible? I have no idea. But I do know that this only works with adon2024 beta version. So that's the first thing you're going to do if you want that game to port to macos.

1. Change steam branch to adon2024

1. Go to your steam library
2. Click RMB on ADON -> Options
3. Beta versions
4. Select adon2024. Some day it might end up being the main version of the game (i.e. default public branch) so if you don't see it there — it's either got deleted and you may now close this page and give up, or skip this step entirely
5. Wait for adon2024 version to download

The important thing here is that nwjs bins (app.bin) are not compatible between nwjs versions (because the underlying v8 versions are not compatible), so the main adon version on public branch uses v0.47.2 version of nwjs, but the adon2024 uses v0.82.0. For future researchers: you can find current nwjs version used by your version of adon by running `window.process.versions` and looking for `node-webkit` version there.

2. Download nwjs v0.82.0 x64 for macos (osx)

Anyway, go ahead and download engine's version from here:

https://dl.nwjs.io/v0.82.0/nwjs-sdk-v0.82.0-osx-x64.zip

Make sure to not download arm version as it likely won't work. Even if you're on m1 like me, always download x64 because we have to stay as compatible with windows as possible, otherwise it will likely break during game startup and bin loading.

3. Remove quarantine attribute from downloaded nwjs app

You end up with zip archive containing nwjs.app file. Make sure to remove apple's quarantine attribute, otherwise you will get fake "app is corrupted" errors (apple wants to make you scary of files downloaded from the internet).

Just run: `xattr -d com.apple.quarantine [path/to/nwjs.app]` in your macos terminal.

4. Finally run ADON

You must use nwjs.app's internal executable to run adon, not the .app itself. As second argument, provide package.nw directory of At Dead Of Night local copy.

Example command (make sure to change to actual paths):


Now this will either work or not for you. Somehow it worked for me and I have still no idea why. Nwjs explicitly states that their bins are not crossplatform. But somehow it works anyway ¯\_(ツ)_/¯

JavaScript is weird. Good luck.
13 条留言
deeya 3 月 21 日 下午 1:04 
For anyone struggling with a black screen, porting it myself got it working (M1 MacBookAir). I installed the beta using wine, and then followed the instructions outlined.
TheWusBest 3 月 12 日 上午 8:48 
iMac 2017 4K, not iPhone:GDNormal::GDNormal:
VityaSchel  [作者] 2 月 19 日 上午 9:03 
Check system requirements, your phone might be too cheap
TheWusBest 2 月 15 日 上午 2:19 
the port just shows a black splash image and nothing more:GDNormal:
VityaSchel  [作者] 1 月 11 日 下午 3:07 
Dunno what's the issue, it was tested on my m1 pro macbook and some other person's mac M-series, might be hardware issue like slow disk or software like too many apps open and not enough ram (adon requires at least 4 free gb of ram)
losander161 1 月 11 日 上午 11:57 
its open but its frozen
losander161 1 月 11 日 上午 11:57 
its not working on my m4 mac mini
VityaSchel  [作者] 2024 年 12 月 9 日 上午 8:40 
your profile must be open to anyone in internet in order for library checker to work. that's steam requirement, I can't make it work without you publishing your games library for everyone, steam disabled oauth and only allows openid now
emcbatt 2024 年 12 月 6 日 下午 5:44 
why can't I sign in with steam
VityaSchel  [作者] 2024 年 11 月 3 日 上午 3:11 
No I just took original game's files and put them into macos container from nwjs