Legacy of the Wizard was the subject of my first two TASes back in…whoa…2007. Since then, I’ve made a good half-dozen significant attempts at an improvement, with incremental improvements in scripts and other work to decode and conquer the RNG. What really held me back, though, was never really finding a route improvement that was fast and novel enough to keep me motivated through all four crowns. I was surprised and pleased by the route that finally did it—watch first if you know the game and want to be surprised at this 58.5 second (3,511 frame) improvement to the published TAS
. Both the regular
and "Live Atlas"
encodes include closed-captioned commentary.
- Emulator used: BizHawk 2.6.3
- As fast as possible
- Takes damage to save time
- Manipulates enemy movements
Manipulates luck Makes the RNG question whether free will exists or everything happens according to secret plans involving scrolls and crosses
"Live Atlas" Encode
In addition to the usual encode, I’ve provided an atlas-style encode that I call a live atlas, which uses camera hacking and image/video processing scripts to show the actual doings of offscreen enemies/items on the current level. Obviously, this was inspired by the NES Atlas series
, which I’m a huge fan of. However, the process I used doesn’t use any external map content – the only inputs are data and screenshots from the emulator.
Unlike most NES games, Legacy of the Wizard spawns and animates enemies that are way offscreen (all 9 enemies on each level). When the first NES Metroid Atlas video went up, I immediately wanted to show what all those enemies were doing but didn't pursue it further. Seeing AndyDick's LOTW Atlas video
was a huge thrill and definitely motivated me to finish this TAS and revisit my atlas idea. Coding and refining the encode (over, and over, and...) pushed the submission back by about 2 weeks. In the process, I found some other fun adds – moving the boss HP sprites, providing a game-aesthetic scroll counter. Finally, for the Atlas portion, each level is only revealed when the player enters it for the first time; this was inspired by Angband
and I hoped it would evoke a sense of discovery as the run progresses. Since it’s all script-generated (although said scripts take about 6 hours start to finish), I’ll likely do encodes for the previous TASes in this series in the coming days.
About the Game
What most everyone who has played this game agrees is that it is exceedingly difficult to play and beat, especially without an instruction book to explain the goals and mechanics. Despite ceaseless toil, I couldn’t beat it as a kid and, armed with near complete knowledge of the game now, it’s still tough for me to beat playing in real time. Between that difficulty and lack of a save battery, it’s fondly remembered by many but wasn’t a big hit.
You play as members of the Drasle family, on a quest to collect the four crowns needed to find the Dragon Slayer, the only weapon that can defeat Keela, the dragon. The game has great music and an enormous, interwoven labyrinth, with a map that is still a thing to behold today. Each character has strengths/weaknesses and access to particular items that make them helpful in certain parts of the open-ended questing.
Although they have different titles, Legacy of the Wizard and Faxanadu are part of the same series. In honor of this connection between standout under-appreciated games, I use the plural "golds" to describe the game’s currency.
Superficially, this route is more similar to that of my first TAS and current WR speedruns, in that it uses Lyll to get the first 3 crowns, skipping the Xemn character entirely. Other notable features are that we obtain the Power Knuckle but skip both the Magic Bottle (used to pass the “13 column” screen as Lyll in first TAS) and Key Stick (used in all prior TASes to open doors for Meyna’s crown). These three item choices are heavily interdependent throughout the run and drive me to collect a huge number of enemy drops, most notably for keys and magic, without stopping to grind.
Trying routes without the Power Knuckle resulted in many disappointing efforts. It doesn't take much time to get, but looking only at the time it saves on bosses, it wouldn't quite seem worth it. However, for this route it's vital as it is twice as efficient in damage per magic point (4x damage, 2x magic usage) and allows many enemies to be killed at a distance with one volley of fire, that would otherwise require multiple volleys with the associated long delay. This is most pronounced on the "13 columns" screen where the knuckle allows me to kill the diving enemies such that I can pick up their drops with minimal delay.
Because of the degree to which resource management and luck manipulation dominate the run, it is difficult to compare times to prior efforts on an apples-to-apples basis for particular sections. It takes time to kill so many enemies and take their drops, but that is weighed against extra money to buy the Key Stick, and time and money spent equipping the Key Stick and Magic Bottle at Inns. Overall, I believe skipping the Key Stick/Magic Bottle saves about 10 seconds and certainly seems the more entertaining option for any %.
As described below, the random chance of a scroll or cross drop is 1 in 20, and the chance of a key drop is only 1 in 10. Needless to say, with the many crosses/scrolls and dozens of keys we manipulate, much energy was spent twisting and bending the RNG to the absolute max production I could manage.
There are some small speed/entertainment tradeoffs in the run, maybe 45 frames in total. For several item drops where the fastest pickup would have the player hiding the item or show the item for only 1 frame, I let the item show for 3 frames before picking it up. In my viewing, this was the minimum to be able to see what the item is before it disappears and significantly improves the viewing experience. Also, when Roas kills the sphinx that technically wastes 6 frames -- as the 3 magic points used take that long to get filled back up when he visits the Inn later. I thought it was a little funny to kill it after climbing on it, especially on the atlas encode where its death sprite sticks around when we leave the screen.
Characters Used (in order):
- Lyll (daughter) – Jumps high, weak attack. Only character who can break blocks with the Mattock.
- Meyna (mother) – Smaller jump, better attack. Only character who can use the Wings, Crossbow, and Key Stick.
- Roas (son) – Small jump, weak attack. But only character who can use the crowns to collect and then use the Dragon Slayer, which is required to fight Keela, the final boss.
Items Collected From Chests (in order of collection):
- Power Knuckle – Increases attack power to 4x normal when equipped. Shots cost twice as much magic, so damage per magic point is doubled. This was not collected in my previous TAS.
- Money Chest – Worth 50 golds! For comparison, an enemy drop money bag is worth only 2 golds.
- Crown – Collecting one will take you to the next boss. Once all 4 are collected, Roas (the son) may equip one to go after the Dragon Slayer sword required to win the game.
- Scroll Chest – Duration and speed increase are twice that of a normal scroll, making these very important for saving time. There are only 3 of these in the game and I collect them all.
- Wings – Mother-only item; this lets her fly around the screen when equipped and is the only way to pass over spikes with low (1-block) ceilings.
- Key Chest – Gives 20 keys (net of 19, as 1 is required to open it!). There are 3 in the game and all are collected.
- Mattock – Daughter-only item, purchased from store. Breaks blocks at the cost of 1 magic point. Required to get Lyll’s crown.
- Crossbow – Mother-only item; shoots blocks at the cost of 1 magic point.
Notable Items Skipped:
- Magic Bottle – When equipped and you run out of magic, this refills you back up to 99. Used in my original TAS (and in current real time speed runs) to pass the “13 column” screen in Xemn’s area using Lyll.
- Key Stick – Meyna-only item that allows doors to be opened using magic instead of keys.
- Glove -- Moves blocks one square at a time. Only usable by Xemn, which lets him pass the "13 columns" screen and other block challenges easily but requires a long trip and extra character change to obtain and use.
The RNG updates only when needed, which often happens at the start of a new screen and after that depending on when enemies need a new action. However, not all updates are created equal - depending on whether the game wants a 0-19, 0-5, 0-2 etc. result the ending RNG state for a single call will differ. So, I wrote many Lua scripts that emulated the RNG and would forecast items coming available from kills and crosses, but this was complicated on a few screens where enemies mix and match different RNG calls unpredictably.
Otherwise, all enemies use the same algorithm for computing drops, which are calculated based on the RNG when the enemy falls offscreen. Also, crosses kill every onscreen enemy, which freezes the RNG other than a d20 for each item drop. The flicker animation freezes the player for several frames.
Once I found a target item in my forecasting script (say, a cross), the challenge is to line that RNG state up with a killed enemy dropping offscreen. Sometimes the player can influence enemies to make faster/slower RNG calls by moving in certain locations. Sometimes I kill enemies just to prevent them from making unwanted calls (if I can spare the magic). Switching back and forth vertically between certain screens (especially 13 columns) is often the fastest way to advance the RNG as many screens make calls shortly after loading.
Another nuance is that there are 2 major groups of RNG behavior. One makes calls of d3, d6, and d4 for a single enemy in a single frame. The other just makes a d3 call (or sometimes two) in a frame. For many cross/scroll drop situations, the desired item is much more readily available in one vs the other RNG group. This occurs throughout the game, but especially at the dungeon entrance (the first screen is 3-6-4, the next down is 3, and the bottom of the ladder is again 3-6-4). Having different groups connected vertically like this is ideal as you can quickly go back and forth to fine-tune the RNG for what is needed.
Item Drop Algorithm
- If the player is critically low on life (<20), magic (<29), or keys (<2), then the game will drop the needed item (evaluated life/magic/keys if multiple are low) without updating the RNG -- no scrolls, crosses, poison, NOTHING else will ever drop until you're back in the green.
- If nothing is critical, then a d20 RNG update is called and there is 20% chance of poison, 10% key, 5% ring, 5% scroll, 5% cross, 55% life/magic/golds - whichever of these three you have LEAST of at the time the drop appears is what you will always get.
At a glance, my route shouldn’t require much golds: You start with 50 golds, there’s a 50-golds chest in the first level I visit (Pochi’s), and I only need to spend 115 golds on the Mattock and 2 Inn stays. So, you might see that I aggressively collect golds throughout, and think it’s wasted excess. However, those extra golds are one of the most important time saving strats, especially for the 3rd and 4th crowns.
The reason is that fully 55% of RNG-based item drops will be “normal” items—bread, magic, or golds, whichever you currently have LEAST of. The impact of this is massive: if your golds are less than 30, it is impossible to get ANY magic refills until your magic drops to 29, at which point EVERYTHING will be magic – no scrolls, keys, or crosses. The same is true for life/bread at the 19 point level and when you have 0 or 1 key.
Having golds above 30 (the higher the better) lets me grab magic refills before I get desperately short on magic, which greatly increases flexibility on how I attack many rooms. It also provides the opportunity to grab an extra magic refill or two as extra on-route items on a cross drop whose main focus is either keys or a scroll.
Another notable use is on the “13 columns” screen, where I start grabbing magic refills on the 2nd column. If I had any less golds there, I would have gotten a golds drop instead of magic, making passage without the Magic Bottle item much more difficult. This isn’t theoretical—after a couple of test runs, I adjusted my route on the 3rd crown to collect more $ for just this reason, in particular with the cross drop on the screen before.
Forced Item Strats
The TAS expends a lot of effort keeping life/magic/keys above the level where item drops are forced: We have a ton of scrolls and keys to collect, so we can’t afford to have every item be a refill for very long. But there are several situations where intentionally forcing items is advantageous.
On the screen where I collect the Wings, I intentionally go down to 1 key opening the chest. Meanwhile, I have killed 5 enemies, who are falling offscreen. Ordinarily, only 1 in 10 items is a key, but having just 1 key forces all five drops to be keys. This is a huge boost toward completing the run without collecting the Key Stick and saved a few seconds through not having to generate RNG-based key drops elsewhere.
One side effect of generating forced items is that, unlike regular item drops, they do not update the RNG. Usually, this doesn’t matter, but it can be used to great advantage.
If the enemies that a cross kills would normally drop another cross (useless, because the enemies are already dead), forcing can be used to make the 2nd cross appear as the first item on the next screen (very useful!) instead. This only works if enemies on the following screen don’t use the RNG, but I was able to use it once in Xemn’s area. To do this, I waited until just before the 2nd cross would have appeared and then wasted magic. All remaining items on the current screen were forced to be magic refills, and the cross was teed up for the next screen. The same technique can be used with scrolls, keys, etc., but the payoff is bigger with a cross.
Another cool strat that I used a few times on the 3rd crown is to grab a cross and have magic at 30 until, e.g., the scroll I need is generated, then “waste” a shot to put magic at 29, forcing all remaining items to be magic. On the screen in Xemn’s area with the very tall pillar (requiring 2 pause jumps), I use this to maximum effect, having magic >= 30 to generate a cross, then going to 29 and grabbing 8 magic refills, to get up to 69 (minus a few points for blocks I have to break).
Generating a cross is great but then you need to make sure the enemies it kills drop the items you want, where you want them (not off-route, buried in walls, etc). Many potential crosses were declined in this route as the available drops weren't good enough (most often 1 scroll + n keys is what I'm after, where n is as many as possible). With a script showing the drops for each RNG state ahead, it's pretty easy to see what's available and there isn't much you can do to modify that menu (rarely, killing an extra enemy may tweak one or two items). If a needed item is there but dropping off-route, you can sometimes push it on-route by shoot an extra enemy before grabbing the cross. Its drop then appears earlier than it otherwise would have, shifting the item that each affected enemy drops. This was very useful at several points in the run.
Some Dodgy Game Mechanics:
As suggested above, this game has a lot going for it, but the developers made some questionable design choices as far as the game’s mechanics are concerned. Many are present in some other games, but I haven’t encountered one with all of them. Here are some of them, with notes where they affect the run:
- No proportional jumping – you jump the same height, regardless of how long you hold A down. This makes some platforming and item collection both slower and more difficult in terms of planning. I had to miss a money bag with Lyll on the screen at the bottom of the start ladder because the bag was on a small platform and I would have had to take an entire jump and wait to land to grab it. Where possible, I jump into the lowest possible ceiling to limit extra floating time.
- Resources are required for the basic attack -- Without special items, you need magic to attack anything! I think this would be more reasonable if the player regenerated magic naturally with time, or if each character's shots were more powerful. Apart from making the TAS hard, it has the effect of creating not-particularly-fun (IMO) resource strain for casual play - like if Link could only swing his sword so many times (heh, assuming he collected it).
- Beam-style shot damage – Like Metroid’s Wave Beam, shots don’t stop when they hit enemies. However, the enemies have no invulnerability period, so they take damage each frame that they’re in contact with the shot. (Well, one enemy does – each shot can only damage one enemy on each frame). This is annoying as it makes damaging distant or fast-moving enemies very difficult. However, it also makes the stationary-shot glitch (press left/right or up/down when shooting) lethal, especially with the Power Knuckle equipped.
- Long-fall damage – is also annoying. But it can be avoided by landing on blocks in the top row of a screen, using the Glove/Crossbow to move a block (Mattock doesn’t work), switching to the Wings. Going to the start screen also works but wastes more time than the bounce does.
- Power-up timers – The scroll and ring timers always run, even when the game is paused, you’re in the house/inn/shop, between screens, always. Usually, this is a disadvantage, but it’s used to maintain scroll speed between character changes.
- Player invulnerability – Lasts up to 1 second, or at little as 2 frames, depending on where the frame counter is. So, in realtime play you can get double-hit without warning.
- No Horizontal Momentum – Despite allowing fantastic rates of travel, you can turn on a dime.
Other Route Notes:
Getting this first requires very intensive efforts to collect the keys necessary for doors, the Power Knuckle, Money Chest, and Crown. Lyll’s weak shot power is a further difficulty. The other chests on the Crown screen are mimics that do 100 damage. I collect a ring (gives 10 seconds invulnerability) two screens below to get past safely.
Opening the Crown chest drops me to one key, meaning I have to wait until the scroll drop appears to open the chest, or I would get a key instead (which happens unless you have 2+ keys). However, it’s faster than getting another key as I already collect them very aggressively.
In the room with the Wings, I manipulate the enemies to crowd together so I can easily kill them and collect their drops. (Well, not that easily with Lyll’s pea-shooting attack). Before the first enemy drop appears, I then open the Wings chest, leaving me with one key. This forces all five enemies to drop keys – the last time I can use such a strategy as there’s a Key Chest (20 keys) just ahead – giving me a good head start on efficiently skipping the Key Stick.
On the screen with the Mattock shop, I kill 2 enemies when my magic is low, forcing magic refills. By waiting to collect these until after I visit the Inn, I plump my magic to the absolute max of 109 (Inn will only refill to 99, and due to the item drop algorithm it is not normally possible to get refills above this).
The Inn visit is actually a significant inflection point in the run – I don’t go to any other Inns until just before the final boss (to equip the Dragon Slayer). Starting now, I need as many key, magic, and golds drops as possible, while making every effort to conserve life and magic.
The sphinx makes an RNG roll every 48 frames that it’s active, and each time there’s a 1 in 3 chance of a big jump. Otherwise, the RNG on that screen doesn’t change, making it necessary to plan ahead and manipulate the 1 in 27 circumstance in which the sphinx will jump 3 times in a row. This was painful enough that I wrote a script just to predict it. In the end, I had quite good luck and did this with minimal delay on the prior screen.
See my notes above on why I go crazy collecting golds. This crown is all about setting up to pass the “13 columns” level, with 117 breakable blocks, without the Magic Bottle.
Manipulation on the “13” screen is done by going back and forth between that screen and the one below. The “13” screen updates the RNG when it loads to set the starting position and direction of the “speeder” enemies that fly around, but then doesn’t do so for many seconds. The screen below has an active RNG, so I tried combinations of waiting there and letting the “13” screen load. This required scripts to predict the speeders’ position, direction, and what the subsequent item drops would be (mainly for the scroll and to avoid poison or rings, which aren’t useful).
In my early strategies, I tried getting through while killing as few of the diving enemies as possible (since, except for the speeders, which die when they hit the player, killing enemies costs magic). However, I had much better luck using the ladders to reset the enemies so I killed as many divers as possible. With much tweaking, I found ways to do so with minimal delay while manipulating a good number of speeders into the kill zone as well.
One strat that isn’t obvious is that the slow-moving divers and the speeders each do 4 damage, while the fast divers only do 2. So, in a few cases I was able to take a hit from a fast diver and get invulnerability, then make contact with a speeder and kill it while saving 2 life.
Overall, this was one of the most elaborate sequences of gameplay I’ve ever had to work out; apart from manipulating the scroll and a bunch of refills on the following column, I think it’s pretty fluent. I hope people like it as much as I do!
I leave “13” in rough shape, short on magic, life, and with an expiring scroll timer. This was agonizing as I had to find a scroll very quickly and efficiently or face re-doing “13” for the umpteenth time. Luckily, by running down to the bottom of the screen, I was able to manipulate two enemies to be killed from below for magic and a cross, with a scroll drop that was just reachable (scroll timer had about 10 frames left).
From there, it wasn’t bad. I did need some life and there’s no RNG on the Crown screen, so the scroll there had to be manipulated on the 2 screens before, which required taking some damage but overall worked out to be reasonably quick.
I had bad randomness with Archwinger, who wanted to keep shooting undodgeable (and fatal) bullets at me while refusing to sit still long enough for my shots to do their work. I used some jumps to manipulate a good outcome without too much time lost.
In an earlier test run, I was able to wring six keys on the screen with the Crystal. Considering keys are 1-in-10 items, this was stupendous, and so naturally couldn’t be duplicated with the RNG I encountered with the final version. Instead, I got 2, which is a bit lower than average, I’d say. Luckily, I’d scavenged more keys earlier in the run, so this wound up not being a big deal.
Having both the Wings and Power Knuckle with Meyna is quite fun under TAS conditions. She can basically move anywhere and one-shot-kill most anything.
As this stage went on, magic gradually became more of a focus than keys – which was a surprise. But the stage is extremely long, and completing it without any Inn visits requires a lot of magic refills and careful management. I had to redo the whole second half of the stage for just a couple more gold and magic refills, but that made all the difference when I got to the last few screens.
The last long-trek screen before the Crown is notably difficult as it has no RNG, only 6 enemies that can be killed for drops (3 are hidden among the locked doors atop the screen) and it is a must to manipulate a scroll as near as possible to the exit. As well, the screen before is another long one where I need to use a cross – after which, the RNG doesn’t run there, either. To conquer this, I used a script that would look at item drops multiple screens ahead, and the solution used here was really the only hope to get through.
The Rockgaea fight can be a few frames faster with better luck (it depends on when/where he shoots his bullets, which cause the player’s stationary shots to disappear when they hit) but this isn’t bad – there isn’t much opportunity to manipulate him as I need the cross and scroll drop just before grabbing the Crown.
I got faster scroll drops and a better sphinx climb, but otherwise the route to the Dragon Slayer was the same. I have to wait behind a door for the game’s final scroll to drop, or it would have been a key. If I had an extra key here, I could have gone through the door earlier to kill the enemy that drops the scroll with stationary shots and saved 25 frames, but it would have taken longer than that to get an extra key.
Keela’s head becomes vulnerable before the feet, so I made a small improvement by taking an early diagonal shot. A bigger improvement was obtained by jumping such that I hit Keela’s head, which pushed me back through the air to the left, while still being able to fire right (normally, you can’t move left and fire right). The landing was perfect to be far enough left that I wouldn’t burn up and die along with the boss, while also triggering Keela to breathe fire at me just as s/he died – an effect I think looks pretty cool.
Because this run excludes some of Xemn's cool gameplay with the Glove, I'm planning a 100% version that collects all chests and kills all enemy spawn points at least once. I have a route plan, but haven't started on that yet.
: Updating file to one that syncs. The author had mistakenly uploaded a non-syncing file, which is part of the reason this has taken so long to judge.
But now, I am accepting this movie to obsolete NES Legacy of the Wizard by Lord Tom in 13:42.88
. Quite impressive! Like I already mentioned in the submission thread, interesting optimizations and crazy strats which are clearly impossible in a real-time run. I hope the helpful subtitles can be included in the publication.