TASVideos

Tool-assisted game movies
When human skills are just not enough

Submission #5481: Migu's DS Mario & Luigi: Partners in Time in 3:21:09.92

Console: Nintendo DS
Game name: Mario & Luigi: Partners in Time
Game version: Europe
ROM filename: Mario & Luigi: Partners in Time (E).nds
Branch:
Emulator: DeSmuME 0.9.9
Movie length: 3:21:09.92
FrameCount: 722096
Re-record count: 41882
Author's real name:
Author's nickname: Migu
Submitter: Migu
Submitted at: 2017-04-25 05:58:41
Intended tier: Moons
Text last edited at: 2017-07-31 08:12:10
Text last edited by: Spikestuff
Download: Download (93401 bytes)
Status: publication underway
Submission instructions
Discuss this submission (also rating / voting)
List all submissions by this submitter
List pages on this site that refer to this submission
View submission text history
Back to the submission list
Author's comments and explanations:
Mario & Luigi: Partners in Time is the second of five games in the Mario & Luigi RPG series. Mario & Luigi work together with their past selves to exterminate the Shroob aliens. The M&L series is known for the ability to do more damage in battle by hitting action commands as well as the ability to dodge or counterattack every attack in the game, which makes it possible, though difficult in real time, to beat the final boss at an arbitrarily low level. Partners in Time is unique among the other games in the series in that there is no mana; instead, all special attacks are consumable items.

Game objectives

  • Emulator used: DeSmuME 0.9.9
  • Advanced Bus-Level Timing OFF and Dynamic Recompiler OFF
  • Aims for fastest time
  • Heavy luck manipulation
  • Takes damage to save time
  • Uses death to save time
  • Genre: RPG

Encode

Version choice

The US version has increased boss health compared to all other versions. In particular, the final boss has 2700 more HP across both forms in US than in other versions. So, I avoided the US version. The title screen in JP is one second faster than EU, but I chose EU so that the encode has English text.

Battle overview

Boss battles are definitely the highlights of this run. This section will explain non-obvious aspects of the battle system. Action commands and attack dodging are perfect, except for when I manipulate a lucky hit. Every normal and special attack has a chance to be a lucky hit, which does double damage. The probability depends on the attacker's STACHE and the enemy's level, but is usually 3% in this run. Lucky hits should not be confused with critical hits. Some enemies are weak to fire or ice, and if they are attacked with the element they are weak to, it will be a critical hit. Bro flowers and mix flowers do fire damage, and ice flowers do ice damage. Critical hits also do double damage, but if an attack is both lucky and critical, it will do triple damage. For this reason as well as others explained later, bro flowers and ice flowers are heavily abused in this run, and they will be collectively referred to as flowers, not to be confused with mix flowers or copy flowers. Also, the projectiles thrown during a flower will be always referred to as fireballs.

Damage calculation

Base damage = attacker level * attacker POW * attack constant / defender DEF. The attack constant depends on the type of attack and whether or not the action command was successful. If base damage < 1, it is rounded up to 1. Next, badge effects are taken into account. Then, lucky/critical effects are taken into account. Finally, it is rounded up to the nearest integer.

RNG

RNG is handled by a 2-byte address at 0x02060E06 and advances according to this formula: nextRNG(seed) = floor(seed*20.5) & 0x7fff + (seed%2)*0x8000. Additionally, when a battle starts, RNG is set to 0. Once the battle is fully loaded a new RNG seed is chosen. This seed is either based on the system clock or in-game time, since the only way to manipulate it is by waiting a multiple of 60 frames before the battle. Therefore, there is no RNG manipulation outside of battle besides waiting before a battle to get a good seed.

In battle, RNG advances:

  • when an enemy decides what attack to do or who to target
  • when a bro is hit by an enemy attack and survives
  • during a bro item demo, when a random outcome is needed, e.g. whether to throw 3 or 4 fireballs in a row during a flower demo
  • when an enemy takes damage from a non-flower attack, to determine if it is a lucky hit
  • during a bro attack, when a random outcome is need, e.g. who the next bro will be in a copy flower

Here is the lua script I used to aid with manipulating RNG, in case you're interested: https://pastebin.com/i38mgFjw

Flowers

Bro flowers are first unlocked in the castle shop after returning from Bowser's Castle and first appear in Toadwood Forest. Ice flowers are first unlocked in the castle shop after beating Swiggler and first appear in Yoob's Belly. Flowers are meant to do moderate damage to all enemies, but they can be exploited, along with certain badges, to do extremely high damage to a single enemy.

When using a flower, after selecting the target, RNG advances 6 times. Each of these RNG values determines whether the attack will be a lucky hit for a corresponding enemy. In battle, each enemy has an ID from 0 to 5. The first-read value determines whether the attack will be a lucky hit on the enemy 0, the second-read value determines whether the attack will be a lucky hit on the enemy 1, etc. Note that RNG advances 6 times regardless of the number of enemies, and there can't be more than 6 targets in a battle.

Once the attack begins, the bro who started the attack starts with the big fireball and the other has the small fireball. The bro with the big fireball throws big fireballs and the bro with the small fireballs. Big fireballs hit an enemy and do damage. Small fireballs don't hit an enemy and instead decrease the length of the attack by 20 frames when thrown. By default, the attack ends after about 600 frames or when the boss (or all of the enemies) dies. The bro with the big fireball begins by automatically throwing a fireball. Then, each bro must wait 7 frames before throwing a fireball. It takes 9 frames to pass on the fireball, or 10 if adult Luigi is passing it on. The adults can throw up to 74 fireballs and the babies can throw 75. If the target is in the air, each bro must wait 8 frames between fireballs, so only 65 fireballs can be thrown.

The damage dealt is calculated for each fireball individually, then added together. Flowers have the lowest attack constant in the game, 0.109. This low attack constant means the base damage per fireball is always less than 1 in this run. No matter how high the enemy DEF is or how low the attacker level or POW is, each fireball will do 1 damage before badge effects and lucky/critical multipliers are taken into account.

Target manipulation

Every time a fireball is thrown, RNG advances 3 times. One of these values determines which enemy the fireball will hit. Note that this happens with big and small fireballs, and it happens even if there is only one enemy. The ID of the enemy hit is RNG%(number of enemies). However, if there are two enemies, the ID of the enemy hit is floor[(RNG%8)/4]. RNG advances every frame during a flower, so it is simple to wait frames before throwing a fireball in order to hit a certain enemy. There are a few catches, the most important one being that the more enemies there are on screen, the more frames I have to wait between fireballs. This means I throw fewer fireballs, doing less damage.

Lucky hit manipulation

The game decides whether a flower will be a lucky hit when the attack starts. It is easy to manipulate RNG during a flower since RNG advances every frame. For example, simply waiting one extra frame before throwing the final fireball will allow the RNG to advance one more time during the attack. It is much more difficult to make the first flower in a battle a lucky hit since the only ways to manipulate the RNG are waiting to get a different seed, getting hit by an attack, and watching a demo. This is why, in a few battles, the first flower is not a lucky hit but the others are. It takes 60 frames to wait for the next seed, so this is avoided as much as possible. Getting hit is usually pretty fast, but only advances RNG once and usually I can't take a hit since it would be deadly. Demo RNG advancement, however, is faster and can be done as many times as needed. In the bro item menu, I put the cursor on a flower, then on the same frame that RNG advances, I cancel the demo (either by exiting the bro item menu or moving the cursor) and then restart the demo.

Battle by battle comments

Baby Bowser

This fight ends after 4 hits, no matter how much damage is done.

Junior Shrooboid

Lucky hits are disabled in this battle, so the only way to speed up this fight is by hitting every counterattack on the first possible frame.

Shrooblets

The HP upgrade I gave Mario after Junior Shrooboid allowed him to kill the shrooblets in 2 jumps. Lucky hits are again disabled here. Luigi's dodging animation is slow so he gets hit.

3 Shroobs

The shroobs' animation for attacking Luigi is faster, so I take damage in order to manipulate that.

2 Shroobs

Lucky hits are still disabled. It's faster for both babies to jump on the same enemy because it decreases the number of necessary green shell hits by 1.

Bowser's castle tutorial

This is the first battle in which I manipulate a lucky hit. I wait before the battle to get a good seed. This gives Mario a lucky jump on the boo, allowing me to kill it before it attacked for a second time. If you kill the goomba too early, Kamek will spawn another goomba. So, I delay killing the goomba to save time.

Hammer Bros.

Each bro has 90 HP, for a total of 180 HP. 2 flowers will do 150 total damage, so a lucky hit is needed for a quick battle. I also need to throw as few fireballs as possible, since every fireball takes 7 frames. Therefore I make the most of the lucky hit by attacking only the lower bro during the first flower, and then getting a lucky hit on the top hammer bro on the second flower.

Swiggler

Swiggler has 200 HP, so in order to kill him with 2 flowers, I need to get 2 lucky hits, each doing 100 damage with 50 fireballs. Even with the 2 Dr. Shroobs I have to avoid hitting, this is very managable. The default RNG seed was very good - I just needed to advance RNG once by getting hit.

Kamek

Kamek has 450 HP, so 4 flowers are necessary to kill him. However, only 3 need to be a lucky hit, so the first attack is not a lucky hit. First, I use an ice flower that I bought at the castle shop to lower Kamek's speed from 29 to 20.3. Since Mario and Luigi both have 21 speed, Kamek doesn't get another chance to attack.

RC Shroober #1

This battle is fought with the babies since it takes time to go to the pipe block. RC Shroobers are weak to ice so I use the other ice flower I bought in the castle shop.

RC Shroober #2

This is similar to the first RC Shroober, except I got a good seed and was able to manipulate a lucky hit by taking damage. This lucky hit only saves ~100 frames.

Sunnycide

Sunnycide has 480 HP, so, like Kamek, 4 flowers are necessary to kill him. However, all 4 need to be a lucky hit, and the eggs make it so flowers do less damage to Sunnycide. Therefore, I manipulate Sunnycide to throw as many eggs as possible. I waited about 7 seconds before the battle for an RNG seed that made Sunnycide throw 4 eggs and had a quick lucky hit. During the second flower I manipulated Sunnycide to throw 1 egg, which is very rare. When there is 1 egg left, he almost always calls down more eggs, which is slow.

Shrooboid Brat

This boss has 900 HP, so it is theoretically possible to kill him with 6 flowers, each doing 150 damage. It is rare, but possible for the adults to throw 75 fireballs. However, doing so while manipulating RNG for the next flower is essentially impossible. Therefore I settle for 7 flowers. However, this means gets an extra attack, since he has more speed than both adults. When he has under 450 HP, his attacks are very time-consuming. So, I again start the battle with an ice flower to decrease his speed from 34 to 23.8. Mario has 24 speed, so the turn order is now Mario, Brat, Luigi. Since the battle ends with Mario, this skips one long attack. I can skip the first long attack by having both adults die at once. When all the bros leave the screen the attack ends. Baby Luigi replenishes Brat's speed debuff, and Baby Mario has 24 speed as well, so Brat doesn't do any long attacks.

Petey Piranha

In the monty mole shop, I bought Dire-POW badges for Mario and Luigi, which multiply damage dealt by 2.5 when in dire status (25% or less HP). Then, I get an encounter with 2 Elite Boom Guys who kill Mario and Luigi, leaving them with 1 HP after running from the battle. This is the fastest way to activate the badge effect. Petey Piranha is weak to fire, so I can get critical hits. The base damage per fireball is 1. The Dire-POW badge multiplies this by 2.5. The lucky + critical combination multiplies this by 3. Finally, this value of 7.5 is rounded up to 8, so each fireball does 8 damage. Since Petey Piranha is an aerial enemy, I can throw 65 fireballs per flower for a total of 520 damage per flower. This is enough to deplete his 1000 HP in 2 flowers. To manipulate the first lucky hit, I had to advance RNG by watching the demo 12 times. I couldn't take damage to advance RNG because Mario and Luigi would die, since they have 1 HP.

Mrs. Thwomp

I again use the effects of the Dire-POW badges. Mrs. Thwomp doesn't have any weaknesses, so I can't get critical hits, but fortunately her health is lower than Petey Piranha's. Her first form has 230 HP, so 1 flower is enough, and her second form has 400, so I need 2 flowers. The most damage I could do with 1 flower in this battle is 74 * 2.5 * 2 = 370. Instead of only hitting the real Mrs. Thwomp, I kill all of the fakes in order to skip their attacks.

Bowser & Baby Bowser

Bowser has 1000 HP and is weak to ice, while Baby Bowser has 700 HP and has no weakness, so both can be defeated with 2 lucky ice flowers. I was able to manipulate these lucky hits as well as quick enemy attacks without wasting much time.

Commander Shroob

In the Toad Town shop, I bought Risk badges for Mario and Luigi, which multiply damage dealt by 3 when there are no mushrooms of any type in the inventory. Not only does this do more damage than with the Dire-POW badge (9 instead of 8 per fireball), but it also means I don't have to set up dire status by getting in a time-consuming encounter. Because of the presence of the Shroob-omb, who always takes 1 damage, flowers do only 1 damage to the support shroobs. So, red shells are the best choice. Besides the first target, red shell targets are not manipulable; after the first target dies, it will target the remaining ground enemies in increasing order of ID. If the middle support shroob is left standing, the direction the shroob-omb rolls in is random, so I made sure it rolled to the right. Commander Shroob has 900 HP and is weak to ice, so he can be killed with 2 ice flowers even if the first is not a lucky hit. During the first flower I manipulate him to do his quickest attack and a lucky hit on the second flower.

Elder Shrooboid

Both phase of Elder Shrooboid are weak to ice. The first has 1000 HP and the second has 900, so each phase is almost identical to Commander Shroob: one non-lucky hit and one lucky hit. I also manipulated an attack that could be countered, decreasing the number of necessary fireballs.

Princess Shroob

Before the battle, I equip the Para Slacks on the Mario that I got in Toad Town, which allows Mario to go before Princess Shroob, skipping the long attack she does when she's in her chair. Princess Shroob needs to be hit 15 times to get her out of her chair and be able to deal damage to her. Fireballs are not counted individually - one flower counts as an individual hit. However, separate copy flower hits do count individually. I hit her once more than necessary to manipulate a very quick attack. Then I use a red pepper to increase everyone's POW by 1.4 and defeat her with one red shell. Although red shells are usually slightly slower than copy flowers, they do much more damage per hit. The speed of red shells depends on the distance from the bros to the target. Flowers still do more damage per second than flowers, but if I used flowers it would take more turns and Princess Shroob would get more attacks, losing time.

Elder Princess Shroob

The first phase is similar to Princess Shroob, except I manipulate a quick attack using demo RNG advancement. I manipulate RNG very carefully throughout the battle in order to get a lucky hit on the crown in the second phase. Mario takes damage twice, advancing RNG, and Luigi watches the demo more before starting the bro flower. Considering the time it took to manipulate the lucky hit, using a copy flower instead of a bro flower on the crown would only be a couple seconds slower. The final attack is a copy flower instead of a red shell since red shells can't reach aerial targets.

Shrowser

This battle is straightforward. Shrowser's 3-fireballs-from-the-sky attack is pretty long but it took too much time to manipulate him to do it less than twice.

Notable tricks and skips

M&L block tutorial skip

The trigger for the M&L block tutorial is only on the ground and narrow enough to jump over. It is still necessary to hit all of the blocks to advance to the next area, but Stuffwell's text and the camera movement can be skipped.

Fire skips

The hitboxes of the fires don't cover their entire platforms, so there is a pixel-wide area you can stand without getting hit by the fire. This can be abused to skip putting out two of the fires in Yoshi's Island.

Money glitch

When selling all of an item, if you select the next item on the first frame possible, the sell price of the first item is stored on the second item. I use this to sell my entire inventory for 160 coins per item and get over 3000 coins.

Star Shrine dark room skip

Using baby spin in a particular place, it is possible to reach the lower-left star block without going through the dark room.

Star block cutscene overlap

By hitting the last blue ! block and the purple ! block at the same time, both cutscenes play at once. The red-and-green pattern cutscene ends which gives control of the babies before the star block cutscene ends. This skips waiting for the cutscene to complete.

Star Shrine cake jumps

It is possible to speed up the room after getting the 4th star shard by doing very precise jumps into and out of the holes in the wall.

Basement skip

This is the only big skip in the game. Similar to the dark room skip, by using baby spin on the very edge of the blue pipe, it is possible to reach the ledges in Shroob castle without going to the 2nd floor and the basement. This skips about half of Shroob Castle.

Other notable techniques

Stair jumping

Mario's speed is decreased when he is on a slope and facing up the slope. By jumping from flat ground up the slope, this is avoided. If the slope is too long to ascend in a single jump, I can jump while facing perpendicular to the slope for one frame to maintain normal walking speed up slopes.

Toad boost

When entering an NPC's hitbox from above, Mario is boosted out of its hitbox. I use this to save frames in Peach's Castle.

Wall boost

Normal walking speed is 2 units per frame, or 1.5 units in each direction when walking diagonally. If Mario is touching a wall and moves diagonally against the wall, his speed will be 1.6 along the wall, so it's better to walk along the wall for a speed of 2. However, if Mario less than 1.5 units from a wall and walks diagonally against the wall, his distance from the wall is added to his speed along the wall on the next frame. For example, if he is 1 units from a wall, his speed the next frame will be 2.6 units along the wall.

Ledge boost

Mario can get a boost when walking off a ledge. The size of the boost depends on the angle of movement relative to the angle of the ledge and the distance to the ledge the frame before walking off it. These boosts tend to be larger than wall boosts but smaller than toad boosts.

Quick drill

The length of the baby drill entering-the-ground animation depends on the direction faced before pressing Y. It's fastest to face up-left before pressing Y. It's slowest to be facing up because the animation will be 18 frames longer.

Rolling displacement

When entering bros. ball, Mario is sent 8 units behind him. Therefore, I face backwards before using bros. ball so that behind Mario becomes the direction I want to travel in.

Known improvements

There are a various places I lost time to movement: using the first few blue switches, getting to the Yoshi's Island time hole, in the sewers after Elder Shrooboid, and more. I also should have unequipped the Salvage Badge before Kamek to avoid salvaging a bro flower. It would also be very feasible to get better RNG throughout the run, especially on Sunnycide, Petey Piranha, and Elder Princess Shroob.

Theoretical improvements

Gate skip

The time hole to Shroob Castle is accessible as early as beating Sunnycide, but in order to make it past the gate you need 5 star shards. This is the only point when the game checks how many star shards you have. If there was a way to reach the loading zone behind the gate without 5 star shards, Thwomp Volcano through Star Shrine could be skipped, saving about 50 minutes. The simplest way to do this would be by getting out of bounds, but there is no known way to get out of bounds in that room.

Shroob Castle skip

In the room to the left of the first area in Shroob Castle, the rightmost pipe leads to the third floor, almost at the final boss. However, it is inaccessible until you enter the corresponding pipe on the third floor. If it were possible to enter the pipe right after getting past the gate, almost all of Shroob Castle could be skipped. Additionally, if this and gate skip were possible without baby spin or baby cakes, Gritzy Desert and Gritzy Caves could be entirely skipped, bringing the TAS time down to about 2 hours.

Toad Town early

There is a time hole in Peach's Castle sewers that leads to Toad Town, which is accessible after learning bros. ball. However, there is a gate that blocks progress and can only be opened from the other side. If there was a way past the gate, all of Thwomp Volcano and most of Toad Town could be skipped, saving about 30 minutes. This would only be useful without gate skip.

Gritzy Desert skip

In the westernmost room in Gritzy Desert, there is a pipe that leads to Gritzy Caves, but is only accessible once you enter the corresponding pipe in Gritzy Caves or learn baby spin. If there was a way to reach the pipe from the Gritzy Desert side, for example by jumping higher, most of Gritzy Desert and all of the Koopaseum could be skipped, saving about 10 minutes.

Other minor theoretical sequence breaks

Toadwood fire skip, Vim Factory early, Yoshi rescue skip, Thwomp Volcano skip

RNG glitch

This is an extremely theoretical glitch that would lock the RNG value at 0. This would guarantee that every hit is a lucky hit. RNG is set to 0 at the start of every battle, so all that's needed is a way to prevent RNG from changing after that.

Routing improvements

It may be possible to skip the one or more encounters in Gritzy Caves and Thwomp Volcano that are used to put the adults in dire status. This would require taking damage from Petey Piranha, Mrs. Thwomp, or Bowser that would put the bros. at low health but not kill them. This is difficult since at a low level, the bros. defense is low and they die from most attacks.

It also may be faster to skip the adults' level ups after Commander Shroob and/or Elder Shrooboid by having them die and having the babies finish the battle. This would require buying Risk badges for the babies and would probably lose time in the final two battles since the adults' POW would be lower.

Special thanks to...

Anwonu, for putting so much time into this game. He found many important tricks and strategies, including basement skip and money glitch. He did the 4:07 segmented run on SDA and holds the RTA record at 4:14. If it were not for him, I would not have been interested in TASing this game.

Jdaster64, for finding a lot of useful info like the RNG formula and attack constants.

栗きんとん社長, for TASing this game in 2010, with a time of 3:51. His run was a useful reference, especially for the star shrine cake jump trick, although he did not manipulate RNG or use money glitch.

MUGG, for working on this game quite a bit, and for working on the Superstar Saga TAS, which WILL be finished in 2017 (you can do it!)

GhostKing, for running this game, finding the star block cutscene overlap, and helping with the live commentary.

Everyone who supported me as I worked on this project. It was a very long process, so I likely would have given up if it weren't for the encouraging comments you gave me whenever I posted an update.

Suggested screenshot

Frame 391748, or any bro flower attack.


Mothrayas: Judging.

Mothrayas: Well done TAS. The bossfights and overall gameplay look well planned and executed. Accepting for Moons.

Spikestuff: Publishing and will be spending way to long for the YouTube half due to the importance of screens...
Update on the publication. I dropped the device I had this on and lost most of the progress I had for the YouTube encode. I have an older version backed on the cloud and using that version to catch up all that lost time.


Similar submissions (by title and categories where applicable):