Submission #5174: adelikat's NES Dragon Warrior IV in 1:58:06.28

Nintendo Entertainment System
baseline
BizHawk 1.11.4
425877
60.0988138974405
41377
Unknown
Dragon Warrior IV (U) [!].nes
Submitted by adelikat on 7/15/2016 11:56:09 PM
Submission Comments
This is over an 11 minute improvement (36,717 frames) over my previous published movie. Also, FCEU .12 didn't emulate this game so well, and has a LOT less lag in general. those frames were in spite of losing a lot of time to better lag emulation.
Wow, it has been 10 years and 5 months since that publication. That was one of my first TASes, using FCEU .12. I didn't have bots, or lua, or even ram watching to aid me. I've learned and grown so much as a TASer since then, and emulator tools have made amazing leaps. This new run achieves results that were unthinkable to me back then. When I first TASed this game, my motivation was the nostalgia power of this game from my childhood. This time around, I had nostalgia power on TASing the game! I can't believe I've been doing this for so long, eek.
There's a lot of new strategies and routes compared to the previous movie, but in addition there is just a lot more sophisticated luck manipulation. I used an extensive suite of lua scripts I wrote to bot all of the luck manipulation in the game. While I had over 43k manual rerecords, the bot attempts we many millions.

Luck Manipulation

This is what this game is all about! The game has a very manipulable and strange RNG. Both frames and input can affect it. Unfortunately, most frames are lag frames, so there's often not a lot input based manipulation, so frame delays are necessary. The RNG is actually affected by the number of CPU cycles in a frame, making it an RNG that is completely unpredictable. Therefore, brute-force bots are the only viable option.
During fights especially, most frames are lag. Certain actions have no frame to manipulate actions at all other than the frames to press the menu. Others however, have a non-lag frame, or even 2. It is critical to utilize these frames in order to minimize delays.
There are 2 RNG bytes in the game. The first byte changes constantly and is easy to manipulate. The 2nd byte changes more rarely and only in certain conditions. A lot of the unlikely events require special planning in order to get enough 2nd byte variance to have a reasonable chance of success.
Here are some misc chapter by chapter improvements. These are improvements in addition to the overall improvements of having fewer delay frames and tighter optimization in general.
Compared to my previous TAS, delay frames are MUCH reduced here. Most are not noticeable at all (only a few frames delay on an action is hard to see). Previously, standard actions such as critical hits (1/64 odds), I tried to keep under 20 frames of delay, much more for more unlikely events. Now, a large delay is more like 10 frames, and most 3 or less (many are 0).

Chapter 1

  • The big improvement was to talk to the child running around at night (he happens to know Alex). 10 years ago, I didn't know that this could be done instead of talking to Alex. With enough luck manipulation I was able to manipulate him to run up to Ragnar on his way out. This saved 10 seconds overall.
  • The death shortcuts were better optimized. By getting max-damage critical hits instead of regular ones (regular are 1/64, a max damage is 1/192 or 1/256 depending) and better controlling what enemies I ran into, I was able to kill myself in just 1 round. Btw, I still find it hilarious to critical-hit-suicide one's self to save time
  • The boss fight was done in fewer rounds, again taking advantage of a lot of max-damage critical hits
  • Level up stat manipulation is significantly different this time. I need to manipulate NOT getting stats whenever possible, and get as few HP as possible. Aside from that, any stat (other than 0) is irrelevant. This is because of the radically different strat in chapter 5, where I do not even need Ragnar

Chapter 2

  • Alena has a lv/256 chance of delivering critical hits, this means the first boss fight has a lot of 1/256 crits. This was super painful the first time around. This time around..it was still very painful, but at least I had bots! I saved a lot of time in the first boss fight, by having the luxury of manipulating two VERY unlikely battle orders/actions. On average it took about 16k bot attempts to recreate just the appropriate battle order of each round, much less the actual critical hits and misses that ensued. Note that there is some strange looking decision in that fight. But it is because the game turns off the ability to deliver critical hits after someone dies, for some reason. Also a big factor is the glitch that if the middle character is dead, enemies won't target the last character. This glitch is extensively exploited in RTA, but is actually an annoyance here, I had to work around it by making sure Brey died before Cristo. As before, only Alena survives this fight as the others aren't useful and I don't want to spend the time to level them up.
  • A big improvement is NOT leveling up from a metal slime. In the previous run this saved time because the level ups would have happened in chapter 5 anyway (at most it costs 1 extra level). However, I do not use Alena in Chapter 5 (more on that later). While it makes the tournament a bit slower (much less than I thought actually), it saves about 40 seconds overall. Also, it has the added benefit of making the tournament even more unlikely.

Chapter 3

A lot of time was saved in this chapter more than any of the other early chapters.
  • Last time I TASed this game, I thought that you could not get the premium half plate and broad sword treasure drops until level 3. It turns out you can, it is just very unlikely. With the power of botting I was able to get a broad sword instead of chain mail to start. This allowed me to go ahead and buy more wing of wryverns, and also this contributed to getting to 35k gold easier for the shop purchase.
  • Major route improvements here, too many to name. But basically, I better managed day/night and doing multiple tasks at the same time to avoid back tracking.
  • Just like last time I get into a Metal slime fight to gain levels. However, last time, for some reason it never occurred to me to get a treasure drop from that fight. Even though soon after I get into fights to get treasure for the King's order. Saved an encounter to go ahead and get a drop from that fight.
  • The armor shop that purchases armor, will offer up to 2x the purchase price of the armor. However, it is insanely unlikely (seems to be a 1/4096 chance) . It was extremely difficult but I managed to get 3 of those offers, which allowed me to get to 35k without pucking up extra treasures in the cave, this saved a lot of time.

Chapter 4

Not a whole lot of new strats here, this level is pretty straightforward.
  • Better death shortcuts from the ability to control which enemies I encounter
  • Being able to get higher damage critical hits on the Balzack fight allowed me to finish him off in only 3 rounds.

Chapter 5, up to Taloon

  • Max/high damage critical hits make some boss fights quicker here. Also, having hector build power than do a critical hit in the lighthouse fight improved the fight about 60 frames.

Chapter 5, after Taloon

  • This is where the TAS differs radically from the previous TAS and where most of the time was saved. The key detail I missed last time is that if a character builds power, the 2x bonus from that also applies to critical hits! This detail allows Taloon to be a wrecking ball in this game. The basic strategy is to build power in the first round, then summon reinforcements and deliver 3 critical hits, all at 2x damage. With this strategy, the other characters become pointless and only cost time having to level them up. Instead, the idea is to give Taloon the best weapons you can, and let him deliver insane amounts of damage. Nearly ever boss can be defeated in a single reinforcement summoning. By the end of the game, Taloon is doing over 400 damage on each hit! So I kill off everyone but the Hero and Taloon (and eventually the hero too). The hero is only useful for outside/return spells and because it is required that he be alive to enter Zenithian castle. Every boss fight is very short this time around and this is the basis of why. Also a lot of route changes result from this.
  • Since I knew I would not need Alena and Ragnar, their stats were manipulated to have low HP in early chapters. This way they could be killed off in 1 hit. This time around, I kill off Alena, Cristo and Brey right after they join the party. I put them as the only 3 in a party and get into a random encounter and have them all die quickly. This is a nice time saver because the remaining living party members (Taloon and the hero) jump out of the wagon after ward, so I don't have to re-adjust my party members.
  • I did a much better job of actually of route planning. There were several places where returning to a different town to get to a new place was a lot faster. I guess I didn't try all possibilities before.
  • I don't get the lucky 200 coins and wizard's ring this time. Careful planning of MP stat ups, and Inn usage end up being faster.
  • I actually get into a metal babble fight for the purpose of level ups right after getting Taloon. This was a difficult decision to make. In general, I don't need the levels, and this takes time. However, this allows the hero to get the outside spell sooner. The magic key cave, I was able to save a minute of backtracking and avoid a death shortcut when getting the seeds from the cave. However this isn't enough to make up the time. However, the extra levels even out by the end of the TAS, resulting in only 1 extra level for the hero and Taloon. The extra levels end up saving time from less usage of inns, and result in just enough strength increase to beat some bosses in fewer rounds. Overall, the metal babble route saves some time but not a lot, probably about 20 seconds.
  • Another marginal improvement but very awesome to watch, is getting the sword of decimation. This is a cursed weapon and a bad idea in regular play. However, the downside to this weapon is that while it has insane attack power, it leaves you with 0 defense. In a TAS, I dont' need defense, since I don't get hit unless I want to. The extra damage it gives me saves some time over the course of all those boss fights, more than the cost of obtaining it. It probably saves about 10 seconds overall. But I think it also improves the entertainment value. It is pretty cool to see the use of a cursed item as a means of saving time.
  • There's a clever death shortcut after the Esturk fight. I kill off the hero in the Rhinoking fight, and then take on Esturk alone with Taloon. Then I kill off Taloon after getting the gas canister to save having to backtrack out of the castle (the castle blocks your outside/return spells). Normally once you have a party, you don't want to do death shortcuts since only the hero is revived. But in this case, I can revive taloon in the World tree, since searching on any leaf square gives you a leaf of world tree.
  • In the 4 guardian fights, I do Radimvice first because the hero is useful for his expel spell. Once he's done that he is killed off and Taloon goes solo from there. Interestingly this strat is only viable because of forced medical herb drops in the Chapter 2 tournament. One of the guardian shrines and the final castle have barriers. Since Taloon can't heal himself, the only way I can do this without the hero is by using 2 of those medical herbs. Note that the max HP you can get from a medical herb is 40. I manipulated max healing with both herbs in order to avoid the need for a 3rd.

Noteworthy moments

If you don't know the game well, or don't want to watch 2 hours, here are some entertaining moments in the TAS:
  • Chapter 3 armor offer
    • The odds of getting all 3 of these offers I do here, are about 1 in 68,719,476,736. Getting any amount less than this would mean either getting treasure or random encounters, costing more time.
  • The sword of decimation
    • Normally cursed items are so bad as to be completely useless. But it is nice to be able to save time using this strategy.
  • The Final boss fight
    • This fight is done with a single living character, under-leveled, with almost no HP, and cursed...and he wins.
  • Tripping
    • Because Taloon is low on HP, the AI decides he must parry instead of fight. Fortunately this does not affect his antics. Therefore, tripping and getting a critical hit is necessary since I can't simply attack (and reinforcements is too slow since I only need one hit). It was nice to be able to show off this antic in the TAS.

Lua scripts

  • Core File
    • This was the core file that all the scripts used. It sets up common actions as easy to write statements such as c.WaitFor(10) to run 10 frames with no input, or c.PushA() to emulate 1 frame of pushing A. Most of the scripting I did was "one off" set ups where I wrote a series of commands specific to a scenario.
  • Critical Hit manipulation
    • While most botting I did set up a basic loop and did "one off" logic, some actions were common enough to warrant their own script. When a critical hit was not the first action in a round, this was the script I used to manipulate them. I set it up so that the variable parameters are at the top to set up prior to botting. I considered using the Bizhawk forms library to turn these into a GUI to more easily set up a bot, but it really wasn't much harder to simply type them in each time.
  • Miss manipulation
    • Almost identical to the critical hit script, this is used to manipulate the enemy to miss.
  • Single action manipulation
    • Sometimes you don't have the luxury of having previous actions to start a manipulation from. This script is the last resort technique. You start it on the lag frame before the action. The logic is that it will mash random buttons such that it will delay the ability to press a button to scroll to the next action. Then it delays a frame and presses a random button. There's a max of about 30 frames that you can delay this way. There's not a lot of RNG variance either. But this script can get decent results when there are no other options.

Known Improvements

As with any complicated and long TAS, I found improvements along the way. If anyone (or I) were to improve this TAS these are things I caught too late in my final version to warrant redoing
  • Chapter 2 - Get one more str stat increase in the level ups after the first boss fight, and manipulate the skeleton to have minimum HP (42). With one more strength stat, Alena's max damage is 21, and so it would only take 2 rounds to kill the skeleton instead of 3. At the time of the level ups, I got one less than max strength because getting one more str was going to be a huge delay. Much later in the TAS I realized the Skeletons min HP was just enough for this to be worth it. This would improve the TAS by about 100 frames minus the frames it would take to manipulate the extra strength (would have been 40 or so frames I think).
  • Chapter 3/5 - If I could have gotten 3 more HP for Taloon, I could have used one less medical herb at the end of the TAS. It was hard to know this until it was too late in the TAS. It would surely be possible to get 3 more over the course of so many levels. While I tried to get a lot I was balancing max HP vs large frame delays (you don't get much RNG help from button presses during level ups). This would save about 200 minus the time it would take to manipulate the stats
  • Fadeout lag - In the early stages of this final TAS, I did a sloppy job on fadeout lag. Whenever you enter a town, cave, stairs etc, and the screen goes black, it is actually random how many frames it will take (as if there wasn't enough random things in this game). I could save a few frames on a lot of the screen transitions in the early chapters which would add up to a second or two probably. While this is the smallest known improvmeent it is the one that bugs me the most because I realized embarrassingly late that this was random, and it took that long simply from my own sloppiness of not investigating random frame in non-battle parts of this TAS (I guess I was too focused on those since they are the majority of the effort).
  • Better RNG manipulation - this isn't even worth mentioning as it should be obvious. Both frame delays and input affect the RNG but most frames are not input frames. In theory, all these events could be done without frame delays, but in reality that's impossible. All my bot scripts are designed to try to find the minimum frames possible for an action, but there's always more that can be done. For instance, one could get a different RNG seed before a boss, and maybe the total delay frames is better if done so. So this TAS (imo) does a great job keeping delays very small, but one could always bot more and redo more and squeeze more frames. At this point it would be digging through granite though.

Thanks

Much thanks to Invariel for being encouraging and keeping me motivated through a TAS that was extremely difficult and demotivating. Also everyone on the IRC channel for their endless Balzack jokes. Also to anyone who posted in the Dragon Warrior 4 thread for help and encouragement.

Final thoughts

In Oregon Trail, I sacrificed my own family to save time. In Star trek, I killed helpless comrades in escape pods to save time. Here, I kill my allies to save time. I think I need help.

Noxxa: Judging.
Noxxa: A well-received run, with good significant improvements over its predecessor, and with a fair amount of humorous tactics making for an interesting journey of a rather dysfunctional party. Accepting to Moons as an improvement to the published run.
Spikestuff: Publishing.
Last Edited by adelikat on 11/2/2023 1:12 AM
Page History Latest diff List referrers