A TAS of NetHack is something that the NetHack community have been interested in for a while, probably ever since RNG exploits (what TASers call luck manipulation) became widely known. (NetHack is one of the few games that can be sensibly luck-manipulated in realtime.) Due to some work on JPC-RR by Ilari and I, it now emulates properly, and so I'm interested in starting (or maybe in aiding someone else, if someone else is interested). As a bonus, the game is open-source and a free download, so it's easy both to test theories about how the game works, and to download the equivalent of a ROM legally.
For those who don't know about NetHack, it's a very old "roguelike" game; vaguely similar to an RPG, except that there's basically no plot (mostly a plus for TASing beacuse it means no long cutscenes to sit through, slightly a minus because it reduces the opportunities for interesting sequence-breaks), and that pretty much everything in the game is random and thus luck-manipulatable (a huge plus). It does, however, date from before graphics and music were common in games, instead using ASCII art to show what's going on, possibly making it less accessible to people who haven't played it before (but good commentary could help to explain a lot). Still, it should be clear even to people who haven't played it before that something crazy is going on.
Before even starting a run, there are various things to consider. One is the goals of the run: the only sensible ones are a typical any% (going for minimum realtime), a glitched any% (glitches exist in the game that allow basically the entire game to be skipped, although exploiting them is rather fiddly), and a playaround (luck manipulation lets you do almost anything in this game, including colouring colons that represent dinosaurs). Minimum gametime has been suggested, but unfortunately, as it's possible to manipulate luck without spending any gametime and the RNG seed space is incredibly large, minimum gametime would probably take several decades or even centuries to watch. 100% runs of NetHack (killing every enemy that doesn't respawn infinitely) are famously boring, and bad material for a TAS.
(Incidentally, NetHack has been ported to a wide range of platforms, but out of the TASable ones, DOS is the truest to the "original" game. There are multiple versions, but 3.4.3 has been out for over five years now, with no sign of another version in the immediate future, and so has become the de-facto standard. Note that for it to emulate correctly in JPC-RR, HDPMI32 (from the HXDPMI suite) must be used as the 32-bit extender; NetHack requires such an extender to run, but is capable of using any of a range of extenders.)
The major problem with a glitched any% would be figuring out exactly how to do the glitch, as it requires overwriting memory which is unfortunately in dynamic addresses. (To actually perform the glitch in question, you need to destroy a wielded or worn item in a way the game doesn't check for, such as by hitting yourself in the face with a cream pie while you're holding it.) The other problem is trying to determine what exactly counts as completing the game, as the glitch can do almost anything; does jumping right to the high-score table count, for instance? Jumping right to the end of the game with the appropriate item? Glitching debug mode on and later off again such that the game thinks it was played without using debug cheats?
For a standard any%, the major difficulty would be route planning; with the ability to manipiulate almost anything into happening at the cost of time needed to luck-manipulate, there are a huge number of possibilities for possible routes. The interesting bottleneck, which gametime speedruns keep coming up against in non-TAS runs, is that it's impossible to access the Quest, which contains one of the items absolutely necessary to complete the game, before turn 2000, which puts some interesting constraints on the run. (I've checked the code around that point very carefully, and there seems to be no way around it without memory corruption glitches.)
A playaround could also be interesting, especially as it could be played relatively slowly so the player could see what was going on (you can move multiple times per frame in NetHack, meaning that some bits would be entirely invisible). The scope for luck-manipulation lets you do all sorts of ridiculous things (such as the aforementioned dinosaur-colouring, but also things like manipulating monsters represented by letters to spell out words), but it might get boring after a while even with all the possibilities.
What do people here think? Is there anyone here competent enough at NetHack to help with route planning for an any%? Any suggestions/comments?
I love the idea of doing a nethack TAS. A realtime TAS doesn't strike me as very entertaining, because everything would fly past too quickly to understand what's going on. You'd basically want to view it frame-by-frame rather than in realtime :/ Therefore I think it would be good to slow the game down to watchable speed and go for some other goal; either that, or edit the encoded avi file heavily to make it watchable. Some classic aims in NetHack are:
* Ingame time [ the main issue is there's a hard limit before you can have enough alignment to start the Quest, so you want to finish the game ASAP after this. ]
* Lowest score - although I think the lowest score possible has been done, you could go for it as fast as possible.
* Max conducts -- it should be possible to do all conducts? This has been done non-TASed with a stuffed bones, but with luck manipulation of enough /oW or =oSD this should be doable; also in a TAS there's no issue with doing the 2 ring no-hunger trick which is incredibly dull normally.
The key issue though is to make it entertaining for people who don't know NetHack. A subtitle commentary might help with this.
You don't have to edit the video file, you can change its framerate from the default 60 (or whatever it is for JPC) to, say, 2 — at 60 fps turn #2000 will happen a bit more than half a minute after the start. Or make it variable.
I'm not really competent at NetHack (I've always preferred ADoM myself), but for me, minimum turns glitched & non-glitched sound like good categories precisely because the game is turn-based. I don't know how much freedom exactly this game allows — there are other classic challenges to be attempted once at least one run is complete so we could see how it turned out.
The fact that you can shuffle the RNG almost infinitely every frame in an in-game time-oriented run worries me, though, because that means, the author either has to settle with "good enough" results all the time (such thing works, but is rather wonky), or come up with arbitrary restrictions ("aims for minimum turns except when they take too long" may be a problem during judgment).
Subtitles are a must in any case, of course.
Some frames are more important than others, since one moment you might be spending 40 frames to wish for a "blessed fixed greased +5 gray dragon scale mail" and the next you'll spend 40 frames to levelport to the inner sanctum, kill the high priest, grab the amulet, and c!oGL out. But this sounds workable, if you can make the framerate variable.
The biggest restriction on turns is the Quest. You need an alignment of at least 20 (pious) to enter the Quest -- otherwise your leader will reject you -- but at the start of the game your alignment is *capped* at 10. The cap rises by 1 every 200 turns, so you can't enter the Quest before turn 2000. (You need to do the Quest to get the Bell of Opening to perform the Invocation to get the Amulet of Yendor to offer to your god on the Astral Plane.) There is plenty of info here. The fastest ascension I know of so far is 2185 turns, but this used a stuffed bones which I think is clearly unsatisfactory for a TAS. It does give some great ideas for a TAS such as being polymorphed into an air elemental for maximum speed from Quest to ascension.
I think it's clear that a TAS should be faster than any non-tool-assisted non-bones ascension.
Is it possible to shuffle the RNG without advancing the in-game clock? How? This would certainly introduce the worries you suggest; however I don't see a problem with having a small amount of subjectivity though; sacrificing in-game turns for less monotony is a clear case of speed/entertainment tradeoffs. And NetHack gives you so many ways to solve particular problems that it should be possible to find *some* way of achieving what you want without needing to shuffle the RNG too much. I think we can afford to wait and see how big a problem it is before deciding how to solve it.
Oh wait, I guess I misunderstood what ais523 had said earlier. I was under the impression that you could shuffle the RNG by waiting for a certain amount of real-time frames between turns. If it's not the case and all the manipulation takes turns, I see no problems at all with minimum-turns any% runs.
Minimum gametime has been suggested, but unfortunately, as it's possible to manipulate luck without spending any gametime
I guess "gametime" means turns. And no, its not real time waiting that's used to manipulate the RNG. There are some actions that do not consume turns but use randomness (manipulating the RNG).
In fact, the only way real time affects anything is when game initializes its RNG on startup. Actually, Ais523 planned to do the run by using special hacked Linux version (modified to behave like DOS version would) recording the needed keyboard input and then just spamming that input (together with the boot sequence input) to emulator using Lua (which will cause final movie file (unless edited) to have RERECORDS 0).
Hi, can anyone explain what stuffed bones are, and why they won't be allowed, please?
Thank you.
EDIT:
Whether using the contents of a deceased player's bones is ethical is left to the player to decide. Bones can often make a difficult game much easier by providing items that the current player has not "earned" yet.
Finding one's own bones is an even more difficult position. Luckily on a public server there are enough players that this is unlikely to happen too frequently.
EDIT2: This one is clearer;
Bones stuffing consists of playing a game for the express purpose of gathering useful items (up to and including a full ascension kit) and then deliberately committing suicide with the intention of leaving a bones pile for another character to exploit in some pre-designed manner. Sometimes the practice is taken to such extremes that the true identities of randomized items are engraved on the floor to aid subsequent characters.
Bones stuffing is not considered bug exploitation and technically speaking is within the rules of the game, but most regard it as violating the spirit of the game. For example, a pacifist character who ascends using an ascension kit obtained via bones stuffing would not generally be considered to have ascended legitimately.
It is important to observe that under normal circumstances, encountering and exploiting bones piles is a legitimate action, even in borderline cases such as bones piles containing full ascension kits. The difference is that bones stuffing involves deliberate suicide of a character, whereas a normal bones pile is a result of an honest (albeit failed) attempt to survive.
Bones stuffing on a multi-user system is risky, as it is possible that another player will get the benefit of your bones pile.
The instruction explain that it require CWSDPMI, but even so I get a similar error.
Edith:
Alright, now it work thanks to Ilari: load the FPU module and run HDPMI32.EXE(avalaible here)... thought every frame with text are very slow to render.
Hi, can anyone explain what stuffed bones are, and why they won't be allowed, please?
An explanation in terms more familiar to typical TASvideos players: Bones are similar to NetHack's version of a New Game+: you can use items obtained in previous games to help you with a current game. The difference is that instead of carrying over stats from a previous game that you won, you're carrying over items from a previous game that you, or someone else, lost. The other difference is that you can't choose whether you hit bones or not; it just happens at random, thus making non-luck-manipulating speedruns on non-clean installs almost incapable of avoiding them (at least on servers with many more losses than wins, which is typically the case in NetHack).
Due to the typical requirement to start from a clean install, there won't be any bones available immediately, so in order to create them, you'd have to play for a while, gaining the items you wanted, and then suicide. Such time is typically not counted in non-TAS speedruns, thus leading to artificially small times for a "bones-abusing" ascension. Ethically, I think bones preparation time would have to be added to the time for measuring a TAS; thus the realtime record to compare to would be for a non-bones-abusing run. (Still, I suspect even the best bones-abusing runs done without TAS tools will be slower than a non-bones-abusing TAS.)
On another subject, doing minimum-gametime or minimum-score runs (i.e. conditions that do not cap the number of actions, or the amount of realtime taken) have the issue that optimal luck manipulation would probably take years. The easiest way to luck-manipulate in NetHack is to attempt to walk into a wall; this costs no turns, and its only effect on the game is to erode engravings on your current square by a random amount, with a random number being generated for this purpose even if there are no actual engravings to erode. (That it does anything at all is probably a bug.) When not next to a wall, other possibilities are available, but much slower; the best-known is attempting to name an item to an invalid name (upon which your "finger slips" and typoes a random letter), but I haven't investigated closely to see whether there are others. As a result, if we want a TAS that's at all possible to watch, we want to minimize realtime (maybe under certain conditions), to avoid years of apparently nothing happening. (NetHack's random number generator has a very large seed space, after all.)
In order to avoid sacrificing entertainment due to the huge speed involved (and who's to say that insane speed is bad in a TAS?), it would be entirely possible to make a second encode where the game was played deliberately slowly. NetHack doesn't care about the actual time to any accuracy more precise than which hour it is; and so slowing input does not usually cause a desync, thus making it possible to see every move.
this game is so epic, I think a lowest real time would be the best. You can get closer to that 20 alignment record by killing certain monsters right?
Alignment is very easy to raise (killing more or less any monster does it). The issue is that alignment is capped, initially at 10; the cap increases by 1 every 200 turns, meaning you need to wait until turn 2000 to get an alignment of 20. If you've ever watched a non-TAS gametime speedrun, you'll see the player check their alignment (in a way that doesn't cost an action) on turn 1999, then kill a monster on 2000 and check again, seeing that it's now high enough to enter the Quest. (Note that a gametime speedrunner would be getting several actions per turn at this point; for a realtime TAS, there's an interesting tradeoff between actions-per-turn (which almost certainly reduces lag due to reducing the need to calculate monster actions) and the need to reach turn 2000 as quickly as possible so the Quest can be entered.) Because this is a major bottleneck, I've spent hours staring at the source to try to find a glitch to get round of it, but that part seems completely bulletproof (barring memory corruption glitches, which would be better used to skip straight to the end of the game).
This leads to another reason realtime would be more interesting than gametime (measured in turns), by the way; having to wait until turn 2000 to do a particular part of the game is basically a massive frame rule which would render a wide range of improvements pointless. Luckily, of all the major sidequests, it's possible to leave the Quest until last (this is not the recommended way to play the game, because it's "too risky" to leave it until after killing the Wizard of Yendor, but hey, this is a TAS!); gametime speedruns always do this at the moment, using the preceding 1999 turns to do the other mandatory sidequests (taking up only a small portion of the time) and preparing for what comes later (taking up most of the time). A gametime TAS (with some sort of limit on luck manipulation delays) would look similar; at the moment, I'm not sure if a realtime TAS would look like that or whether it would do things in an entirely different order.
I've read that the RNG is affected by the time passed since january 1st 1970, so should a tas start at that time?
Also, if the RNG is so hard to manipulate, you should consider a brute-force script to test all possible solutions for a given outcome. I have a above-average rig, so if you guys ever need to run some complex calculations, don't be afraid to ask. :)
And I agree with you, realTime would be the way to go. :)
I'm going to download this game to check it out. Or at least try.
I've read that the RNG is affected by the time passed since january 1st 1970, so should a tas start at that time?
Probably not. There's no reason to believe that an initial seed of 0 would be any better than an initial seed of our choosing.
And there is indeed likely to be a lot of RNG brute-forcing involved. The fastest method would probably be to use a hacked version of NetHack that syncs with a non-hacked version to actually make the TAS, and then just play back the input at the end. Fast brute-forcing would obviously be useful, but route planning is much more important; manipulating events of low probability, which is what takes the most brute-forcing, also takes the most realtime (unless you're very lucky) and so should be avoided at the route planning stage as much as possible. (The exception is the initial seed, which can be manipulated by setting the clock.)
My questions would be as follows:
-How do you plan to present this TAS? Nethack doesn't really have 'frames' per se, if you input commands as fast as possible, the resulting output would be an unreadable disaster.
-What are your goals? I think the only goal should be fewest number of turns to ascend without Explore Mode or Wizard Mode or Bones Files. All three of these are obviously cheating to me.
-Since you have so much leeway in that you have a lot of turns before you can start the quest to prepare an ascension kit, might I suggest you also go for challenges? No wishes/genocides is probably still easy, but much more entertaining to watch. (I figure a wishful TAS would involve t1 moving onto a square with a WoW 0:2, which seems kind of boring honestly) A lot of the challenges are probably gimmies anyway...
My questions would be as follows:
-How do you plan to present this TAS? Nethack doesn't really have 'frames' per se, if you input commands as fast as possible, the resulting output would be an unreadable disaster.
DOS games are emulated on a CPU which has a comparable speed to an actual DOS system; thus, relatively slow. Inputting commands as fast as possible leads to moving about 3 squares per frame on a relatively empty level; hardly unwatchable.
-What are your goals? I think the only goal should be fewest number of turns to ascend without Explore Mode or Wizard Mode or Bones Files. All three of these are obviously cheating to me.
Fewest number of turns has the problem of the optimal solution involving years/decades/centuries of luck manipulation, almost certainly. There needs to be some limit on the amount of luck manipulation, or the game will come out longer than Desert Bus. I agree that Explore Mode is obviously out (not hardest difficulty, prevents winning); Wizard/Debug Mode is even more obviously out (requires a password to enter, even easier difficulty, also prevents winning), and that bones files are either banned or massively inefficient depending on your point of view (because a TAS must start from a clean save).
-Since you have so much leeway in that you have a lot of turns before you can start the quest to prepare an ascension kit, might I suggest you also go for challenges? No wishes/genocides is probably still easy, but much more entertaining to watch. (I figure a wishful TAS would involve t1 moving onto a square with a WoW 0:2, which seems kind of boring honestly) A lot of the challenges are probably gimmies anyway...
Wishing is actually probably inefficient. Compare the difficulty of luck-manipulating a low-probability wand of wishing, plus the time spent to type in the desired wish, to the difficulty of luck-manipulating the item you would have wished for. (Admittedly, there are some things that can be wished for but not otherwise generated at random; it's not obvious that a TAS would have much use for them, though, as they're mostly good defensive items.) Wishing is definitely one of those strategies a lot more useful in realtime than when TASing.
Also, if you haven't yet, you should try watching a gametime non-TAS speedrun to get an idea of the sort of strategies that work. There are normally plenty of uses for the 2000 turns that you get before the Quest unlocks (shortening paths in Gehennom, obtaining cursed potions of gain level by any means possible, etc); wasting time showing off is likely inefficient even in a gametime run (with some sort of limitation on the amount of luck-manipulation needed). In a realtime run, burning through those 2000 turns in the normal course of things is likely the best strategy, to avoid having to wait for the Quest to unlock.
Going for a least-turns run would probably involve massive computation and automation of the luck manipulation. The user would specify broad goals like "find 10 cursed potions of gain level before turn 2000" and "generate levels with a minimum distance between staircases" and then the program would automatically do the pathfinding of actually navigating the map, while continually checking for good RNG values to achieve the luck-requiring goals.
You certainly wouldn't want to try to do a NetHack run manually, no.
EDIT: actually, come to think, wouldn't an optimal run's dungeon navigation consist in large part of digging downwards to descend and drinking potions to ascend? I haven't played NetHack all that much but I'm pretty sure there aren't any faster up/down movement methods. In which case the dungeon layout is nigh-irrelevant for the upper levels; all that matters is manipulating a pick and the potions (and the quest items, and whatever you need to kill quest enemies).
Pyrel - an open-source rewrite of the Angband roguelike game in Python.
How on earth this is a factor for generating appropriate items on DL1 I have no idea, since it seems that you could just brute force starting seeds until you got one you wanted. Difficulty's not relevant. If you whore the RNG enough, you should get more than enough right away.
Can you manipulate the RNG before starting the very first level? (writing your name, select class, race, allignement...)
ais523 wrote:
DOS games are emulated on a CPU which has a comparable speed to an actual DOS system; thus, relatively slow. Inputting commands as fast as possible leads to moving about 3 squares per frame on a relatively empty level; hardly unwatchable.
I hope this isn't the case, but could be blind(without any sort of ESP intrinsic/extrinsic) could help to render several frame/sec faster on realtime-based run?
Wishing is actually probably inefficient. Compare the difficulty of luck-manipulating a low-probability wand of wishing, plus the time spent to type in the desired wish, to the difficulty of luck-manipulating the item you would have wished for. (Admittedly, there are some things that can be wished for but not otherwise generated at random; it's not obvious that a TAS would have much use for them, though, as they're mostly good defensive items.)
The Eye of the Aethiopica. Branchport and fast energy regen are both very good for a TAS. Can't think of anything else that you'd want to wish for that you couldn't get more easily by other means though. It seems to me that the easiest way to acquire the loot you want is by manipulating death drops, generating a big shop on every level (and robbing it, probably), and polypiling.
Derakon wrote:
EDIT: actually, come to think, wouldn't an optimal run's dungeon navigation consist in large part of digging downwards to descend and drinking potions to ascend? I haven't played NetHack all that much but I'm pretty sure there aren't any faster up/down movement methods.
Level teleport is faster (confused/cursed ?oT or #invoke Orb of Fate or levelport trap), but it's banned once you have the Amulet. Normally you would want to map out the whole dungeon before the ascension run, but this is less of an issue for a TAS. Wand/spell of digging is faster than pickaxe for descending. The fastest way to grab the amulet is to perform the ritual, *levelport* down and land bang in the high priest's temple, dispatch priest, grab amulet, c!oGL outta there.
Normally during the ascension run you won't have enough c!oGL to ascend the whole dungeon, so you save them for levels which would take a while to navigate -- noteleport levels such as asmodeus, juiblex, medusa -- and use regular teleport or plain old boot leather to navigate the rest. During a TAS, however, I think it's very possible you'll be able to get tonnes more !oGL than normal; a lot of monsters get generated with !oGL and drink them before you get to them, while in a TAS you could ensure these !oGLs all fell into the right hands. Furthermore, there is a recipe for !oGL which requires a certain level of RNG manip but which could conceivably generate all the !oGL you need.
glossary: ?oT = scroll of teleport, c!oGL = cursed potion of gain level
CX Gamer wrote:
I've read that the RNG is affected by the time passed since january 1st 1970, so should a tas start at that time?
A fair amount of the game depends on the time, the RNG seed is just one aspect. You also get a luck bonus at full moon; cockatrices are more dangerous at new moon; you get a luck penalty on Friday 13th; gremlins can steal instrinsics between 10pm and 6am; undead do double damage between midnight and 1am. This list is not exhaustive.
If it were only about synchronising the RNG, I'd say that beginning at Jan 1st 1970 is a reasonable interpretation of the "game begins from power on" rule; but since there's so much else in the game which depends on time, and since you'd be inviting double damage undead by starting at midnight, I think it's best to let the TASer choose their own start time.
Aside: perhaps in this thread we should refer to "RNG manip" so that the separate concept of "luck" is not confused?