Wizardry 1 TAS by TaoTao

Wizardry is very interesting game. Of course, it is also true for TASers!

Essentials

  • Emulator used: FCEU 0.98.28
  • Aims for fastest time.
  • Manipulates luck.
Note: The enormous re-record count mainly comes from my bots' trial and error. I think the count of re-records made by me (not my bots) is about 1000 at most.

About the game

Wizardry, a good old RPG-style game, is so popular that it won't need many explanation. The goal of the game is to recover an amulet from an evil wizard, Werdna. You create various characters, choosing a race, an alignment, a job, etc. And you organize a party. The party will explore Werdna's maze many times, and they will gain more skills, and more powerful items. Finally, they will beat Werdna and be rewarded for recovering the amulet. But be careful, as there are evil monsters and traps in the maze.

About the run

For TASers, this game is *extreme* luck-manipulating game. It is indeed a fight against random numbers and lags.

Run overview

  • I reset the game to skip a logo. And I start the game.
  • I create a Thief who has 18 Strength.
  • I pick up the Thief and the Cleric who exists from the start of the game. and organize a party.
  • I go to an elevator on B1F, and go down to B4F.
  • I go to a room and beat a monster, and open a chest to trigger a Teleporter trap. The Teleporter brings me to the second elevator. I go down to B9F with the elevator.
  • I encounter a group of monsters, because I was obliged to raise an alarm on B4F. But they are friendly, so I just leave without fighting.
  • I go to a room and beat a monster by Cleric's dispell, and open a chest. A trap is Mage's Misery and it doesn't affect my party at all. I find a Epee of Excellence, a Ring of Movement, a Dagger of Thieves from the chest.
  • The Thief equips the Epee of Excellence, and invokes the special power of Dagger of Thieves. Now, the Thief is a Ninja.
  • The Cleric equips the Ring of Movement.
  • I turn to south and encounter a group of monsters. I use Ring of Movement and teleport my party to the front of Werdna's room.
  • I break into Werdna's room and surprise Werdna and his guests. The Ninja attacks Werdna and decapitates him. The Cleric dispells a Vampire Lord. And, at the next turn, the Cleric dispells a Vampire. Now, Werdna and his guests are beaten. I find the amulet!
  • I use the amulet and teleport up 10 floors, and return to the castle. The Ninja is honored for recovering the amulet. The Cleric... oh, he is drowned in the castle moat :)

Run detail

Of course, luck manipulation is mandatory to achieve a fast run in this game. The 16-bit random number $40 controls over the luck. The random number increases every frame, and it is affected a little by the player's input. So, I made a number of bots with Lua scripting to find optimal solutions. And I analyzed some assembly codes to understand the game.
Basically, I manipulate luck by trial-and-error method. I let my bots generate random inputs, and bots continue the trials until they find the optimal solutions.
Lags often occur in this game because the random number affects the flow of codes. For example, when you go up/down to another floor, some lags can occur (probably, they are caused by the code initializing floor data). I tried avoiding lag as possible as I can, using bots.
In NES version, we can't create a Ninja/Lord at the start of the game. When we create a new character, we can get at most 29 extra points.
Teleporter never changes the floor. So I need a Ring of Movement to teleport to B10F.
The Ninja needs Epee of Excellence to hit Werdna. There is roughly a 2% chance that he decapitates Werdna with the weapon.
There is roughly a 5% chance that the Cleric dispells Vampire Lord or Vampire.
The Thief who exists from the start of the game is useless. To hit Werdna, the Ninja (changed from the Thief) must have 17 or 18 Strength and Epee of Excellence.
I don't touch the game switches. I think the wire-frame display would not be familiar to the users of NES version. And disabling music or sound would make the run tasteless.

luck manipulation

The random number is changed by the routines which interact with the random number. Furthermore, the random number continues to be incremented while the game are waiting for NMI at every frame. So, the clock cycles needed by the codes executed at every frame affect the random number. (note: The NMI routine doesn't use RTI to return. It returns with RTS, restoring stack pointer from memory)
That's why player's inputs affect the random number. Inputs of direction keys are processed in the NMI routine, and the needed clock cycles depend on whether a player made inputs or not. So the random number changes by player's inputs. But, the random number changes only a little by a input at one frame, so we often need to make inputs for a certain period to manipulate luck.

Possible improvements

Probably, this run could be improved. But more thorough analysis may be needed to achieve it. I used bots to manipulate luck, but the method is still elementary. So, there may be some rooms for a little improvement here and there.
Especially, I wasted about 60 frames when I get items from the chest on B9F. I had to wait for some time to get a Dagger of Thieves. And I wanted the Thief to have a Ring of Movement, but I could not help giving up it to get a Dagger of Thieves without a large loss. So an equipment takes time a bit more. In this scene, luck maniputation is so difficult that more precise planning would be required.
I considered a new strategy that I pick up a Sword of Slicing on B4F and a Scroll of Darkness on B9F. With Scroll of Darkness, there is roughly a 0.05% chance that a Ninja decapitate Werdna even if he has only 15 or fewer Strength. So, with this strategy, we no longer need to create any character. But for now, I can't tell whether this strategy really saves time. Thief can't equip Sword of Slicing, so we have to equip twice and it takes time unexpectedly. And it takes time a bit more to beat Werdna's party.
Enjoy!

mmbossman: I personally don't think this movie is entertaining, but it seems I am in the minority. Accepting for publication.
ShinyDoofy: Processing...


TASVideoAgent
They/Them
Moderator
Joined: 8/3/2004
Posts: 15577
Location: 127.0.0.1
Joined: 5/29/2004
Posts: 757
I have been waiting so long for this!!! This was just mindblowing! The only annoying thing was seeing the status of the Cleric and Thief/Ninja on the screen... but then I guess it'd waste pointless frames being redrawn after every battle. I knew this game would be a luck manip. beeyotch.. but DAMN! And beats the video on Nico too! 10/10 from me, and also as well because I know the game quite intimately myself. [Cough cough Gamefaqs] Mr. Kelly R. Flewin
Mr. Kelly R. Flewin Just another random gamer ---- <OmnipotentEntity> How do you people get bored in the span of 10 seconds? Worst ADD ever.
Twisted_Eye
He/Him
Active player (398)
Joined: 10/17/2005
Posts: 632
Location: Seattle, WA
Excellent TAS here! Sweet work finding the teleporters and the manipulation all around was just awesome. A joy to watch.
Skilled player (1223)
Joined: 9/15/2006
Posts: 165
Location: China
My god, 200 thousands re-records for the less than 46 seconds movie!? That's a new record on the site. Watched, I don't know what just happened... vote 5/10.
Skilled player (1652)
Joined: 11/15/2004
Posts: 2202
Location: Killjoy
I got bored watching it. I have the attention span of a.... hey wanna get ice cream? Just kidding, that was awesome, I give it a ( > ) Rank
Sage advice from a friend of Jim: So put your tinfoil hat back in the closet, open your eyes to the truth, and realize that the government is in fact causing austismal cancer with it's 9/11 fluoride vaccinations of your water supply.
Joined: 5/29/2004
Posts: 757
zggzdydp wrote:
Watched, I don't know what just happened... vote 5/10.
[Points to the overview, which explains pretty much every single step of the way that one needs to know. :)] Mr. Kelly R. Flewin
Mr. Kelly R. Flewin Just another random gamer ---- <OmnipotentEntity> How do you people get bored in the span of 10 seconds? Worst ADD ever.
Editor, Emulator Coder, Expert player (2156)
Joined: 5/22/2007
Posts: 1134
Location: Glitchvania
Your bots seem to be unoptimized. Even Bisqwit's Lunar Ball movie by Bisqbot had much fewer re-record count...
<klmz> it reminds me of that people used to keep quoting adelikat's IRC statements in the old good days <adelikat> no doubt <adelikat> klmz, they still do
upthorn
He/Him
Emulator Coder, Active player (391)
Joined: 3/24/2006
Posts: 1802
I believe Bisqwit discounts the bot-generated rerecord count in his submissions.
How fleeting are all human passions compared with the massive continuity of ducks.
Experienced player (941)
Joined: 9/18/2008
Posts: 153
Location: Japan
klmz wrote:
Your bots seem to be unoptimized. Even Bisqwit's Lunar Ball movie by Bisqbot had much fewer re-record count...
Yes, I admit that my bots (methods) are not so optimized. It is probably caused by my half black-box approach. I have analyzed not all the codes that interact with the random number. So, I could often only roughly estimate the desirable random number and the minimum lag, and I could not help increasing the count of trials, just in case. Furthermore, in this game, similar random numbers tend to produce similar results, so my lack of knowledge about the inside of the game easily leads my bots to many useless trials. To be honest, I don't care about a rerecording count so much. But lack of knowledge does decrease the performance of run, as I mentioned at my submission. I have a plan to calculate appropriate inputs by analyzing all the random-related routines, but I'm not sure if I can complete it.
Skilled player (1444)
Joined: 7/15/2007
Posts: 1468
Location: Sweden
I can't really like this movie, at all. The game is pretty much entirely text based (none of which you have time to read when watching the TAS of course, not that it would be entertaining to do so), besides some brown walls flickering in the background and some vomit which I guess represents defeated enemies. The sound managed to annoy the crap out of me, even though I only had to listen to it for less than a minute. The technical quality is of course very good with such a big part of the movie played with bots, but I really can't say that I think this game deserves to get published, no offense to the author. 2/9
Agare Bagare Kopparslagare
Editor, Emulator Coder, Expert player (2156)
Joined: 5/22/2007
Posts: 1134
Location: Glitchvania
Cpadolf wrote:
2/9
You scared me! I thought that someone had started to spam extremely low ratings among new submissions when I saw the dreadful blue on the rating bar! :P Well, I haven't got time to watch this movie so far.
<klmz> it reminds me of that people used to keep quoting adelikat's IRC statements in the old good days <adelikat> no doubt <adelikat> klmz, they still do
Skilled player (1444)
Joined: 7/15/2007
Posts: 1468
Location: Sweden
I'm a little upset that all submissions has received extremely high ratings lately... ever since the new voting system was brought in it seems like there has been an inflation in the ratings.
Agare Bagare Kopparslagare
Editor, Emulator Coder, Expert player (2156)
Joined: 5/22/2007
Posts: 1134
Location: Glitchvania
Cpadolf wrote:
I'm a little upset that all submissions has received extremely high ratings lately... ever since the new voting system was brought in it seems like there has been an inflation in the ratings.
I also think they have been rated too high. Thankfully, peolpe seem to have adjusted their ratings after publications. However, I don't think those recent 0.0/0.0 ratings with no comments make sense at all.
<klmz> it reminds me of that people used to keep quoting adelikat's IRC statements in the old good days <adelikat> no doubt <adelikat> klmz, they still do
Banned User
Joined: 3/10/2004
Posts: 7698
Location: Finland
This amount-of-rerecords issue raises an interesting question: Should the rerecords made by a program be counted in the same way as rerecords made by a human author? IMO they shouldn't. The number of rerecords (when created normally by a human author) can be thought as a rough number which gives a notion of how much work was put into making the run. However, a program could easily create millions of rerecords, and that would tell very little about how "hard" it really was to create the run. (In fact, I would say it might be the opposite: The larger the rerecord count, the "sloppier" and less optimized the bot program was.) I wouldn't be surprised that something like this is the reason why Bisqwit never includes bot rerecord counts into the total rerecords of a movie. Including them would only serve to make the number meaningless.
Skilled player (1652)
Joined: 11/15/2004
Posts: 2202
Location: Killjoy
Warp wrote:
This amount-of-rerecords issue raises an interesting question: Should the rerecords made by a program be counted in the same way as rerecords made by a human author? IMO they shouldn't. The number of rerecords (when created normally by a human author) can be thought as a rough number which gives a notion of how much work was put into making the run. However, a program could easily create millions of rerecords, and that would tell very little about how "hard" it really was to create the run. (In fact, I would say it might be the opposite: The larger the rerecord count, the "sloppier" and less optimized the bot program was.) I wouldn't be surprised that something like this is the reason why Bisqwit never includes bot rerecord counts into the total rerecords of a movie. Including them would only serve to make the number meaningless.
You can, and it has, been changed before. It has ALWAYS been meaningless. The quality of work by an author is the quality of the TAS.
Sage advice from a friend of Jim: So put your tinfoil hat back in the closet, open your eyes to the truth, and realize that the government is in fact causing austismal cancer with it's 9/11 fluoride vaccinations of your water supply.
Experienced player (941)
Joined: 9/18/2008
Posts: 153
Location: Japan
Hmm, should I discount the re-record count which comes from my bots? But, I didn't let my bots write down their re-record counts, so now I can't tell exactly how many re-records had been made by my bots... But I made some testruns before, and according to my experience at that time, I think the count of re-records made by me (not my bots) is about 1000 at most. Sorry for roughness. I added a notation about re-record count to my submission text.
Editor, Expert player (2073)
Joined: 6/15/2005
Posts: 3282
I had to read a walkthrough to understand what was going on. This movie is OK, but I prefer the Dungeon Magic one for RPGs beaten fast. I'd still take this one over RPGs beaten slowly. The other issue is the bot. I don't care that a bot is suboptimal if the result is optimal. But seeing that you disassembled some part of the game, yet used a random input bot (which may not yield optimal results), is puzzling.
DarkKobold wrote:
You can, and it has, been changed before. It has ALWAYS been meaningless.
These people disagree: http://tasvideos.org/forum/viewtopic.php?t=6026 http://tasvideos.org/forum/viewtopic.php?t=6029 On a serious note, I only see rerecord counts as meaningless when people start believing that it is the most important item in a movie. I frequently use the rerecord count to guess the amount of effort an author put in a movie, just as I look at the submission description to figure out what is going on.
Experienced player (828)
Joined: 11/18/2006
Posts: 2426
Location: Back where I belong
FractalFusion: You forgot this one.
Living Well Is The Best Revenge My Personal Page
Joined: 3/7/2006
Posts: 720
Location: UK
I love it when lengthy and difficult RPGs get boiled down to a few minutes of stuff you actually have to do. Voted fairly high.
Voted NO for NO reason
Experienced player (941)
Joined: 9/18/2008
Posts: 153
Location: Japan
FractalFusion wrote:
The other issue is the bot. I don't care that a bot is suboptimal if the result is optimal. But seeing that you disassembled some part of the game, yet used a random input bot (which may not yield optimal results), is puzzling.
Well, I analyzed assembly codes mainly in order to understand "what I can never do". For example, if a Ninja doesn't have enough Strength (including Strength added by his weapon), he can never hit Werdna. In such a situation, no matter how many times my bots try, all their attempts end in vain (On the other hand, there is an about 5% (at least) chance that a Cleric dispells any enemy, even if he is level 1). I mean, the main purpose of my analysis is to construct a strategy, not to find a theoretically optimal solution. It may be thought that a theoretically optimal solution could be found by partial analysis of the game. But in fact, it is not so easy. In the first place, it is difficult to predict changes of the random number. The changes of random number depend not only on the routines which interact with the random number, but also on the clock cycles needed by the codes executed at every frame. And lags make the thing more complex. So we would have difficulty predicting the random number at a certain frame, unless we understand completely all the codes executed in every frame. To make matters worse, we often cannot treat separately the scenes which need luck manipulation. A player's input changes the random number only a little, so we often have to input for a certain period in order to manipulate luck. So, if there are not enough frames between such scenes, we can't treat them separately without loss. That's why defeat-in-detail approach doesn't work well. To achieve a theoretically optimal run, we would have to analyze almost all the routines which affect the random number. But I think it would never be a light work (and for now, my skill to analyzing is insufficient to do so). In short, at the present stage, I want to find a approximate solution, not a strict one. I think it does have a certain meaning, because even the most appropriate strategy is not so clear for now (And I'm starting to think that the strategy of this run might be able to be improved. I will verify it as soon as possible). I added some description about the mechanism of the random number to my submission text.
Joined: 3/7/2006
Posts: 720
Location: UK
Well, such analysis was carried out on things like Monopoly, so the same process could apply here. Of course this probably has more things that change it, but it's still quite doable. Ask DarkKobold :)
Voted NO for NO reason
Emulator Coder
Joined: 1/12/2007
Posts: 95
Why watch it? Why not. It's so quick that it defies any attempt to make a judgment call. It's also definitely techy to run situations through bots. Some people don't realize how much time it really takes to accumulate bot data, so I'm betting it's a decent mix of understanding, combined with a lot of bot time to test things.
Experienced player (941)
Joined: 9/18/2008
Posts: 153
Location: Japan
I considered a new strategy. But for now, I can't tell whether the strategy really saves time. Some detailed description will be found in my submission text.
LagDotCom wrote:
Well, such analysis was carried out on things like Monopoly, so the same process could apply here. Of course this probably has more things that change it, but it's still quite doable. Ask DarkKobold :)
Yes, I also think a optimal or near optimal solution is calculable. I'm not familiar with Monopoly, but I think it has the same essentials, looking over the article and the source by FractalFusion. I had already analyzed the routines which treat the random number directly. The routine $CD1A rolls dices, and the routine $CD4B generates a value in the range of [0, n). And both of them randomize using the routine $C2A9 which returns a value depending on the random number $40. The random number is only 16-bit, so we sometimes can use brute force attacks as supplementary means to know desired random numbers. We can do it by writing all 2^16 random numbers to $40 and checking all results. I used a brute force attack to get a Dagger of Thieves. But still we often have difficulties to set the random number for a desired value without loss. The problem is that too various codes are executed at every frame and the results of every frame affect the code executed at next frame. We will have to check out all the branch of many routines and calculate the clock cycles needed by them.
Experienced player (828)
Joined: 11/18/2006
Posts: 2426
Location: Back where I belong
*sigh* I'm simply not a fan of dungeon crawlers and I don't believe they make good TASes. It makes me think of simply flipping through the pages of a book really really fast. I understand that this is likely very well done technically, but it suffers greatly in entertainment value. Basically what Cpadolf said. Rating it 1.5/9.5. EDIT: To avoid another unnecessary argument, if you like this movie, please post why.
Living Well Is The Best Revenge My Personal Page
Skilled player (1652)
Joined: 11/15/2004
Posts: 2202
Location: Killjoy
I like this movie because: 1) It's an epic RPG that is manipulated so well, it is completed in under 1 minute. 2) 'Walk right for justice' movies bore me to tears these days, this is different, and therefore able to actually make me care. 3) The author spent much time decoding the game, which actually does make the movie more entertaining - not just for his work, but the amount of work required to pull such a stunt. Sort of how you dislike the dungeon crawlers, I massively am growing tired of generic ninja walks right for justice movies. This far exceeded my personal entertainment level compared to lots recent submissions.
Sage advice from a friend of Jim: So put your tinfoil hat back in the closet, open your eyes to the truth, and realize that the government is in fact causing austismal cancer with it's 9/11 fluoride vaccinations of your water supply.