SteamWorld Dig 2 is a metroidvania game released in 2017, where the main mechanics is exploring an underground mine by digging and collecting resources. As opposed its predecessor, the levels are not procedurally generated, except for resources location. The present TAS finished the game as fast as possible by skipping upgrades and manipulate the level layout.
The above video contains commentaries as subtitles.

Game objectives

  • Emulator used: libTAS 1.3.1
  • Takes damage to save time
  • Uses death to save time
  • Heavy luck manipulation
  • Genre: Platform, Action, Adventure

Tricks

Double Jump

Like many modern platformers, this game implements "coyote time", i.e. when we walk off a platformer ledge, we can still jump for a few frames (6 frames in this game). However, it is also working when we leave the ground by jumping, so we can jump again for a few frames. The second jump velocity is not added to the first one, so we only gain a small additional height. In the context of a TAS, we are not limited to one extra jump. Moreover, we can alternate between a jump input from the keyboard and from a game controller. In the end, because the coyote time lasts 6 frames, we can jump for 7 consecutive frames to get the maximum height. This is the cause of the weird jump sound that you can hear on the video.
The most important use of this trick is the skipping of upper Temple of Guidance at the beginning of the run. We can escape this section and skip the first boss by using a double jump. The problem is that because we didn't enter El Machino town normally, Transport Tubes are not working. A solution is to enter another area (here Yarrow), which will unlock the option to self-destruct. It brings us back to town, so we can use Transport Tubes from here.

Hook Jump

The hook is a very powerful item in this game, and it combined very well with double jump. We can throw the hook horizontally to gain a high velocity. If we then release the hook and double jump at soon as we touch the ground, the double jump will gain the extra property that every jump input will have its vertical velocity added to the current one. So if we jump for 7 consecutive frames, we will have a 7-fold vertical velocity. This property holds as long as our horizontal velocity is high enough. In particular, we can chain multiple hook jumps. If we slowdown too much, the huge vertical velocity will be reset.

Jet Boost

This trick requires the hook, the jackhammer and its Slipstream Jet upgrade. When breaking a block with this upgrade, it pulls you forward. However, if you do this while having a high velocity from the hook, the obtained horizontal velocity will be massive (more than twice the hook velocity) for one frame, then the ground friction will cancel it. By jumping at that frame, we can keep the velocity in the air. Unfortunately, the jackhammer upgrade is obtained very late in the run (it is quite expansive).

Rosie phase skips

The last boss fight against Rosie is decomposed into 5 phases, each one can be ended when you throw back a rocket at her. Luckily, it is possible to skip most phase using the Aramid Armor upgrade. This upgrade deflects a projectile back, and has a cooldown of 30 seconds. By deflecting one of the little homing rockets and make it explode inside Rosie's hitbox, it will deactivate her shield, so you can end the phase early. It is not possible to do it on fourth phase because Rosie does not throw any little rocket. It should save a bit less than 2 minutes in the entire fight.

Routing

Routing is very important in this game genre, so here is the different aspects of the used route:

Necessary steps

The intended route of the game is to collect some upgrades, then destroy the first Device (Device of Doom) in the middle of the Temple of the Destroyer. Then the game tells us to reach Vectron at the bottom of Archaea. After completing Vectron, we obtain the Jetpack, which allow us to destroy three more Devices at the bottom of each area. Then we go to the final boss at the Oasis by taking a secret passage because the Transport Tube is deactivated.
The first timesaver is that we don't need the Jetpack to access the Devices. This cuts off a lot of time because we don't need to access and complete Vectron. This is an intended sequence break by the developers, as there is a Steam achievement for completing the game without accessing Vectron.
The second timesaver is that we don't need to destroy the first Device. Destroying the other three will unlock the door to the final boss. However, the cutscene won't trigger when you destoy the last Device, so the Transport Tube to the Oasis will still be available, for extra time saved! This is good news because the first Device is protected by a boss and a long area.
The last timersaver was mentioned earlier: we can skip the first boss and enter Yarrow from the beginning.

Items and Upgrades

We are collecting a certain amount of items and upgrades, either because they are needed, or because they save time in the run:
  • Speed boots: you cannot advance the game without them.
  • Lamp: we must buy it to unlock upgrades and to enter Archaea from the town.
  • Two bag upgrades: the first one is really cheap and can be bought together with the lamp. The second one saves time for the farming section at the bottom of the Temple of the Destroyer.
  • One pickaxe upgrade: it allows us to dig blocks in one hit at the top of Archaea. The second one would also save time but is more expensive.
  • Four armor upgrades: the third upgrade unlocks Vidar Boots, which makes us invulnerable to lava and acid for a short time. The fourth one unlocks Aramid Armor which is needed for the final boss. Vidar Boots is not much useful, but we must unlock it anyway so we use it when needed.
  • One water upgrade: without a third water bar, we would be short on water after the second Yarrow barrier, and we would have to dig 4 blocks with the pickaxe to access a Transport Tube and refill water. This would take way too much time.
  • Pressure Bomb: this is a mandatory item to open the two barriers of Yarrow.
  • One pressure bomb upgrade: every upgrade of the bomb increases its range by one tile, and we need one extra tile range for the second Yarrow barrier.
  • Jackhammer: technically, this item is not required, but it allows us to dig very fast
  • Two jackhammer upgrades: these upgrades are really expansive, but the first one makes us dig faster in the Temple of the Destroyer, and the second one unlocks Slipstream Jet which saves massive time on Yarrow.
  • Hook: mandatory to access the Devices (because we don't take the jetpack), and saves a lot of time anyway

Main route

We first collect the needed items: the pressure bomb from the top of Archaea, then the jackhammer which can be accessed from top Yarrow, and then the hook. After that, we have the choice on the order of the Devices to destroy. We start with the Device in the Temple of Guidance, because there is almost no digging involved, and a bit of money. Then we continue with the Device in the Temple of the Destroyer. There is a bit of digging, but we collect enough money to buy the first jackhammer upgrade. The last section has many ores, so we can collect enough money to buy the second jackhammer upgrade for Yarrow Device.

Area comments

West Desert

There is a $50 gem at the beginning, but it takes too long to take. We manipulate the breaking blocks so that they break early.

Temple of Guidance

We grab the Sprint Hydraulics, then enter the hidden passage to the lower temple, using a double jump. Ore location is determined at the first entry in an area, so we used the pickaxe here to advance the RNG and get the ore location we want for the next area.

Yarrow

We first unlock the Transport Tube here for later, and then self-destruct to return to the town and activate Transport Tubes. When we self-destruct, we loose at least half of our collected ores, so we can only keep one. The best one to keep is a Blood Rock from the snail, which is worth $23. We must also collect another ore so that we can keep the Blood Rock. After the self-destruct, we go back to Yarrow and take the bottom path to Archaea to unlock the Tube next to the jackhammer location. On our way, we need to collect as much money as possible, so I carefully chose the RNG seed by tweaking the initial system time to get 3 ores on our way without making a detour. We also kill the other snail for the experience and the Blood Rock. The XP route is very precise because levels add a bonus to the ore selling, so we must kill some enemies and sell ores as late as possible to get the maximum money.

Archaea

We just unlock the Tube and go to the town

El Machino

People are grouped for the cutscene when you enter the town normally, but you can still talk to them. We sell the ores and but the lamp, a pickaxe upgrade and a bag upgrade.

Archaea

We dig to the Pressure Bomb cave, taking advantage of all the holes in the layout.

Archaea - Burster's Station

After getting the pressure bomb, it is much faster to leave the cave from the entrance. We also kill an enemy for the XP.

Archaea

We self-destruct to access the town Tube and go to the first Archaea Tube we unlocked. We dig to the Jackhammer's cave.

Archaea - Mason's Station

There is a short skip in the second section: by destroying the block under the rock with a bomb, we have enough time to take the same path as the rock and not getting crushed. There is a $20 ore over the podium, but it would take too much time (and water) to take it.

Archaea

We killed one enemy to manipulate a water drop, it is faster than refilling at the water pond.

Oasis - Rosie's Storage

We take the ores here, and the cog on the way.

Temple of Guidance

We can use the hook together with the jackhammer to drill faster

Temple of Guidance - Chamber of Wheels

We have barely enough water to break the cog box. We use the pickaxe to manipulate the orbs in the next area.

Temple of Guidance - Chamber of Arrows

We need the orbs for the money, and we manipulate their trajectory so that we can catch them early. Getting between the two lines of arrows was difficult to do from that position.

Temple of Guidance - Device of Devastation

We would have saved time by having a water bar to throw a pressure bomb.

Archaea

We take a detour to grab a $30 ore, and head to the Temple of the Destroyer. We advance the RNG to get favorable ore placement in the Temple.

El Machino

We barely have enough money to buy the first jackhammer upgrade, which is very useful for the first section of the Temple of the Destroyer.

Temple of the Destroyer

Trying to get the "optimal" ore placement in the whole Temple is an impossible task, at least without a special method like reverse-engineering the ore placement code or writing a bot. Thus I chose the best among about 50 different locations for the first part of the Temple. So there is definitively possible improvement in this whole area. We needed enough money to buy the Vidar Boots and one bag upgrade before the Lava River. Then we have a farming section where we need $775 for the jackhammer, water and bomb upgrades.

Yarrow - Leaky Lodge

The still need money for the last armor upgrade, so we grab the two gems in this area. At the end, we use the fall damage to dig one block

Yarrow

We were lucky to find a $50 gem on the way. When the blocks are getting tougher, we manipulate water drops from the enemies to keep our gauge filled.

Yarrow - Aeronaut's Station

We use the pressure bomb with the increased range to skip this cave.

Oasis

With the armor upgrade bought and the Aramid Armor, we are ready for the final boss fight. We used the Aramid Armor as described above to shorten the boss phases.
Suggested screenshot: 28498

feos: I'm on the Linux spree! Judging...
feos: This was tough, but I consider this movie legitimate.
Both myself and fsvgm777 were able to get this to sync, even on the unmodified stable release of libTAS. The difference is just in how much time is needed for pauses so the thread that loads the level could properly finish. On high end machines this takes a few milliseconds, on my VM running on a very weak machine it was taking several dozen seconds. If loading takes less that 1/60th of a second, this may potentially be synced without pauses.
I don't believe that this movie explicitly abuses time pauses though (I need to note that libTAS pauses are not the same thing as pauses in emulation of the hardware: libTAS forces the game to pause by intercepting the game's interaction with the operation system API). There are no in-game tricks that pausing affects or enables. They are used only to make sure the level loading thread finished within a single frame.
This, in turn, is required fundamentally, because there yet is no way for libTAS to control such secondary threads: without this technique the game might not be TASable. And since level loading takes different time depending on the host computer specs, waiting arbitrary amount of frames in-game would introduce arbitrary sub-optimality, that may even fail to help if the host machine is just too weak. This is proven by the fact that the author used 1 second waits, while I had to increase the wait period to 50 seconds: with 10 seconds it wasn't finishing loading. So if the author waited the time that's enough for them, for others it might not be enough. And we can't be blindly accounting for all possible cases just by standing still in the level, because this damages the superplay value, and also because it may be impossible to account for literally all scenarios.
So since libTAS pause times can be easily adjusted when replaying, even without rebuilding the tool and using only manual pauses, this movie uses the most optimal waiting period - 0 in-game time. The main reason to allow it here is because it does not affect any TASable gameplay. If this movie is redone using a tool that can control secondary threads, everything should sync, aside from probably RNG changes. So they key point is that TAS input is valid in this movie, therefore it can be published.
Accepting to Moons, because the feedback was great.
fsvgm777: Processing.


TASVideoAgent
They/Them
Moderator
Joined: 8/3/2004
Posts: 15543
Location: 127.0.0.1
This topic is for the purpose of discussing #6112: keylie's Linux SteamWorld Dig 2 in 18:11.87
EZGames69
He/They
Publisher, Reviewer, Expert player (4454)
Joined: 5/29/2017
Posts: 2761
At first I thought it was going to be a slow mining game, but after every powerup it started to get more interesting. As soon as you got the grappling hook (which is my favorite item in any tas), I knew everything was about to get crazy. Was not disappointed. Yes vote.
[14:15] <feos> WinDOES what DOSn't 12:33:44 PM <Mothrayas> "I got an oof with my game!" Mothrayas Today at 12:22: <Colin> thank you for supporting noble causes such as my feet MemoryTAS Today at 11:55 AM: you wouldn't know beauty if it slapped you in the face with a giant fish [Today at 4:51 PM] Mothrayas: although if you like your own tweets that's the online equivalent of sniffing your own farts and probably tells a lot about you as a person MemoryTAS Today at 7:01 PM: But I exert big staff energy honestly lol Samsara Today at 1:20 PM: wouldn't ACE in a real life TAS just stand for Actually Cease Existing
Joined: 5/13/2013
Posts: 180
I don't believe it! I DONT FREAKING BELIEVE THIS!!! AT LONG LAST, CURRENT GENERATION PC GAMES CAN BE SUPERPLAYED!!!! I CAN FINALLY DIE COMPLETELY HAPPY!!!!! Now all we need to do is find a way to run Garry's Mod Half Life 2 on Linux, and we can finally have official Half Life TASes without the need for timescale adjustments...
A wise man once said "Damn, that's one hell of a steak."
Memory
She/Her
Site Admin, Skilled player (1551)
Joined: 3/20/2014
Posts: 1765
Location: Dumpster
Nice work, I liked the clever usage of the hook shot.
[16:36:31] <Mothrayas> I have to say this argument about robot drug usage is a lot more fun than whatever else we have been doing in the past two+ hours
[16:08:10] <BenLubar> a TAS is just the limit of a segmented speedrun as the segment length approaches zero
Moderator, Senior Ambassador, Experienced player (906)
Joined: 9/14/2008
Posts: 1014
I've played this game to completion and I have to say it's one of my favorite PC games. I can attest that the routing and mechanics are well executed in this run and this gets a resounding Yes vote from me.
I was laid off in May 2023 and became too ill to work this year and could use support via Patreon or onetime donations as work on TASBot Re: and TASBot HD is stalled. I'm dwangoAC, TASVideos Senior Ambassador and BDFL of the TASBot community; when healthy, I post TAS content on YouTube.com/dwangoAC based on livestreams from Twitch.tv/dwangoAC.
Site Admin, Skilled player (1250)
Joined: 4/17/2010
Posts: 11473
Location: Lake Char­gogg­a­gogg­man­chaugg­a­gogg­chau­bun­a­gung­a­maugg
If I just manually pause on those frames, how long do I need to wait before unpausing? Hacking the tool in such a manner to force a workaround for a specific game, while isn't too new in nature (plugin based emulators had tons of optional per-game hacks, and it was a terrible approach), still feels like there are more general or softer solutions. Of course there's no scripting support, in regular emulators we could just make a lua script that pauses emulation on specific frames. But how did you get those frame numbers? Maybe the way you got them can be generalized, and there'd be an option to just pause the tool each time a certain event is detected (like creating an uncontrolled thread in this case, if I'm reading it right)?
Warning: When making decisions, I try to collect as much data as possible before actually deciding. I try to abstract away and see the principles behind real world events and people's opinions. I try to generalize them and turn into something clear and reusable. I hate depending on unpredictable and having to make lottery guesses. Any problem can be solved by systems thinking and acting.
keylie
He/Him
Editor, Emulator Coder, Expert player (2838)
Joined: 3/17/2013
Posts: 392
feos wrote:
If I just manually pause on those frames, how long do I need to wait before unpausing?
About 0.2 seconds I would say, on my computer.
feos wrote:
But how did you get those frame numbers? Maybe the way you got them can be generalized, and there'd be an option to just pause the tool each time a certain event is detected (like creating an uncontrolled thread in this case, if I'm reading it right)?
I got those frames because the game outputs its own log in the console. I could easily see at which exact frame the game is loading another stage. Yes, I could generalize this for standard situations, for example if the game spawns a loading thread to load the next level, I could detect such thread and wait until it has complete. This would work because the game is using library functions in the process of loadings. I even coded this behavior in libTAS some time ago. But the problem is: I didn't see any game that follows a pattern that can be visible by libTAS. If we take this game, it spawns the loading thread from the beginning and that thread is given tasks to do in a way that seems invisible to libTAS. I studied another game: Celeste. Because it is coded in C#, we have access to its code. By looking at the level loading procedure, I saw that the loading thread is given tasks by simply changing local variables. This is uncatchable by libTAS in a general matter. It should be possible to add some code to make those manual pauses for SWD2, but it would work only for that game (basically a hack).
Site Admin, Skilled player (1250)
Joined: 4/17/2010
Posts: 11473
Location: Lake Char­gogg­a­gogg­man­chaugg­a­gogg­chau­bun­a­gung­a­maugg
I can;t get this to sync no matter what I do. With the patch, with manual pauses, with libtas 1.3.1 and interim, with touched and untouched game config (the only part changed was fullscreen). The fact that it runs at 1-2 fps on my vm doesn't help. Game version and hash match.
Warning: When making decisions, I try to collect as much data as possible before actually deciding. I try to abstract away and see the principles behind real world events and people's opinions. I try to generalize them and turn into something clear and reusable. I hate depending on unpredictable and having to make lottery guesses. Any problem can be solved by systems thinking and acting.
fsvgm777
She/Her
Senior Publisher, Player (225)
Joined: 5/28/2009
Posts: 1213
Location: Luxembourg
For what it's worth, I could get it to sync with the patch mentioned in the annotations. So it's at least theoretically possible to get it to sync in vanilla libTAS. EDIT: I managed to get it to sync on libTAS 1.3.1 (stable release) by manually pausing at the specific frames (plus one frame) provided in the code!
Steam Community page - Bluesky profile Oh, I'm just a concerned observer.
Site Admin, Skilled player (1250)
Joined: 4/17/2010
Posts: 11473
Location: Lake Char­gogg­a­gogg­man­chaugg­a­gogg­chau­bun­a­gung­a­maugg
I tried to sync it with manual pauses and failed, then with sleep(10) and failed. After fsvgm777's success with the patch, I boosted wait up to 50 seconds! And it worked! https://i.imgur.com/Y3KVunD.png So it seems to heavily depend on one's PC specs. Keylie and fsvgm can get it to sync with sleep(1), and for the latter it runs at several dozen frames per second. I only get sub 1fps. So manual pauses I was doing were probably too short for the loader thread to properly finish. On an even better PC, would it be possible to not need pauses at all? Like the secondary thread would finish in real time as fast as possible, and optimal right away.
Warning: When making decisions, I try to collect as much data as possible before actually deciding. I try to abstract away and see the principles behind real world events and people's opinions. I try to generalize them and turn into something clear and reusable. I hate depending on unpredictable and having to make lottery guesses. Any problem can be solved by systems thinking and acting.
keylie
He/Him
Editor, Emulator Coder, Expert player (2838)
Joined: 3/17/2013
Posts: 392
Sorry, it took me a long time before testing this. On my computer (Intel Core i3-4330 CPU @ 3.50GHz) using a native Linux (Debian Buster), the time to load levels takes between 100 ms and 250 ms, depending on the level and variability. I tested on a friend's computer (AMD Ryzen Threadripper 1950X), but inside a Ubuntu 18.04 VM, and it reports the same results (between 100 and 250 ms).
Post subject: Movie published
TASVideoAgent
They/Them
Moderator
Joined: 8/3/2004
Posts: 15543
Location: 127.0.0.1
This movie has been published. The posts before this message apply to the submission, and posts after this message apply to the published movie. ---- [3827] Linux SteamWorld Dig 2 by keylie in 18:11.87