Submission #2656: Acmlm's NES Destiny of an Emperor in 1:21:09.61

Nintendo Entertainment System
baseline
(Submitted: Destiny of an Emperor (U).nes USA)
FCEUX 2.1.3
292658
60.0988138974405
11293
Unknown
Submitted by Acmlm on 5/6/2010 5:12 AM
Submission Comments
  • 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.
Last Edited by adelikat on 11/28/2022 4:57 AM
Page History Latest diff List referrers