Dragon's Lair (NES)/any%(ntscu)

From SDA Knowledge Base

Jump to: navigation, search

Energy Management

The route shown in the videos below corresponds to the following breakdown of the energy:

Open in new window


A few comments:

  • The sheet doesn't take into account a Lizard King encounter in level 2, since that's pretty uncommon.
  • Early in level 2, there is a hit that only costs 5 frames to avoid.
  • There is a low point of a little over 12 energy in level 2. If you have taken a few more hits than intended, such as missing taking out a few bats, this can become critical. Most of those additional hits are likely to have come in level 1, so consider avoiding the "5 frame" hit mentioned above in that case.
  • There is a second E that can be collected in level 3. This E doesn't cost any time in terms of level progress, but can only be consistently collected while also collecting a G (24 frames lost). Normally, this E isn't needed and should therefore be avoided.
  • The energy drops again towards the end of level 4. By following the route and assumptions here, you effectively have 2 hits to spare (from additional bubbles or the Lizard King).


Level 0 - The Drawbridge

https://vimeo.com/770164534

  • Getting 8 shots to connect in the first cycle requires buffered inputs, including 3 frame/pixel-perfect actions:
    • The first jump needs to be from the right pixel
    • Turning around at the position to throw the daggers from is pixel-perfect
    • Ducking below the fireball is frame-perfect (make sure to stop throwing daggers a bit before to avoid the throw animation from preventing the ducking)
  • At least the first two actions are fairly easy to judge if performed on the right pixels. If that's not the case, the fall-back is to aim for 7 throws in the first cycle and then just add a third throw in the second cycle for a 20 frame loss.
  • Rise up for the second cycle roughly when the dragon bobs its head backwards under the bridge. If you rise too early, the dragon will fire before you've had the time to throw the three remaining daggers. Use this forced delay to nudge forward a bit to get closer to the right side.


Level 1 - The Entrance Hall

https://www.youtube.com/watch?v=TIPOzltHz8o

  • Everything in this level runs on local timers (= spawn as you approach).
  • The earliest possibility to jump over the second prisoner's second stone is to include a delay of 45 frames. The first throw (35) and two quick pauses (5 each) accomplish this.
  • The two throws between the two first poles allow a frame perfect passage under the second pole.
  • Ideally, you get a Lizard King encounter that forfeits one of the serpents or prisoners.
  • The fireballs are the perfect weapon against the serpents at the end since they have 3 HP each and are taken out by one fireball each (they would have required two axes, making the fight slower).
  • If you start attacking the first of the boss serpents too early, the fourth serpent has a delayed spawn, which completely ruins this solution.
  • The jumping in the elevator section is to buffer a perfect exit (although when to start jumping is still subject to player judgement - best done by looking at for example how far the bricks in the background have scrolled).


Level 2 - The Mines

https://vimeo.com/852373780

  • Everything in this level runs on local timers (= spawn as you approach).
  • Buffer ducking at the beginning, followed by firing a shot and a quick stop allow for a perfect passage of the first crushing pillar (40 frames of delay in total).
  • Bumping the head before the set of two crushing pillars provides a frame-perfect buffer for passing through.
  • Even though the axes are weaker than the fireballs, they're still superior for the boss fight due to faster throwing speed (two can be in the air at the same time iso one). The damage per time period is therefore greater.
  • The game mechanics page describes how the section with the Dragon's breath works.
  • In order to collect the three gold above the retractable bridge, you need to include a pause of 10-15 frames. Quick pauses, costing 5 frames, are easy to do. 2 of them will be enough, like shown in the video. If the Lizard King hasn't appeared so far, you will need one gold from the bridge. In that case, just make one quick pause before the bridge.
  • In the dark section, two axes were thrown against the last bat. The second axe works as a timing buffer for being able to walk over the two moving platforms without stopping (just make sure the first platform has spawned before starting to throw).
  • The first stone from the foremost mine trolls looks like it's bound to hit you, but it won't. The key is to get hit by the bat at the same time. However, if the Lizard King appears, the stone will for sure hit. In that case, the following alternative solution is only half a second slower than above (but overall 2 seconds faster since no gold means time saved from avoiding the countdown screen). https://www.youtube.com/watch?v=gK6dmWYd5Ns
  • It's possible to get 4 hits in the first cycle on the second troll. This saves 20 frames at the end by only having one axe throw left to finish it off. Many times the fourth axe can be blocked and it can be difficult in real-time to know for sure if 3 or 4 axes connected. Listening for the "hit" sound effect can give a good indication, but it can still be difficult to judge in some situations.
  • In the elevator shaft is first shown an easy and risk-free method to always get to the right-most pixel to stand on. Just like in elevator shaft before level 2, the jumping is to time the exit. Although again, the timing for starting the jumps is up to player judgement (the easiest appears to be by looking at the tiles in the background).


Level 3 - The Reaper's Domain

https://www.youtube.com/watch?v=ZQ93ohXDc5s

  • Lizard King encounters are not possible in this level for unknown reasons.
  • All the platforms run on global timers that start when you enter the level. Everything else runs on local timers.
  • As mentioned in the energy management section above, it's possible to skip the second E, since you hopefully should be close to full energy anyways. That will also avoid collecting the G. If you've taken a few unintentional hits, skipping the E will make the remaining part riskier though.
  • The way to get over the pit with the two platforms requires quite precise inputs. A key element to make it easier is that you always take a quick step on the first platform you land on. This will ensure the big skull has spawned before the small jump to the second platform and it will then be at the right height when you jump under it. There are several other options for passing this pit, but they're considerably slower and don't appear to be that much safer.
  • The last pit can be cleared by one big and one small jump for the expected 5 frames saved. If your toes are above the void when jumping from the left side onto the platform, a small jump is enough. Otherwise you need to make a big jump to reach far enough.
  • The timing for starting the two jumps against the Reaper is somewhat small if you want the optimal six hits to connect. However, it also relies on RNG, as the last hit rarely connects if its finger is raised.
  • A more consistent, but also ~40 frames slower, reaper strat is shown here: https://www.youtube.com/watch?v=AZ1iWw7k13s. This strat was taken from a speedrun by z_fox.
  • There is actually room to stand behind the Reaper's finger and keep attacking. However, to get to that position only works if the Reaper's finger is raised for the first two shots. It's not hard to see if the finger is raised for the first shot and react, but the second shot will be like a leap of faith. The following video demonstrates the strategy: https://www.youtube.com/watch?v=hTnMUVn5nhg. This strat is normally (the raised finger blocked one of the initial axes) a few tenths of a second faster, but can also be 2 seconds faster, like shown in this video (all of the initial axes connected).



Level 4 - Dragon's Lair

https://vimeo.com/770164424 (based on SBDWolf's route in https://www.twitch.tv/videos/1139030662?t=00h05m52s)

  • The baby dragons have different take-off angles, which can be manipulated by introducing pauses (linked to the bubble cycles, see the section about baby dragons for more information). Some patterns allow Dirk to jump past them:
    • The third baby dragon will have a low take-off angle by adding a pause of 60 frames or more. The fastest way to do this is by throwing twice (55f) and then pause movement for one game frame (5f). An alternative and slightly slower method is shown in the linked video, ducking and jumping costs 70f. The jump over the dragon must be done from the last pixel of the platform.
    • There is an undocumented report about jumping over the sixth baby dragon (from 'ktwo')
    • The seventh baby dragon can be skipped by introducing a pause of 20 frames. Note that Dirk's jump up to the platform where the 6th dragon spawned can impact the bubble cycle the 7th dragon is linked to. If jumping too early, a longer pause than the 20 frames will be needed.
  • The absolutely best case would be to have the Lizard King spawn at the 9th (the last) baby dragon, so you can avoid the two vertical jumps. That saves up to 4 seconds. It's an uncommon event though.
  • Singe's puffs are random, but they seem to be spaced equally (every 145 frames) and the interval between baby dragon spawns is also set. Note that the game's RNG-algorithm gives results that are quite far from a perfect RNG-function. How this impacts the fight with the approach shown in the linked video has not been investigated in detail. However, below are some real-time tests.
  • The only way to survive if Singe starts with two low puffs is to buffer two jumps together. This will ensure that the baby dragon dies. If the second jump isn't buffered, the baby dragon will get Dirk. However, this means engaging before actually seeing the second puff. So if the second is a high puff, you'll get hit guaranteed. There doesn't appear to be a way around this. Whether you buffer jump or wait and duck, you'll have a 50/50 chance of surviving. Since a low puff is advantageous because it allows you to attack, you might just as well jump and hope for that second low puff...
  • Doing a jump forward for the last hit on Singe is a good time save (2-3 seconds), but also risky. It can be hard to know exactly how many hits are left (especially since the baby dragons often block a few of your axes).
  • Note that you can exit the level while crawling (all the other levels require that you walk out). This is good to know if you at the very end of the fight need to duck (e.g. to take out a last baby dragon).
  • Below is the result of 10 save stated playthroughs of level 4. The table shows the high and low puffs of Singe in each attempt.
1 H L H L H H H L H L H L L H L H H L H L L
2 H L H H H L H L L L H H L L H L H L L
3 H H L H L H L H L H L H L H L H L H L L
4 L H L H H L L H L H H L H H L H L H H H L L L
5 L H L H H L H H L L L H H H H L H L H H H L H L H L L
6 L L H L H L L H L H L L H L H L H
7 L H H H L L L H H L H H L H H L H L H H H H L H L L
8 H H L L H L H L H H H L H L H L H H H L H L H H L H
9 L L H H L H H L H H H L H H H L H H L L H L H H L H L H
10 H L H L L H L H L L H L H L H H H L H

There is not much of a pattern, as expected. A few observations can still be made though.

- 105 of 227 puffs were low, so close to half of them, but still with a bias that seem to correspond with reports from real-time speedrunners having the impression of getting slightly less low puffs than what would be expected if it had been a 50/50 chance for each type, every time.
- The fights lasted from 17 to 28 puffs, with the average fight length being 22.6 puffs and a standard deviation of 4. With one puff being blown every 150 frames, the spread is 28 seconds...


In the NTSC-J version, Singe can be skipped if the Lizard King spawns in the boss area at the right time. The same doesn't appear to be true for the NTSC-U version. The following video shows an example of what happens when the Lizard King and Singe spawn. The game becomes unwinnable since you can't deal any damage to Singe. You can at least escape the situation by suiciding against Singe's body. However, the game can also completely freeze. Either way, no method for completing the game with the help of the Lizard King has been described.
https://www.youtube.com/watch?v=goEf5-qU7ZA

Alternative Singe fight (TAS puff pattern) - method 1
https://vimeo.com/770167148
The standard approach to fight Singe is standing on the left side of the screen and dodge and attack as best as one can, which is also the method shown in the video of the whole level. A very good fight in a real-time attempt can then be done in 15 or so smoke puffs (each one separated by a 145 frame delay).

An alternative way of approaching the fight is to trade the (relative) safety of staying on the left side for maximum aggressiveness by staying close to Singe. This can shorten the fight down to a "6-puffer" by being able to land 3 axes every big jump, as well as adding some small jumps (with time for 2 attacks). The downside is that all 6 puffs need to be of the right kind (= H, L, L, H, L, L) and the execution is also somewhat tight. The video above shows the fight, but here is a breakdown of it:

  1. The first jump before the fight begins is pixel-perfect. If you jump too early, only two axes will connect (one can be seen flying past Singe). This is still a winnable situation, but requires a slightly different approach after taking care of the second baby dragon to compensate for the missed attack (video link to be added). This will lead to a 75f slower fight. If you on the other hand jump too late, there is not enough time to kill the baby dragon and the fight is immediately over.
  2. Duck upon landing and kill the baby dragon. Note that the actions in steps 2-4 need to be buffered/without any delay. Else the second axe throw in '4' will be blocked by the 2nd smoke puff. This can be mitigated in the same way as described under step 1 when jumping too early into the fight and the first axe didn't connect with Singe.
  3. Turn around, crawl to the left, turn right and rise. There are two allowed x-positions (78 and 81, which can be tracked in address $390). Too far left is essentially an unwinnable situation, since there is not enough time to jump and attack twice before the next puff. Too far right and you'll die at the final jump of the fight. The latter can be mitigated by making it a 7-puff fight.
  4. Buffer a small jump and attack twice
  5. Two big jumps over the next two (low) puffs.
  6. Crouch and wait momentarily before attacking twice and rise. This must be done on the first or second-first game frame (so a 10 frame window). If attacking too early, the first axe throw will not hit the baby dragon. If attacking too late, you'll rise too late and either have one of the axes blocked by a smoke puff or simply not have enough time to jump over the next smoke puff.
  7. Buffer a small jump, a big jump, a big forward jump and a small forward jump, while attacking.


As mentioned above, some of the mistakes can be mitigated by aiming for a 7-puff fight. The 7th puff must then be a low one and point 7 changed to "Buffer a small jump, two big jumps and a big forward jump, while attacking". If Singe has not been defeated by the 7th puff, another baby dragon will spawn together with the 8th puff.

Alternative Singe fight (TAS puff pattern) - method 2
(video link to be added)
This method is easier to execute, but 50 frames slower than method 1:

  1. Jump into the fight with a small jump instead of a big jump. This jump is pixel-perfect. There are good visual cues for identifying if the jump was done on the right pixel. If the jump was correct, the first axe will look like it's almost flying past Singe, but then connects between his chin and belly. If the jump was too late, the two axes will connect with Singe's head. The fight is unwinnable the TAS pattern from this position. See point 3 for how to mitigate. If the small jump was too early, the first axe will not connect with Singe and it will turn into a 7-puff fight.
  2. Duck and buffer two axe throws (if the jump into the fight was very early, the first axe throw can miss the dragon, so it's recommended to throw a 3rd axe for safety in this situation).
  3. If the jump into the fight was late, Dirk needs to be repositioned one movement pixel to the left. So quickly turn around, move once and then turn back. This can be easier said than done. If the correct x-position is not achieved, it will turn into a 7-puff fight.
  4. Rise when the first smoke puff passes by above
  5. Buffer one small and two big jumps, while attacking
  6. Duck upon landing. The next action is the most critical with this method in terms of execution. Throw two axes, the first one needs to connect with the baby dragon on the first frame it has a hitbox. Visually, the axe will fly past the baby dragon, but then disappear against Singe's belly. The baby dragon will then disappear some time after the second axe connected (making it look like it just despawned).
  7. Rise and make a small jump. This will have to be done without delays after point 6. If there was a delay somewhere of one game frame in steps 6 or 7, there will not be enough time to finish the fight in 6 puffs and it will turn into a 7-puff fight. If the delay is bigger, Dirk will not have enough time to jump over the next smoke puff (with the method described in this section).
  8. Two big jumps and then finally a small jump forward, all of them while attacking, to finish the fight.

The fight with this method finishes one game frame before Singe blows the 7th puff, hence why steps 4 and onward need to be without any delays, or else a 7th puff (low) is needed to finish the fight (video link to be added).

A pre-requisite for attempting a 6-puff fight in a speedrun is to practice the execution. For this purpose, it's recommended to apply e.g. the game genie codes APEGLEPV and APEGGEPV, which bypasses the RNG's dependence on player inputs. Entering the Singe fight on the same frame will therefore lock Singe into the same pattern. The following save states (for Fceux and Powerpak) start from right before Singe. Use them after having applied the mentioned game genie codes (or patch a ROM by changing instructions $C003 and $C004 to 0x18) and just walk right without delays and then do a big jump before the fight. The puff pattern will be set up for a 6-puff fight (it also works for a 7-puff fight): File:Dragon's Lair (USA) Singe RNG manip.zip

RNG-analysis of Singe's TAS puff pattern for method 2

As has been mentioned above, the game uses an RNG-algorithm that results in bias. If the RNG-calculation had been ideal, one would have expected the TAS pattern to occur with a probability of 1/64 (= 1/2^6). As will be shown in this section, that is however not the case and there are considerations on how to improve the chances of getting the correct puff pattern. Note that the analysis here is based on method 2. This method is the easiest to analyze, since it doesn't require any R-presses during the fight (assuming the small jump into the fight was done correctly).

After having taken care of the last baby dragon, there is enough time before the Singe fight begins for the RNG-values to enter CL1, 2 or 3 (see the RNG-section for an explanation). And before the first smoke puff is blown, the RNG will change to NCL1, 2 or 3. As can be seen in the "CL to NCL" chart in the RNG-section, there isn't a big difference in the probabilities whether one starts from CL1, 2 or 3. For the sake of simplicity, let's therefore assume the following average probabilities:

  • CL to NCL1 - 70%
  • CL to NCL2 - 13%
  • CL to NCL3 - 17%

One cannot reasonably know in real-time the RNG-values, or even which RNG-loop the game is in. However, by simulating the smoke pattern for possible seeds (so each element in the three possible NCLs (1-3)), combined with how likely it is for the game to be in each NCL, it's possible to calculate the probability of the TAS pattern ("Expected" refers to an ideal RNG-function, that always produces a 50/50 puff probability):

Agg P TAS pattern.PNG Per puff P TAS pattern.PNG

A few observations:

  • There is a negative bias already for the first puff, where a bit over half of the Singe fights will end. A possible way to increase the percentage up to the expected 50% would be to introduce R-presses all the way up to when Singe is about to blow the first puff to avoid the RNG being stuck in one of the NCLs. However, the remainder of the fight will then be difficult to predict (and this hasn't been attempted to be simulated).
  • Similar to the point above, there is significant negative bias for the 3rd puff. Only about a third of the attempts reaching this far will result in a low puff here. One could again argue for introducing R-presses (during the jump over the 2nd puff) to scramble the pattern and get out of the NCLs. This should reasonably improve the chances significantly for the 3rd puff, at the expense of randomizing the rest of the puffs.
  • Of the patterns getting past puff 3, puffs 4 and 5 have a very high probability of being high and low, respectively. The probabilities are so high that the aggregated probability even gets in front of the expectations after puff 5 (4.9% iso 3.1%)! This effect is not by design, but just "how it ended up to be". NCL1-3 only consist of 201 elements. The number of possible start seeds is of course greatly reduced when we get to puff 4 and 5, so only a few "lucky" outcomes are needed for the probabilities to be greatly off, which appears to be the case here. This would not be expected to be seen if any manipulations had been done at puff 1 and 3.
  • The effect reverses for puff 6, which has a much lower probability of being low than expected.
  • Based on the above, one can maximize the probability of getting the TAS pattern by accepting the probabilities up to puff 5. During the jump before puff 6, one should however press R to scramble the RNG-values. This should lead to a probability closer to 50% for the 6th puff, instead of the 27% that will result from not pressing R. If this is done, the chance of a getting the TAS pattern increases from around 1/75 to 1/41, so well worth doing!
Personal tools