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 (or use the fire attack disappearing off-screen as visual cue). If you rise too early, the dragon will fire before you've had the time to throw the 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).
  • 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 is blocked. 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 the 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://vimeo.com/852402592

  • 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, there is another E that can be collected in this level, but it results in a forced gold pick-up.
  • The section with the pit and the two moving platforms is worth discussing a bit more in detail. All actions in the linked video are deliberate to allow jumping to the first platform without any pause.

0x24.PNG 0x27.PNG 0x2A.PNG 0x2D.PNG

- If the jump is done from the position in the leftmost image, Dirk will not jump far enough and fall into the pit. However, this position works if there have been a delay of two game frames compared to what's shown in the linked video.
- The next two images show positions that work for getting through this section. The next element is to take a step on the first platform before jumping. If jumping immediately, the skull will spawn too late and end up blocking Dirk. Depending on how big the step was on the first platform, a small step might be required also on the second platform.
- The position in the rightmost image won't work, as it will spawn the skull earlier than in the previous positions and it's not possible to dodge its attack.
  • 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 can be blocked if its finger is raised (but not always?).
  • An alternative/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 after two big jumps 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/852411507 (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. There are 9 baby dragons in this level:
  1. Buffer an attack when the level begins, take a few steps forward and jump and then attack again mid-air
  2. Attack once before the egg, move forward and jump when Dirk is in front of the egg and finally attack once more mid-air
  3. This baby dragon can be jumped over if it has a low take-off angle. A delay of at least 60 frames is then needed. 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 rising costs 70f, but avoids having to rely on a pause in the movement. The jump over the dragon must be done from the last pixel of the platform.
  4. Just buffer two attacks when landing after having jumped over the 3rd dragon. The 4th dragon will always fire before disappearing, so quickly jump up to the next platform.
  5. Try to start attacking this baby dragon as soon as possible to avoid that it fires a second volley onto the platform Dirk is on
  6. Straight-forward
  7. This baby dragon can be jumped over by introducing a delay of 20 frames or more. 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 delay will be needed, corresponding to two attacks.
  8. For unknown reasons, one of the attacks against this baby dragon doesn't always connect (1/3 times?). From experience, crawling a bit more to the left so Dirk's nose is beyond the tree trunk seems to avoid this problem, but at the cost of a time loss.
  9. The absolutely best case would be to have the Lizard King spawn at this baby dragon, saving up to 4 seconds. If the baby dragon needs to be defeated, the method shown in the linked video only works if the baby dragon takes off at a steep angle, which should be the case by moving and jumping as shown in the linked video. If the first jump for attacking the baby dragon is buffered, the attack needs to be frame-perfect to connect (either by throwing one axe near the apex of the jump or by starting to throw axes right after starting the jump, like shown in the linked video). However, if you make a quick pause next to the dagger item before jumping, the attack window will be two game frames instead of just one. The second jump attack is straight-forward. Just buffer jump and attack to get the last axe to connect.
  • Singe's puffs are random, but they are 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

A few observations:

- 105 of 227 puffs were low, so close to half of them, but still with a bias that seems 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 145 frames, the spread is 27 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 ("6-puffer")

The standard approach to fight Singe is by 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 the 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 and the execution can also be somewhat tight.

One can enter the Singe fight by a big jump (with a potential of dealing up to 6 damage to Singe), a small jump (with a potential of dealing up to 4 damage) or walk into the fight (no damage possible as the fight starts). 6-puff fights are possible by starting with with a big or small jump, but it does not seem possible by walking into the fight. Despite dealing less damage, fights starting with a small jump are both faster and slightly less execution-dependent than by starting with a big jump. There are three situations to consider when starting with a small jump:

  1. Jump so early that none of the attacks hit Singe
  2. One of the attacks hits (two possible jump positions, so a 10-frame window)
  3. Both attacks hit


'1' requires at least 7 puffs and will therefore not be considered further in this section. '2' is the best case, in the sense that it results in the fastest fight. It's described below under "method 1". '3' works as well, but is roughly a second slower than '2'. It's described under "method 2".

Method 1 (L, L, L, H, L, L)
https://vimeo.com/853932259

  1. Small jump into the fight. This can be done from two different pixels. If jumping from one of the correct pixels, one of the two axes will hit Singe and one will miss.
  2. Duck upon landing and kill the baby dragon.
  3. Rise and make a big jump over the 1st smoke puff.
  4. Big jump over the 2nd smoke puff and then buffer a small jump. Note: step 2, 3 and 4 can't be fully buffered or Dirk will land on the second smoke puff in step 4. There needs to be one or two game frames of delay in these steps.
  5. Big jump over the 3rd puff
  6. Crouch (under the 4th puff) and attack twice to take out the baby dragon. Then rise. These actions can all be buffered upon landing after step 5.
  7. Wait briefly and then buffer a big jump (over the 5th puff), a small jump and a big forward jump (over the 6th puff). Jump too early and Dirk will land on the 5th puff. Jump too late and there will not be enough time to jump over the 6th puff. The latter case can be difficult to identify visually in real-time, but assuming it's done, it's possible to mitigate by turning it into a slower, but still 6-puff fight. In that case, skip the short jump between puff 5 and 6. Instead, initiate the big jump over puff 6 earlier and then finish off Singe with a small forward jump.



Method 2 (H, L, L, H, L, L)
https://vimeo.com/852463029
If jumping later than what's described in method 1, a different puff pattern and approach are needed. This method is a second slower than method 1:

  1. The jump into the fight 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 with the needed puff pattern from this position. See point 3 for how to mitigate.
  2. Duck and buffer two axe throws
  3. If the jump into the fight was late, Dirk needs to be re-positioned 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 and then duck upon landing
  6. This 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 to finish the fight.

Method 2 finishes one game frame before Singe blows the 7th puff, hence why step 4 and onward need to be without any delays, or else a 7th puff (low) is needed to finish the fight. In the 7-puff fight, step 7 and 8 should be replaced by "buffer a small jump, two big jumps (over puff 5 and 6) and a big forward jump (over puff 7)". A 7-puff fight is at best 45 frames slower than the 6-puff fight.

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, File:Dragon's Lair (USA) Singe RNG manip.zip. They require a modified ROM, either by having applied the mentioned game genie codes (or patch a ROM by changing instructions $C003 and $C004 to 0x18). Save state 1 is for method 1 (L, L, L, H, L, L) and save state 2 for method 2 (H, L, L, H, L, L). For the patterns to work, you need to move right without delay and enter the fight by making a small jump.

RNG-analysis of 6-puff fights

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 every 6-puff 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.

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%

There is no in-game cue indicating which RNG-loop the game is in, so this information is unknown in a real-time attempt. However, by simulating the smoke pattern for all 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 a specific pattern.

Note: When looking at where the different RNG-pairs in the "carry loops" enter the "non-carry loops" when releasing R, some NCL-pairs are more common "entrance points" than others. However, since R will anyways in real-time be released at different points during the jump to the Singe fight, this feature will be averaged out (at least to some extent). A full investigation taking this into account adds a layer of complexity and has not been done. In the analysis below, it has therefore been assumed that each RNG-pair in a loop has equal chance of being the first in the "puff sequence".

Method 1
The graphs below show the aggregated and per puff probabilities for the method 1 pattern (L, L, L, H, L, L). As comparison, "Expected" refers to an ideal RNG-function that always produces a 50/50 puff probability:

Agg Probability LLLHLL.PNG Per Puff Probability LLLHLL.PNG

A few observations:

  • Right needs to start to be pressed for the jump over the 6th puff before the high/low check has been done. The simulation result for the 6th puff will therefore not be accurate in a real-time attempt. The area for the 6th puff has therefore been colored differently.
  • There is a positive bias for the first puff, where a bit over half of them will be low.
  • Except for puff 4, there is significant negative bias for the remaining puffs.
  • Based on the above two observations, in attempts getting past puff 1, it should be beneficial to introduce R-presses mid-jump to "scramble" the RNG and force it to temporarily leave whichever NCL it was in. It's not evident to simulate the probabilities after "scrambling" the RNG like this, but it should be in the whereabouts of 50% (at least better than by not "scrambling").


Method 2
The graphs below show the aggregated and per puff probabilities for the method 2 pattern (H, L, L, H, L, L). As comparison, "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:

  • The bias for the first puff is inverse from method 1 and a bit over half of the Singe fights will end here
  • 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.
  • Of the patterns getting past puff 3, puff 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 expected value after puff 5 (4.9% iso 3.1%)! This effect is pretty clearly not by game design, but just "how it ended up to be". NCL1-3 only consist of 201 elements. The number of possible start seeds is then greatly reduced when we get to puff 4 (17 possible seeds) and 5 (12 possible seeds), so a few "lucky" outcomes are all that's needed for the probabilities to be greatly off, which appears to be the case here.
  • 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 right 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.
Personal tools