Master of Darkness is a platformer released in 1992 for the Sega Master System and Game Gear. Essentially this is Sega’s take on Castlevania, but with some cool unique bits of polish, such as bigger story and cutscenes, varied weapons as well as subweapons and being able to jump off stairs.
There is a published TAS already by Zoboner in 17:52.31. This TAS uses a new glitch to finish in 11:19.691, saving 23526 frames (6min 33 seconds).
Given the drastically different nature of the run with this glitch, I’ve submitted this TAS under a separate category/branch “potion glitch”.
Along with the submission text below, I’ve also made a video explaining the game, and all the tech used in RTA and TAS in detail here: https://youtu.be/IQwmbz4vZBA

Comparison to Previous TAS

This TAS uses the new potion glitch that was posted about a month ago by Quarbit: https://www.speedrun.com/master_of_darkness/forums/9uep1 This drastically changes the run by partially skipping 11/13 of the levels and as such I’d suggest having this TAS as a separate category to the current published no-potion glitch TAS.
I’ve given a summary of time saved over the published run below. Most time was due to the potion glitch but I did also save time on 2-1 and 2-2 where the potion glitch isn’t used due to lag and movement optimisation.
LevelTime Saved (fr)Time Saved (sec)Potion Glitch Used?
1-199116.52Yes
1-2119119.85Yes
1-3199933.32Yes
2-1510.85No
2-21041.73No
2-3235639.27Yes
3-198116.35Yes
3-2153325.55Yes
3-3389264.87Yes
4-1173428.9Yes
4-21071.78Yes
4-3531788.17Yes
5-1327154.52Yes

Potion Glitch

To do the potion glitch, you need to take a hit that will kill you but get hit into a health recovery potion. This causes you to die, but with non-zero health. This tricks the game into ending the level and moving onto the next one rather than restarting the level.
I was able to do this glitch on every level apart from 2-1 and 2-2. 2.2 doesn’t have a health potion and 2.1 only has a potion in the wall that you need to duck to access. It seems impossible to die while ducking, so I couldn’t get this potion after a death.
In general taking damage on the way to the potion is much faster than taking a bunch of damage at the potion. This is because you can continue to progress through the level while waiting for your invincibility frames to tick down. Usually if an enemy is moving to the right, it is worth getting multiple hits from them until they are at the rightmost point of their path. Consider it “free” movement since you would have been waiting for the i-frames at the end of the level anyway. Given you have to wait 122 i-frames between each hit, the goal is to reduce that waiting near the potion as much as possible.
The only cases where you might not farm the enemy until it hits it rightmost point are: - If the enemy deals less than the biggest possible amount of damage (see below) - If it’s a laggy area - If the level is long enough that you don’t have to wait around at the potion taking damage

Modular arithmetic (optimising the potion glitch)

Just some notation stuff for the submission text. To trigger the potion glitch, you need to die. The quickest way to do this is to take damage from enemies that deal the most damage. E.g. in round 1, the most damage you can usually take is 3.
If I had 11 health for example, I could take 4 hits x 3 damage to deal 12 damage and die. Alternatively, I could have taken one of those 4 hits from a 2 damage enemy, totalling 11 damage which would still kill me. Since most of the enemies near the potions deal 3 damage, if I need to take damage from an enemy that deals 1 or 2 damage, I am aiming to only take it down to a multiple of 3. If I didn’t plan this in advance, I would end up needing extra hit(s) compared to what I would get from optimally hitting all 3 damage enemies.
To help talk about these damage routes in the IL comments, I’ll refer to it using modular arithmetic (e.g. how much more than a multiple of 3 my damage is at any given time). Levels will start me at 32 health which is equal to 2 (mod 3). This gives 11 enemy hits at a minimum if the toughest available enemy deals 3 damage. Since 32 is 2 more than a multiple of 3 and my goal will usually be to take one of my 11 required hits from a 2 damage enemy, causing me to reach 0 (mod 3).
Note: I could take all the 11 of the hits from 3 damage enemies in theory, but sometimes there aren’t enough available spots to quickly get hit by all 3 damage enemies.

Useful RAM Addresses

I made a custom script that tracks position and tracks lag frames (adding them to TAStudio). It can be found here: https://tasvideos.org/UserFiles/Info/638443249272031015
Apart from the position and timer stuff, here are a few more useful values
DescriptionAddress
Weapon0x1FB7
Boss HP0x0B3A
Round0x1FC0
Level0x1FC1
HP0x0A3A
HP recovery timer0x0A3C

Weapons

Main weapons
WeaponDamage
00 - Knife1
01 – Stick3
02 – Long Saber2
03 – Axe4
Sub weapons
WeaponDamage
00 – Small Bullet1
01 – Boomerang2
02 – Big Bullet (Projectile)4
03 – Bomb3
Based on the table above, I get the axe as soon as possible (in 1-3) and also get the bombs. The projectile is the best sub-weapon and would have saved a bunch of time if I had it in 4-2, since it can fire through walls. But there is no good place to get a projectile sub-weapon before 4-2 since I skip the areas that have it using the potion glitch.

Movement optimisation

Walking = good, jumping = bad.
When you jump, you lose 2 pixels (also 2 frames) of movement time. When you land, you also lose this 2 pixels, but you can avoid that by attacking just before hitting the ground. If you need to attack, you should do so in the air to avoid the slowdown from attacking on the ground. Attacking and ducking also makes your hurtbox bigger, so be careful of enemies with this. It actually came in useful to have the bigger hurtbox, to take damage for the potion glitch slightly quicker.
Most stuff above goes out the window in laggy areas. You want to kill enemies to reduce lag, but when this isn’t possible you need to reduce it where possible. In general, jumping is less laggy than walking, since the game doesn’t have to animate the walk cycle, so even with the 2 frame loss to start and end a jump, it’s sometimes still faster to jump if it’s a laggy area. At the end of a jump, you would usually attack to avoid the slowdown at the end, but this isn’t better in laggy areas, since the attack animation usually causes more lag.
You can damage boost by facing away from the direction you want to go. This is usually frame perfect to do optimally, but you can get it easier by jumping and attacking. Attacking locks in your facing direction for the duration of the attack, so you can face left and move right to get easy damage boosts, with the tradeoff that usually attacking causes lag and should be avoided.

1-1

The enemy that I first take damage on deals 3 damage, so I stay by it until it hits its rightmost point. This also helps with lag since the area with this enemy is less laggy than the area near the potion. Once I pass this enemy I kill it on the way out to reduce lag later on. This doesn’t lose any time since I’m already facing left when I start the jump.

1-2

Upper enemy at the start would have been good, but it only does 2 damage. Jumping down onto the boat rather than walking off saves time since the boat starts moving quicker. I also reduce a significant amount of lag by waiting to walk until the boat has moved a bit. This is because the enemies to the left are still on screen until the boat has moved a bit. When riding the boat, I stop to get the bombs which doesn’t lose any time. The other good spot to get them would be when I’m about to fall down in 1-3, but this boat bit is an autoscroller so I might as well get them here.
The health management in this level involves getting down to 0 (mod 3) and you start out at 2 (mod 3). This means I can take a hit from the wolf which deals 2 damage without needing an extra hit due to it. I also take the time to get hit by the bat on the boat, again because it’s an autoscroller. The bats deal 1 damage, putting me at 1 (mod 3). Since I’m at 1 (mod 3), that means that taking 2 wolf hits becomes just as fast as taking 2 hits from the 3 damage enemies. This is good, since the 2nd wolf hit is faster (given the wolf is running right and I’m going that way anyway).
Regardless of my fancy routing, I still need to spend a bunch of time waiting at the potion taking damage.

1-3

I grab the axe at the start of the level. This costs the time to jump, but saves time shortly after when I kill the green flying enemy. Killing this enemy reduces lag and also allows me to take damage on the 3 damage wolf rather than this 2 damage flying enemy.
At the end of the first screen, I damage boost off the edge. I do this jump as early as possible since the bottleneck on the bottom screen is hitting the ground to jump. I take damage on an enemy at the start of the second screen and then kill it with a bomb. This is because axe-ing it was slower, and leaving the enemy alive allows it to fire a projectile which causes a ton of lag.
I lose a frame at the end of the fall down to the bottom of the screen because I can’t swipe the axe for a fast landing. This is because I would hit open the candle which has another axe in it, then the character would pick up the axe, losing half a second. Despite this second axe literally being in the way, it was still faster to pick up the first axe, as mentioned above.
I make my way to the potion, reducing lag where possible and this is the first level where I don’t need to wait around a bunch to take extra damage.

2-1

This is one of the only levels that can’t be skipped using the potion glitch. There is a potion in this level, but it’s inside a wall (wall chicken?). Unfortunately you need to be ducking to grab this and dying immediately takes you out of the ducking animation. For this reason, I can’t skip 2-1, but this is probably the biggest potential timesave in the run if it could be made to work.
At the start of the level, bombs help to take out the ghosts a bit quicker.

2-2

I can’t skip this level since it doesn’t have a potion. Not much to say here apart from lag and movement optimisation.

2-3

I wasn’t sure if the potion glitch was possible, but it was in the end with some precise movement. I actually wait on a cycle near the potion for the enemy to get close enough to trigger the glitch.

3-1

From this point, enemies are more frequent leading up to the potion, making it a bit speedier to get through.

3-2

This level introduces spikes which deal 4 damage instead of the previous max of 3. This speeds stuff up a bit more.

3-3

The potion literally falls on top of spikes here. It’s almost like they wanted people to find the potion glitch.

4-1

I slow down here to grab the boomerang. Ideally I’d have the projectile for the next level to speed up the two rooms where you have to kill an enemy to progress, but the boomerang is the best one I can grab realistically, since I skip the chance to grab the projectile using the potion glitch.

4-2

This level has two rooms where you have to kill enemies to progress. Killing them normally is quite slow, since you have to move over to the right, but I manage to skip one using the boomerang sub-weapon mentioned above. Unfortunately I can’t kill the second one as the boomerang doesn’t go through walls (the projectile does but I couldn’t get it). This makes that individual room slower than the current TAS, but it’s worth it for the time saved skipping 4-1 with the potion glitch instead of getting the projectile there.
This level ended up being pretty close to time compared to the old TAS, even though I skipped the end with the potion glitch. This is because I didn’t have the projectile and the potion is near the end.

4-3

Spikes help optimise damage a lot here

5-1

I wasn’t sure what would happen doing the potion glitch on this level, given you’re supposed to fight the final boss at the end. Turns out it works very nicely and just puts you into the credits.
The level itself is a huge maze, but once you know the way it’s pretty simple. I debated over the best way to end inputs early, but found that hitting the skeleton would be the best. I would like to use the bullet projectile rather than the skeleton since then I could sit there waiting for it after inputs ended, but it only dealt 1 damage and the modular arithmetic didn’t work out right to make that feasible. If the potions stuck around after spawning, I could have ended inputs much earlier, but the potions despawn super quickly, making this unrealistic.

Thanks

Quarbit – For having a great optimised RTA WR and posting / finding the potion glitch
Zoboner – For pioneering the movement tech in the previous TAS, which was also crucial in optimising this one.
StarFighters76 – For making excellent maps showing where all the items are in the game. These were very helpful in finding all the potion and weapon locations: https://gamefaqs.gamespot.com/sms/588099-master-of-darkness/faqs

Darkman425: Claiming for judging.
Darkman425: Shortened the branch name to just "potion glitch", taking out the "beat the game" part.
Hey, I know this game a bit due to making an RTA run of the Game Gear version months ago for an event. That meant that I've been looking forward to seeing a TAS of the potion glitch since its discovery. This is a fantastic TAS with a lot of careful planning for damage boosting and weapon management. The improvements over the older, deathless publication to the levels where the potion glitch isn't used also makes me look forward to an improvement to that one in the future. Nice work!
Accepting to Standard as a new branch due to how the glitch drastically changes the gameplay.

despoa: Processing...


TASVideoAgent
They/Them
Moderator
Joined: 8/3/2004
Posts: 15628
Location: 127.0.0.1
Challenger
He/Him
Skilled player (1702)
Joined: 2/23/2016
Posts: 1065
Wow this glitch is insane and you even skipped the final boss. Great job and yes vote!
My homepage --Currently not much motived for TASing as before...-- But I'm still working.
Post subject: Movie published
TASVideoAgent
They/Them
Moderator
Joined: 8/3/2004
Posts: 15628
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. ---- [5838] SMS Master of Darkness "potion glitch" by The8bitbeast in 11:19.69
Skilled player (1005)
Joined: 10/13/2014
Posts: 409
Location: nowhereatthemiddleofnoone
This is awesome, I often say that video games and potions are synonymous with glitch... Great work, really interesting to watch on emulator.
GAW sms... Totally destroyed