(Link to video)
Submission Text Full Submission Page
The idea of beating a game with no input is a compelling one, arguably allowing for perfect speedruns. However, most games in which this is possible are rather trivial. More interesting still is the idea of a game which can be completed without ever even gaining control of the character; although a game that could be won this way would likely be pointless, it turns out that there are highly-regarded games that can be lost this way.

About the game

NetHack is an old yet highly regarded RPG. Despite originally being released in 1987, it is still widely played nowadays; the most recent version, 3.4.3, was released in December 2003. Two of its properties make it particularly suited to TASing: the entire game is balanced around the idea that you cannot undo actions and cannot go back to save (and thus tends to be broken wide open merely via the use of savestates), and almost anything in the game can be luck-manipulated without spending in-game time (although it can take some time in real-time), meaning that almost anything can be caused to happen.

Replaying the run

This run plays back on JPC-RR version 11.4, but some settings changes are needed. In order to get the game to emulate correctly, you need to turn on the "shorten pipeline on self-modifying code" option (although the emulator should turn it on automatically); this is absolutely necessary as NetHack assumes the processor has a shorter pipeline than JPC-RR uses by default. Additionally, NetHack is a DPMI game; the normal way to run these on real hardware is to add a DPMI extender (such as the one that comes with Windows, or CWSDPMI) to an otherwise normal DOS system. The same thing can be done on JPC-RR to get it to emulate such games, but unfortunately most extenders don't emulate correctly. Thus, I added HDPMI32 (available via the HX website), and run it on the emulated system, to allow NetHack to load; it's the only DPMI extender I know that JPC-RR emulates correctly. (The choice of extender should be irrelevant to how the game plays, although may affect sync slightly due to lag as the extender is loading.)

Game objectives

  • Emulator used: JPC-RR 11.4
  • Dies before gaining control of the character
  • Contains speed/entertainment tradeoffs
  • Takes damage to save time make the run possible in the first place
  • Uses death as a category
  • Does nothing but skip or space through cutscenes while the game actually runs
  • Ends input as soon as possible under the above restrictions
  • Does not pass Go

Comments

Following a discussion on IRC (which I thought was between me and Nach, but if it was I can't find it in my logs), the topic came up of which endings to a game are really considered wins. The NetHack community only considers the best ending, "ascension", a win; but the game itself does not define what counts as a win or a loss, and the comment /* super big win */ in the source code next to the code for ascension implies that there may well be other, less super big, sorts of win.
I'm not entirely sure if dying before you gain control of the character counts as a win, but it has to count for something.
Of course, a game where you routinely never gained control of the character would not really be particularly fun to play; in fact, it would be considered more of a video than a game. (Admittedly, this seems to be the goal of some modern RPG designers, but NetHack is not like that.) In NetHack, a death this early has an extremely low probability (almost certainly below 1 in a million, although it's hard to calculate); although the exact rerecord count was lost in a computer crash, I spent over 4 million (and probably around 4 and a half million) automated rerecords aiming for it, using nethack-tas-tools (the project I'm working on with dwangoAC to produce our joint serious TAS of Nethack, which is still a WIP; although I think this run was done entirely with my own code). The run was converted to JPC-RR format after it had been produced.
Everything happens so fast that it may be difficult to follow what's going on, so here's an explanation: first I TAS the FreeDOS boot process in an attempt to end input as soon as possible, then I start HDPMI32 and NetHack, then I load the keyboard buffer with keystrokes necessary to skip cutscenes and clear message boxes, then I end input, then the game loads. (It's a pity JPC-RR doesn't put up the "Movie end" overlay.) The speed/entertainment tradeoff in the run is that I don't skip the game-over cutscene, but instead space through it as fast as possible; I could and the run would go slightly faster, but then it would be almost impossible to see what had happened at all. (Change the last three presses and releases of space, to a press and release of escape, to skip that cutscene too and get a marginally faster run.) In the game itself, a female Tourist comes into the dungeon, finds a shiny artifact silver saber (Grayswandir) on the stairs she entered by (probably the most unlikely thing to manipulate in the run), picks it up (the default options pick up all items you come across), takes damage from touching the artifact (a 1 in 4 chance for an unintelligent crossaligned artifact like the lawful Grayswandir for a neutral Tourist; there are no intelligent artifacts capable of spawning there), and dies from the damage (around a 52% chance for a starting Tourist due to their low starting hitpoints, much lower or even zero for other characters). The game's turn counter says 1, but it always says that before the first turn, and we get the "Do not pass go" message that normally comes from dying on the first turn, a whole turn later than when we actually die (although the message never appears onscreen, as it's skipped by the Esc in the keyboard buffer).
The luck manipulation itself was done by changing the system date and time, which are used to seed the random-number generator.
Some questions people familiar with TASing might be wondering about: the reason there's an unusually long pause after the "e" of "nethack" is that I was tab-completing its name in order to be able to fit more into the keyboard buffer and end input earlier (although it delays the movie end somewhat); the reason that the character selection is specified on the command line, rather than in-game (which would be faster in terms of ending input) is that I don't want to have any control over the character at all once the game's loaded; and the reason that the Tourist is female rather than male is a parser abuse (the "correct" way to specify female is to write "-fem" at the end of the name, and to specify male is to write "-mal", but "-f" is recognised as female and "-m" as choosing a Monk, so the gender was forced to save one keystroke).
Some questions people familiar with NetHack might be wondering about: the item on the starting stairs is picked up via autopickup (which is non-time-consuming (thus the blast happens before the first player action of turn 1, on an effective "turn 0"), and controlled by a game option). The default setting for autopickup in the DOS version of NetHack 3.4.3 is on, thus I had no need to change the options; this run uses the default options. Additionally, there is a bug in NetHack 3.4.3 that causes items on the starting stairs to be autopicked up even if the autopickup option is turned off, so the setting of the option is actually irrelevant to the run. Although I haven't checked, I believe that a sensible pickup_types option setting (that excluded weapons, almost universally true among NetHack players who customize it) would prevent the artifact being autopicked up.

Probability of this happening

The item generation algorithm is actually room-based; it seems that apart from a few special cases (which don't apply here), and excluding certain item types like chests and scrolls of teleport that have other codepaths via which they can also generate, there is a 1 in 3 chance of items in any given room, with a 4 in 5 chance of one item, 4 in 25 of two, 4 in 125 of three, 4 in 625 of four, etc. (Things like stacks of 7 candles count as just one item, internally.) Then a random location in the room is chosen for each item, in order to place it.
In order to determine the chance that we get an item on the upstairs, we need to calculate the average area of a room. The level generation algorithm makes this very hard to calculate, as it depends on a huge number of things, but on dungeon level 1 it seems most likely to use the "completely random" algorithm, which it tries first before constraining things in order to increase the chance that the room can be placed. This gives a width of 3 to either 14 or 10 inclusive, depending on how much space is available; and a height of 3 to 6 inclusive, with (width-1)*(height-1) capped at 50 by reducing the height. Let's approximate the width as the range 3..14 as there will typically be a lot of space on the level when placing just a few rooms; then trying all combinations, and taking the harmonic average of the areas (necessary because we're trying to find the expectation of 1/area), we get an average area of about 28.149. On average, we have about 0.4167 items per room, so the chance that any item generates on the upstairs is approximately 1 in 67.5.
For any given item, the first thing that is generated is its item type (all randomly generatable artifacts are weapons, so 10% chance of a weapon); then the base item is chosen. The base items of randomly generatable artifacts, and the chance the base item has of generating given that a weapon generates: Demonbane*, Sunsword*, Giantslayer, Vorpal Blade, Fire Brand, Frost Brand = long sword (5%), Grayswandir*, Werebane = silver saber (0.6%), Snickersnee* = katana (0.4%), Cleaver = battle-axe (1%), Magicbane = athame (0%), Mjollnir, Ogresmasher = war hammer (1.5%), Grimtooth* = orcish dagger (1.2%), Orcrist* = elven broadsword (0.4%), Sting* = elven dagger (1%), Stormbringer* = runesword (0%), Dragonbane = broadsword (0.8%), Trollsbane = morning star (1.2%). (Note that some artifacts are marked as randomly-generatable, but don't because their base items don't generate.) The artifacts that can blast neutrals are shown with asterisks; a random weapon has a 5% chance of being an artifact if possible, so the chance that a random weapon can blast neutrals is (0.05*2/6 + 0.006/2 + 0.004 + 0.01 + 0) * 0.05 = about 0.001683333. Taking into account the 10% chance the item is a weapon, and the average 1/67.5 number of items that generates on the upstairs at all, we can calculate the chance of a blasting artifact at about 1 in 400000.
Finally, this needs to be combined with the 1 in 4 chance that the artifact actually blasts the character (only unintelligent artifacts can be spawned this way, as intelligent artifacts either don't generate randomly or have a base type that doesn't generate randomly), and the approximately 52% chance that the blast does enough damage to kill a starting Tourist, to get a final probability of 1 in 3 million.

Stage by stage comments

I never gain control of the character, so these are kind-of pointless.

Other comments

Obviously, this is not the most entertaining category for this run, but it's still pretty surprising. (I'm currently working on a "best ending, in-game time" TAS with dwangoAC.) In this category, though, I wouldn't be surprised if the run was completely optimal, due to the narrow definition of what is allowed; to beat it, either a faster route will have to be found (which seems really implausible), a different keystroke sequence to get the same effect (possibly more plausible), or a faster TAS of the boot process (which is obviously irrelevant, but could affect the time; this is the best I can do, although it's plausible that someone else could figure out a faster way to boot DOS).
Encoders, please allow the game to run back to the command prompt before ending the encode, or you'll cut out the entire game. (NetHack's credits are shown in-game by pressing V, rather than coming up at end-of-game, so those can't easily be included.)

DarkKobold: Claimed.

DarkKobold: This is clearly a funny concept, and probably the best April Fools submission of 2011... but it really doesn't follow the rules of the site:

The movie must be complete

Your movie should begin from the console power-on and end when the last decisive action has been delivered. There are no specific rules for an exact endpoint but it must adhere to the following rules:
  • It must beat the game.
  • It must be able to reach the credits or end screen without the viewer needing to do anything; all input must come solely from the input file (e.g. configuring the emulator to autofire after the end of playback is not allowed). An exception has been allowed for Rygar.
  • It must not be needlessly long.
Under special consideration we might allow movies that play a single level only or a part of the game only.
While one might say that it plays only part of the game, the run ... doesn't really. It doesn't actually even get a chance to play any of the game! Amusing concept, great execution, but I don't see it fitting with the site. Rejecting for goal choice.

Joined: 1/26/2009
Posts: 558
Location: Canada - Québec
C:\>date
Current date is Wed 04-14-2004
I guess this might be an useful date to keep in mind...
mklip2001 wrote:
I showed this to a few of my friends who play NetHack a lot. They thought it was quite impressive, though they felt it was more like "cheating" because auto-pickup was turned on.
I managed to sync the game by editing the dafault.nh file with this line: OPTIONS=boulder:0, !autopickup Somehow the character still die with the same message. This is kinda weird... the saber should be left untouched, right? Then, I made a new game to make sure that my !autopickup option was working and as far as I see, the item on the floor stay on the floor when the character walk over it. I'm unsure why the artefact is triggering this effect right away, but the result is great for this TAS. Yes vote.
Joined: 4/30/2008
Posts: 39
Double bonus points for it being basically the ideal weapon to boot. Can we see the full message log? The first thing that comes to mind is that there's something funny about turn 0, and an item on the starting stairs gets added to your inventory, which then blasts you. I think you can get blasted by 'feeling' an item on the ground as well, but I'm guessing it's just an untested case. I can see where you would call it 'cheating', if it was dependant on autopickup, as you would still die before gaining control of your character, but after performing an action. I certainly wouldn't disqualify this over such a trivial point, though.
Joined: 2/19/2010
Posts: 248
autopickup is part of the game. it's not cheating at all. if you want optimal play, you have to use it, because it lets you pick up items without spending turns to do it -- it might be considered exploitative, but it's definitely not cheating. Furthermore, what the NetHack community considers to be "cheating" differs wildly from what the TASing community considers as "cheating". Savestate abuse, for example.
Banned User, Former player
Joined: 3/10/2004
Posts: 7698
Location: Finland
rhebus wrote:
autopickup is part of the game. it's not cheating at all.
Especially if, like the description says, it's the default option rather than an option you have to turn on.
Editor, Player (44)
Joined: 7/11/2010
Posts: 1022
Warp wrote:
rhebus wrote:
autopickup is part of the game. it's not cheating at all.
Especially if, like the description says, it's the default option rather than an option you have to turn on.
Most people actually turn it off (even though the default in the official version is on), partly because of this sort of thing, but more because there are all sorts of things you don't actually want to pick up. Artifacts are rare, but carrying around heavy corpses or statues doesn't really do much for a character's lifespan. It's also far from uncommon to patch the game to make the option a bit more discriminate. (It can be made a bit more discriminate in the official version of NetHack, but there's a common patch that makes it even more so.) EDIT: Note also that autopickup isn't an action, or at least not a time-consuming action. Manual pickup takes 1 turn, but autopickup takes 0. As for people wondering what the run would look like played more slowly, here's what text you get if no cutscenes are skipped and all endgame messages are viewed:
                 It is written in the Book of The Lady:
                 
                     After the Creation, the cruel god Moloch rebelled
                     against the authority of Marduk the Creator.
                     Moloch stole from Marduk the most powerful of all
                     the artifacts of the gods, the Amulet of Yendor,
                     and he hid it in the dark cavities of Gehennom, the
                     Under World, where he now lurks, and bides his time.
                 
                 Your goddess The Lady seeks to possess the Amulet, and with it
                 to gain deserved ascendance over the other gods.
                 
                 You, a newly trained Rambler, have been heralded
                 from birth as the instrument of The Lady.  You are destined
                 to recover the Amulet for your deity, or die in the
                 attempt.  Your hour of destiny has come.  For the sake
                 of us all:  Go bravely with The Lady!
                 --More--
Aloha 5, welcome to NetHack!  You are a neutral female human Tourist.--More--
You are blasted by the silver saber named Grayswandir's power!--More--
You die...  Do not pass go.  Do not collect 200 zorkmids.--More--
Do you want your possessions identified? [ynq] (n)
                                Weapons
                                a - 37 +2 darts (in quiver)
                                Armor
                                m - an uncursed +0 Hawaiian shirt (being worn)
                                Comestibles
                                b - 2 uncursed tripe rations
                                c - 3 uncursed food rations
                                d - an uncursed banana
                                e - 2 uncursed fortune cookies
                                f - an uncursed carrot
                                g - 2 uncursed cream pies
                                h - an uncursed tin of jackal meat
                                i - an uncursed pancake
                                Scrolls
                                k - 3 uncursed scrolls of magic mapping
                                l - a blessed scroll of magic mapping
                                Potions
                                j - 2 uncursed potions of extra healing
                                Tools
                                n - an expensive camera (0:43)
                                o - an uncursed credit card
                                (end) 
Do you want to see your attributes? [ynq] (n)
                                                    Final Attributes:
                                                    
                                                    You were nominally aligned.
                                                    You are dead.
                                                    --More--
Do you want to see your conduct? [ynq] (n) 
                                           Voluntary challenges:
                                           
                                           You went without food.
                                           You were an atheist.
                                           You never hit with a wielded weapon.
                                           You were a pacifist.
                                           You were illiterate.
                                           You never genocided any monsters.
                                           You never polymorphed an object.
                                           You never changed form.
                                           You used no wishes.
                                           --More--
                       ----------
                      /          \
                     /    REST    \
                    /      IN      \
                   /     PEACE      \
                  /                  \
                  |        5         |
                  |      771 Au      |
                  |    killed by     |
                  |     touching     |
                  |   Grayswandir    |
                  |                  |
                  |       2004       |
                 *|     *  *  *      | *
        _________)/\\_//(\/(/\)/\//\/|_)_______


Aloha 5 the Tourist...

You died in The Dungeons of Doom on dungeon level 1 with 0 points,
and 771 pieces of gold, after 1 move.
You were level 1 with a maximum of 10 hit points when you died.

--More--
 No  Points     Name                                                   Hp [max]
             0  5-Tou-Hum-Fem-Neu died in The Dungeons of Doom on              
                level 1.  Killed by touching Grayswandir.               -  [10]
GabCM
He/Him
Joined: 5/5/2009
Posts: 901
Location: QC, Canada
My shortest encode ever. SD Stream SD Download HD Stream I vote Yes for this funny run. And also, this very run beat my April Fool's submission, making mine the 2nd most viewed of them.
Joined: 4/30/2008
Posts: 39
Hmm, so just 'You are blasted.' Very odd. Even if it doesn't take energy, (IE, a turn), it still can be an action if it affects the state of the dungeon. But again, I'm not complaining about it. I'm just saying that it's your character doing something, not getting zapped by a monster or something. Except that you aren't actually doing something. Again, very odd.
Masterjun
He/Him
Site Developer, Skilled player (1971)
Joined: 10/12/2010
Posts: 1179
Location: Germany
Mister Epic wrote:
My shortest encode ever. SD Stream SD Download HD Stream I vote Yes for this funny run. And also, this very run beat my April Fool's submission, making mine the 2nd most viewed of them.
I liked the "This was a tool-assisted recording" :D
Warning: Might glitch to credits I will finish this ACE soon as possible (or will I?)
upthorn
He/Him
Emulator Coder, Active player (388)
Joined: 3/24/2006
Posts: 1802
This is very impressive, I really like the idea of this being published as a luck manipulation concept demo.
How fleeting are all human passions compared with the massive continuity of ducks.
Banned User, Former player
Joined: 3/10/2004
Posts: 7698
Location: Finland
I suppose the game has been programmed so that even though everything is randomly generated, it's not possible to get the Amulet of Yendor on the first level?
Joined: 8/3/2004
Posts: 380
Location: Finland
This was pretty awesome. I wouldn't have even thought that it was possible to die before doing anything.
"Kids! Bringing about Armageddon can be dangerous. Do not attempt it in your home." ( Pratchett & Gaiman: Good Omens )
Patashu
He/Him
Joined: 10/2/2005
Posts: 4017
Warp wrote:
I suppose the game has been programmed so that even though everything is randomly generated, it's not possible to get the Amulet of Yendor on the first level?
It's highly random, but not to that extent.
The amulet is possessed by the high priest of Moloch at the bottom of Gehennom. To reach it, however, the player needs several other items, known as the invocation artifacts. They are the Book of the Dead, Candelabrum of Invocation and the Bell of Opening.
It makes me wonder - can any roguelikes be won on the first turn? How about in the first 100 turns? (Let's say not counting mystery dungeon-alikes.)
My Chiptune music, made in Famitracker: http://soundcloud.com/patashu My twitch. I stream mostly shmups & rhythm games http://twitch.tv/patashu My youtube, again shmups and rhythm games and misc stuff: http://youtube.com/user/patashu
Joined: 7/2/2007
Posts: 3960
Angband can theoretically get you down to the bottom of the dungeon (where Morgoth, the final boss, lurks) in 53 turns (go down staircase, grab adjacent stack of scrolls of Deep Descent, read 'em all), but he has 12k hitpoints and your average high-level character is happy to be dealing 600 damage/round if all attacks hit, which they don't usually. And of course you're only level 1 at this point. I think it'd be doable inside of 500 turns, though the amount of research required to find a good starting RNG seed is insane.
Pyrel - an open-source rewrite of the Angband roguelike game in Python.
Editor, Player (44)
Joined: 7/11/2010
Posts: 1022
Warp wrote:
I suppose the game has been programmed so that even though everything is randomly generated, it's not possible to get the Amulet of Yendor on the first level?
I think it's actually possible to use the cream pie bug (applying a wielded cream pie corrupts memory) to glitch a ring of regeneration into the Amulet of Yendor within the first ten turns or so, and without ever moving from the upstairs. I haven't tried this yet, though (I was trying to do something even more insane with the glitch, but it wasn't working). The glitch is one that I'll be categorising out in my full-game run (that's currently in progress), as seeing the game done without memory corruption is probably more interesting. If you ignore memory corruption, it isn't possible to get a random Amulet of Yendor, as its spawn chance is zero. (Likewise for other plot-relevant items, other than candles.)
Joined: 3/11/2008
Posts: 583
Location: USA
This would be slightly more interesting if you posted the odds of generating a blasting artifact on the upstair. Break it down if need be an item on the upstair (...items/squares in rooms?) a weapon(*10%) is it an artifact?(*5%) which artifact (8/19 will kill a neutral, if I understand it rightly, one of which(Stormbringer) bypasses the 1/4 chance by being intelligent. Grayswandir would then be 1/19) (I'm not intimately familiar with the item generator, so this may be wrong-ordered, but spoilers are well-written.) am I reading correctly that Excalibur can't be randomly generated? It would make it an even 20 artifacts generatable. For added value to other watchersreaders of this run, please note that most Nethack players consider Grayswandir to be the best weapon offensively in the game, dealing double damage to everything, as well as silver damage (+d20) to most demons and undead.
Joined: 6/8/2005
Posts: 236
Location: Madison, Wisconsin
Nethack is really unfair. I managed to live two turns this game. http://alt.org/nethack/userdata/S/SaxxonPike/dumplog/1283296947.nh343.txt
Editor, Player (44)
Joined: 7/11/2010
Posts: 1022
eternaljwh wrote:
This would be slightly more interesting if you posted the odds of generating a blasting artifact on the upstair.
Agreed that it is an interesting calculation; I've added it to the submission. It seems to be around 1 in 3 million, most of which is the low chance of a suitable artifact generating.
Banned User, Former player
Joined: 3/10/2004
Posts: 7698
Location: Finland
ais523 wrote:
I think it's actually possible to use the cream pie bug (applying a wielded cream pie corrupts memory) to glitch a ring of regeneration into the Amulet of Yendor within the first ten turns or so, and without ever moving from the upstairs.
It sounds very strange that they haven't fixed such a bug (given that the game is open source and all). (Btw, you probably want to remove your repeated posts.)
Editor, Player (44)
Joined: 7/11/2010
Posts: 1022
There doesn't seem to be an option to do that; presumably a moderator could do it for me? (It wasn't deliberate, seems to be a side-effect of trying to post during the site problems.)
Joined: 4/30/2008
Posts: 39
Warp wrote:
It sounds very strange that they haven't fixed such a bug (given that the game is open source and all).
It may be open source, but fixes generally end up in varient versions, rather than in vanilla.
sgrunt
He/Him
Emulator Coder, Former player
Joined: 10/28/2007
Posts: 1360
Location: The dark horror in the back of your mind
Warp wrote:
It sounds very strange that they haven't fixed such a bug (given that the game is open source and all).
NetHack's official releases happen on a mysterious schedule; we haven't had an official release since late 2003. There are a large number of bugs which apparently have been fixed for the next release.
Joined: 4/30/2008
Posts: 39
Quite the list indeed.
Editor, Player (44)
Joined: 7/11/2010
Posts: 1022
Kofiman wrote:
For bonus points, figure out the difference between 'Fixed' and 'fixed'.
I know that one; it's the difference between fixes targeted at 3.5 and 3.4.4. Not that it seems likely that either will ever be released, at this rate...
Banned User, Former player
Joined: 3/10/2004
Posts: 7698
Location: Finland
I don't know exactly why, but I somehow don't like the idea of a TAS of this game that abuses bugs (at least memory corruption bugs), as those bugs may well be fixed in a future release. I like ais523's principle of not abusing the bug in the future run.
Patashu
He/Him
Joined: 10/2/2005
Posts: 4017
Warp wrote:
I don't know exactly why, but I somehow don't like the idea of a TAS of this game that abuses bugs (at least memory corruption bugs), as those bugs may well be fixed in a future release. I like ais523's principle of not abusing the bug in the future run.
Nethack hasn't been updated for years and years and years. It's safe to say any bugs in it are going to stay with it, except in fan made patches/mods. Besides, an update is going to do more than just fix glitches - you'll have to remake the run regardless.
My Chiptune music, made in Famitracker: http://soundcloud.com/patashu My twitch. I stream mostly shmups & rhythm games http://twitch.tv/patashu My youtube, again shmups and rhythm games and misc stuff: http://youtube.com/user/patashu