Introduction
This is my first TAS.
I've been working on Alone in the Dark for several years (since late 2015) with LotBlind and NHG. There's an official topic and guide on Speed Demo Archive if you want more information.
After NHG published its run (2016), some of us continued to discuss the game privately (for many years).
Game objectives
Trigger the end as quickly as possible (by beating Pregzt and getting out of the mansion).
Routing
Based on the NHG run (6:21). Here are a few improvements:
- The crack on the 3rd floor can be skipped by entering the inventory and introducing a lag. This causes a snap (e.g. a move by a large offset), allowing to pass over the crack.
- Similarly, the space snap can be used to rotate the player suddenly, in a single frame (up to a maximum of 90 degrees).
- Fast rotation allows the player to turn twice as fast when running (can only be used for the first 90 degrees).
- Instead of opening the doors to exit the library, you can clip yourself against the doors.
Glitches used
- It is possible to run through certain walls due to a glitch in the collision engine.
- Nightgaunts on the 3rd floor can be avoided by touching the triggers leading to the 2nd floor when the camera is not focused on the player.
- Gravity can be deactivated by interrupting the jumping action (e.g. by dropping an object on the ground).
Things more difficult than expected
- The lantern cannot be picked up at the beginning because the game hasn't been running for more than 5 seconds. There's a mechanism that prevents an object from being picked up if it's been found recently. Most players and speed runners will never experience this mechanism as it only occurs after a cold start and timers are not reset when a new game is started.
- After taking the stairs or tunnels (in the attic or cave), the player sometimes immediately returns to the previous room/floor. This is due to the game running faster than it should. One way to alleviate this issue is to optimize/delay things a little (as this is related to FPS periodically going up and down) or to enter the trigger from a slightly different angle (this works for the cave entrance). If you're unlucky, you'll need dozens of tries to get it right.
- It is not possible to edit a previous segment as the slightest change will always result in desync. Even pressing keys or moving the mouse in past frames (which have no impact on the gameplay) will result in a desync.
- Similarly, optimizing interaction with inventory is difficult because the number of frames to do something varies (e.g. moving the current object down may take 2 or 5 frames).
PCem / libTAS synchronization
Some of the problems reported above are due to the fact that the game is not synchronized with libTAS.
One frame in libTAS will translate into 2 or 3 frames in AITD. Additionally, a new frame in libTAS will almost never start at the beginning of a frame in AITD, but rather somewhere in the middle.
This is because libTAS runs at 100 FPS to match PCem's 10 ms increments, whereas the game runs at 70 FPS. The game uses vertical synchronization, but this is a kind of spin-wait that cannot be detected by libTAS. On top of this, there's a bug in the game that causes FPS to exceed 70 FPS every 2 seconds (e.g.: 70, 292, 69, 287,...). The game should cap at 70 FPS.
PCem v17+st-2
can be used to improve this. This is a special version that allows a specific framerate to be used in libTAS (to match the game's framerate). Using this version and a patched game executable (to cap it at 70 FPS), make game frames to be 1:1 with libTAS. This makes everything much easier to control (and in finer gradients).
At the time of writing, PCem v17+st-2
is not authorized by tasvideo.org. Moreover, this patch is not official (it may not be approved).
Special thanks
LotBlind on SDA (this run wouldn't have been possible without him, many of the tips came from our internal discussions) and the tasvideo.org Discord community (the guys there were very helpful).
eien86: Claiming for judging.