• Recorded with FCEUX 2.1.3 (started with 2.1.2), old PPU
  • Fastest time
  • Luck manipulation
I started working on this right after finishing Dragon Warrior, as this game's discussion thread had just been revived about improving the published run from 2006. This was another of my old favorite games, and it seems I was still in the mood for some heavy luck manipulation, so I decided to see what I could do ...
2 months and a cancelled submission later, I've improved the published run by 25:21 (91454 frames), and even my earlier attempt by 4:58 (17923)!
Most of the improvement came from the battles (now twice as fast), largely from better luck manipulation but also better strategies and route planning (sometimes at the cost of more walking or other delays, but always regained), and doing less inn trips.
For how linear this game is, there's quite a bit of route planning (who to get, weapons, etc.) ... I've redone fairly large parts more than once, and kept finding new improvements.

Main changes

  • All-Out is used exclusively through the first half of the game, until Ma Chao
  • I only use the inn 14 times (previously 27) and never ever heal in battle (it's slower than the inn anyway)
  • Max TP gains on level up are maximized
  • All gullwings are bought in one trip instead of two
  • I skip Huo Hu (I don't need him, and only lose 5 TP)
  • I go the long way to get Guan Ping and Lu Bu (they're so much better than the alternatives that it's really worth the time)
  • I capture Wen Hun and (much later) Tai Si Ci and Lu Sun
  • I don't execute Yuan Shu, it's faster to destroy him later
  • Some weapon changes, like getting the Nu Long but not the Qing Guang
  • Different parties/orders

Glitches

When canceling the first character's command, a table index underflow (for TP used) clears a byte in the "character status" table. Guo Ji (from Xu Rong's battle, before Dong Zhuo 1) just happens to belong to that byte, so he's completely removed from the game!
An unexpected (but also minor) one came up near the end, when the game skipped the HP increase text on level up. I have no clue how it happened, but it did save a few more seconds (and looks funny) ...

Luck manipulation

The random number is 4 bytes (32bit), and changes in 2 ways:
  • Simple randomizer function (bit shift and additions), called every frame (except lag) and in a few cases where a random value is needed
  • Add one of the bytes to another and use that as random, in many cases (but not all) where a random value is needed
That second one alone adds a lot of complexity, as it changes the random value sequence and depends on timing. For example, it's called after every step where a random battle can happen, so different step delays before a battle (or anything) will each give completely different results.
During All-Out in battle, I can only manipulate whole turns at once, by introducing delays between each (and canceling/restarting All-Out, which however takes time). Because of this, and the endless possibilities, there's no way I'll get perfect luck or even optimal manipulation ... but I still make most of the game seem much easier than it really is.
I've looked through the game code for everything that happens during All-Out (attacks, tactics, formulas, etc.), and simulated all of it in C so I could bruteforce through lots of delay combinations (up to 1 billion per hour!) and pick the best one I find. Depending on the battle, this ranged from near instant to a whole day ... and that's from a single starting point. I still had to do the rest manually (try different step delays and such, bruteforce All-Out for each), so there's still quite a bit of potential improvement left. But that's easier said than done ...
I've also done the same for random encounters, mostly for manipulating (and optimizing) the few specific encounters I need. Han Zhong, Wen Hun and Zhou Yu each came almost instantly with minimal rebel forces, and each was done multiple times to pick the best All-Out manipulation as well. Then the more extreme case, Lu Sun and Tai Si Ci by themselves (and in this order), is about a 1/20000 chance, and was limited to a very small area at 1/32 encounter rate ... but it still only cost half a second to manipulate!
You can see a screenshot of both in action (and overall setup while working on this run) here:
http://acmlm.cjb.net:2/other/doae-bruteforce3.png

Battle durations

From first command to victory, not counting manipulation delays before each battle:
Enemy leaderOldNew
Yellow Scarves
Zhang Bao15911066
Zhang Jao (1)26761869
Han Zhong (capture)1469390
Zhang Liang850690
Zhang Jao18851139
Dong Zhuo
Hua Xiong18781555
Lu Bu (1)23251382
Li Jue1215877
Xu Rong3441537
Dong Zhuo (1)100691766
Lu Bu (2)71262806
Dong Min1372802
Dong Zhuo (2)40381020
Yuan Shu
Lei Bo29861422
Ji Ling28481422
Han Xian28531427
Liang Ji980667
Chen Lan24811071
Yuan Shu85921459
Yuan Shao (ambush)787618
Ji Zhou / Jing Zhou
Lu Guang56441415
Jin Xuan26401434
Han Xuan81572589
Zhao Fan892690
Xing Dao Rong493502
Liu Du590439
Xu Shou753394
Wen Hun (capture) 97
Yuan Tan891308
Ma Yan316208
Zhang Yi347232
Yuan Shao929779
Shu
Liu Kui38171243
Meng Da27591148
Yan Yan31922138
Huang Quan1126873
Ma Chao30921825
Li Yan747709
Lei Tong1874869
Liu Zheng28591449
Wu
Fan Zhang21511397
Ling Tong17301212
Gan Ning23111497
Zhou Yu25671967
Zhou Yu (capture)949360
Zhu Ge Jin31882139
Ding Feng1548905
Chen Pu36041880
Huang Gai1089554
Sun Yu42932153
Sun Yi1392549
Zhou Tai1024693
Sun Huan940921
Tai Si Ci1618707
Sun Quan30701305
Lu Sun, Tai Si Ci (capture) 342
Wei
Xia Hou Yuan1334646
Zhang Liao1578806
Cao Zhi1624502
Cao Pi (1)38882421
Cao Xiu1442638
Xia Hou Shang1645655
Cao Pi (2)53672371
Si Ma Yi (1)56102890
Niu Jin1341548
Si Ma Yi (2)40912233
Xun Huo1065913
Dian Wei900879
Liu Dai1013880
Le Xin893884
Si Ma Shi1245607
Si Ma Yi (3)32022309
Total17029282089

adelikat: Accepting as a (big) improvement to the published movie.


TASVideoAgent
They/Them
Moderator
Joined: 8/3/2004
Posts: 15543
Location: 127.0.0.1
This topic is for the purpose of discussing #2656: Acmlm's NES Destiny of an Emperor in 1:21:09.61
Player (36)
Joined: 9/11/2004
Posts: 2630
Love it, voted yes, encode incoming.
Build a man a fire, warm him for a day, Set a man on fire, warm him for the rest of his life.
Twisted_Eye
He/Him
Active player (397)
Joined: 10/17/2005
Posts: 632
Location: Seattle, WA
I would have never, never has guessed at the ending party. Fascinating idea to do the last few battles with just four generals! With the high manipulation I guess it doesn't really matter to lose that fifth, and it slows things down to do that one extra menu sequence every time you let the heads roll, great idea! The rest of the run is simply amazing as well, you took this to the stars. You've earned this huge Yes right here.
mklip2001
He/Him
Editor
Joined: 6/23/2009
Posts: 2227
Location: Georgia, USA
This run was madness! Madness!? THIS... IS... CHINA!! Corny references aside, great job saving so much time over your old submission. Yes vote. Out of curiosity, though, it seems like you picked up some generals that you never used in battle, like Dan Fu. Why was that done?
Used to be a frequent submissions commenter. My new computer has had some issues running emulators, so I've been here more sporadically. Still haven't gotten around to actually TASing yet... I was going to improve Kid Dracula for GB. It seems I was beaten to it, though, with a recent awesome run by Hetfield90 and StarvinStruthers. (http://tasvideos.org/2928M.html.) Thanks to goofydylan8 for running Gargoyle's Quest 2 because I mentioned the game! (http://tasvideos.org/2001M.html) Thanks to feos and MESHUGGAH for taking up runs of Duck Tales 2 because of my old signature! Thanks also to Samsara for finishing a Treasure Master run. From the submission comments:
Shoutouts and thanks to mklip2001 for arguably being the nicest and most supportive person on the forums.
Player (36)
Joined: 9/11/2004
Posts: 2630
Build a man a fire, warm him for a day, Set a man on fire, warm him for the rest of his life.
Post subject: Instant deaths are so fun when they actually work for you!
Editor, Skilled player (1198)
Joined: 9/27/2008
Posts: 1085
mklip2001 wrote:
Out of curiosity, though, it seems like you picked up some generals that you never used in battle, like Dan Fu. Why was that done?
Dan Fu, or Xu Zhe when we actually look at the party's names, is necessary to get in order to get beyond one city (Someone blocks a bridge). In addition, the existence of this character in the party means we have someone learning tactics, and thus we're getting MTP. Yes, the Dan Fu we pick up in the cave shows up as Xu Zhe in the party. It's not a mistake on the programmers' part -- There's a story-related reason or something. I saw the run. I will vote yes. You are badly outnumbered in some cases, yet you ignore things like strategy and just go All-Out. And win. You take two generals' heads, and they promptly join afterward. So nice seeing just how much the old run is obsoleted. A note about the damage. How much HP you have has some effect on damage. Or rather, how many digits are visible. It's why in the beginning Liu Bei was taking all the hits -- Guan Yu or Zhang Fei would be so much less effective after taking even a single point of damage. Also, weapons have a massive impact on damage. If one didn't equip the starter flails, one would deal roughly 1/3 of the damage with bare hands. A significant jump in damage can be seen when the Trident is finally obtained. Armor, not so much, until we get close to the endgame and get the nicer ones, but then we take heads and manipulate more luck, so who needs defense? Chi Tu Ma eats up a bit of time to pick up, and there's no obvious effect that Chi Tu Ma does anything, as he's not explicitly used as an item. The hidden agility stat of whoever holds Chi Tu Ma is increased 50%, making manipulation of turn order much faster. Yep, some random notes that I thought would be good to have.
Emulator Coder
Joined: 1/12/2007
Posts: 95
Lots of neat things in this run. Zombie party members(beheaded generals), random acts of plot advancement, suicidal success in battle, getting a whole game's worth of items from 1 shopkeeper, and generally being equally impressive as confusing. Yes vote.
Post subject: Movie published
TASVideoAgent
They/Them
Moderator
Joined: 8/3/2004
Posts: 15543
Location: 127.0.0.1
This movie has been published. The posts before this message apply to the submission, and posts after this message apply to the published movie. ---- [1517] NES Destiny of an Emperor by Acmlm in 1:21:09.61
Skilled player (1651)
Joined: 11/15/2004
Posts: 2202
Location: Killjoy
I really wish this movie had gotten a better response before it got published. Good job anyway, Acmlm. I'd like to know more about the C emulator - how accurate was it, did it not always predict the right answer and etc.
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.
Limne
Any
Joined: 2/24/2010
Posts: 153
It's kind of annoying that this is being published without streamable encode. What a tease.
sgrunt
He/Him
Emulator Coder, Former player
Joined: 10/28/2007
Posts: 1360
Location: The dark horror in the back of your mind
Normally the site provides an archive.org streaming link, but that requires that the link be entered in correctly (which I have addressed) and that the streamable encode derived from the original also exists (which I can't address; Omni will need to do that).
Active player (478)
Joined: 11/14/2004
Posts: 169
Location: Mirabel, Québec, Canada
It had a few inaccuracies at first, and that's why I left a debug mode in ... that made it only simulate one case and show the turn order, moves, targets and damage (with misses and criticals), so I could see exactly where (and why) it was breaking. By the time I finished the run, it was 100% accurate (except for one minor thing, see below), at least for anything that could happen. The delays on cancel/restart were sometimes 1 less than predicted as well (never figured out why), so I had to skip combinations with any 0 delay (in case it'd be -1) For random battles, I had to give it the path and ground types (and surroundings when going for a specific battle, as it affects what I get), but it was also fully accurate, and even generated controller input to be pasted into the .fm2. It was also very fast, even the longest paths (100-200 steps) were almost instant. You can get the source code for both here, if you want to look at it. (might be a bit hard to follow, though ...)
Skilled player (1737)
Joined: 9/17/2009
Posts: 4979
Location: ̶C̶a̶n̶a̶d̶a̶ "Kanatah"
I love how the "All-Out" option was abused in this run. Makes the battles resemble one of my favourite games out there. :P
Editor, Skilled player (1198)
Joined: 9/27/2008
Posts: 1085
An unexpected (but also minor) one came up near the end, when the game skipped the HP increase text on level up. I have no clue how it happened, but it did save a few more seconds (and looks funny) ...
At around frame 279000, the TAS crashes the game under FCEUX 2.2.3 now. Curious if this glitch has something to do with a well-timed interrupt and some timing changes between FCEUX 2.1.3 and 2.2.3
Joined: 4/24/2019
Posts: 1
I'd love to learn more about the underlying code mentioned in a few places here, like where the 32-bit RNG value lives, the table underflow mentioned that removes a character, etc... I've loved this game when I was a kid, and now I love digging into 6502! With the massive disparity between this TAS and RTA, I'd like to learn more and see if any RTA manips based on some of this are possible. Are there any notes or other references?