Submission #4489: CoolKirby & YoungJ1997lol's GBA Madagascar in 28:12.30

(Link to video)
Game Boy Advance
VBA-rr v24 svn480
Madagascar (U).gba
Submitted by CoolKirby on 11/21/2014 12:05:09 AM
Submission Comments
This is our collaborative TAS of GBA Madagascar. This game follows the plot of the movie quite closely, having you control the animals as they chase Marty to Grand Central Station and accidentally wind up in Madagascar.
This is our suggested movie description, though anyone is free to improve upon it.

About this run

  • Emulator used: VBA24-M svn480
  • Aims for fastest time
  • Takes damage to save time
  • Manipulates luck
  • Abuses programming errors in the game
  • Genre: Platform
This game is pretty simple: jumps are always the same height no matter how long you press A, and speed quickly increases to its maximum and stays there, even on slopes. In general, it is a good game for a novice TASer.
And once you become more experienced, you'll have fun finding little optimizations and tricks to save time, like landing sooner by jumping off cliffs to increase your downward speed and maximizing your X-Position when jumping over ledges.


  • Landing from a jump drops your speed temporarily and it takes a few frames to climb back up to the maximum. Because of this, it is important to jump only when the terrain requires it. Marty loses the most speed (when running), and Alex loses the least.
    • Flower/branch/tiki trampolines don't have this effect, so these are landed on when possible.
  • Jumps where the character's head hits the ceiling are faster when you need the character to land earlier, at no cost to horizontal speed.
  • Alex walks at a speed of 512, Marty walks at 539 and runs at 768 (3 pixels/frame), Gloria walks at 409, and Melman and the Penguins walk at 435.
    • Running with Marty is the fastest way to move in the game, so it is used whenever possible.
    • Swimming with Gloria and crawling with Marty are the slowest methods of movement at 256 speed (3x slower than Marty's run). Jumping across the water as Gloria is always faster than swimming through it.
  • Damage boosting is slower for Alex, Marty, and the Penguins (it decreases their speed), but faster for Gloria and Melman. When Gloria and Melman damage boost, their speed goes up to 512 for the length of the boost.

Memory addresses

The memory addresses for speed and position change every level, so unfortunately a table of addresses would be too long to include here.
However, one address that works in every level is Global Screen Y-Position, which is a 2-byte signed address at 02003FF6.

Tricks and glitches

Minding the Speed

  • Health and alert level (Operation and penguin stages) reset for each new room. This allows more damage boosts to be done.
  • The game tracks 256 subpixels for every pixel. Watching these is mainly necessary for stages where you must move both left and right, such as into caves.
  • The horizontal speed of Melman's sneeze jump can be adjusted by how long Left or Right is held down after the jump is started. It can range from 256 to 410.
  • When Marty is running and landing from a jump, he will have to wait one more frame to be able to jump again at his running speed. He can, however, make a jump at his walking speed (563 sp/f) at the same time as other characters, which can save a frame if he doesn't need to jump very far.
  • There are two types of lag that we know of: screen scroll lag and processing lag. They only happen in certain sections of certain areas, but can be a challenge to reduce.
    • Screen scroll lag happens when the screen is scrolling (usually to the right) and can't keep up with all of the onscreen graphics/animations. This can be reduced or eliminated in midair by facing left, or on the ground by releasing the run button or the D-Pad for one or more frames.
    • Processing lag happens when too many actions are happening at once and the game can't keep up, so it takes an extra frame to process everything. You can reduce or eliminate this by going an alternate route or jumping at slightly different times to ease the load on the game. You can also release the D-Pad in midair if already moving at the speed you want, so the game doesn't have to try and add that speed on top of all its other tasks.

Character switching tricks

  • If you switch your character in midair, the new character will keep the old character's speed. This is used often to allow moves like double jumps to be performed at Marty's fast speed.
  • You can start your victory dance earlier in some levels by switching characters in midair above the goal.

Extra Jump

  • You can cancel "trampoline" boosts from branches and flowers by rapidly switching your character.
    • This will allow you to double or sneeze jump a second time without landing and gain additional height.

Damage Knockback Cancel

  • You can cancel damage knockback without wasting time by switching characters 2 frames from hitting an enemy.
    • If Gloria is the one switched to, the enemy might get crushed, which sometimes can reduce lag.

Zombie Mode

  • If you switch characters while losing your last health point, you can play with zero health! You can't switch characters though, as the game assumes you're dead, and getting hit again will kill you since you can't repeat the trick without being able to switch characters. However, you can regain your last health point by picking up a health flower or bouquet, so this trick can be used if you're in a pinch and really need to take damage one more time.

Marty crawling tricks

  • When landing in front of a crawling tunnel, crawling with Marty can be started earlier by ducking in the opposite direction for one frame before ducking facing the tunnel.
  • Once Marty is out of the crawling tunnel, you can jump to skip his "getting up" animation and move forward faster. This is most effective in areas with low ceilings.
    • If you are able to use other characters, you can switch to another character and back to Marty to both skip the animation and start running as Marty (usually faster).

Crawl Clip

  • If Marty is inside a crawling tunnel and takes damage, he can get knocked further inside and stand up. This allows him to jump out of bounds.
    • If other characters are present, you can change to them mid-jump and go OoB with them too.

Attack Storage

  • You can store a copy of a character's B button attack by switching to another animal in the middle of the attack. This second attack is stored until you switch to that character again, when the full impact of the attack will be unleashed in one frame!

Early Double Jump

  • You can double jump with Alex earlier than intended in a narrow space by hitting the ceiling. This puts him in the double jump state for at least one frame, allowing him to jump again.

Ninja Foosa

  • You can manipulate foosa spawn positions by scrolling the screen differently, causing them to walk off of cliffs. On the way down, they can stop and attack you or die from an attack before hitting the ground.

Level by level comments

Alex's Double Jump

  • The penguins have large hitboxes. You don't even need to land on the branch or wait for the B button graphic to appear to talk to them.

Marty's Run

  • This is Marty's run, the fastest method of movement. We jump only when needed to, as landing from extraneous jumps costs time.

Melman's Hideout Dig

  • Taking damage from the bees is always faster than ducking and waiting for them to pass.
  • In case you can't see it, there is barbed wire floating in the sky for most of the level, so that's why Melman gets hurt when he jumps sometimes.
    • This is good for us though, since Melman moves faster during damage knockback.
  • If Melman had one more health point, he could take damage above the first rat to save time. But since he doesn't, we jump precisely to manipulate the rat so Melman can jump between it and the wire without taking damage.

Gloria's Swim

  • Jumping out of the water on the second frame possible is always faster than jumping out on the first frame possible. When jumping out on the first frame, Gloria's speed drops to zero and slowly increases from there, unlike jumping out on the second frame possible, which will only drop the speed to swimming speed before increasing again.

Daily Grind

  • We jump off the slope with Alex at the earliest point that we can clear the wall.
  • Since Melman moves faster than Gloria, he is used for the whole second room except for when one of them touches the water. Melman dies if he touches the water, but Gloria only needs to swap in for a few frames at a time before switching back to Melman.
  • We switch to Gloria during the first swimming section to cancel the damage knockback from the bird.
  • Three health flowers are picked up in the second room to use on more damage boosts.
  • We take damage from the wire near the beginning of the third room because it's faster than doing so from the rat.
  • In one laggy section of the third room, we let go of B for short periods of time to reduce the screen scroll lag.

Marty's Crawl

  • The bees in the middle of the level are really annoying and will almost always knock Marty backwards no matter where he collides with them. Luckily, we were able to jump so that Marty hits their hitbox in a certain way and gets pushed forward.
  • There are two routes through this level, so we chose the faster one.
  • The jumping platforms at the end are so close together that we were able to walk instead of run for the whole section, saving a frame each jump.

Operation: Zoo Askew

  • Marty can only be spotted by the guards four times. If he's spotted a fifth time, the level restarts.
  • Marty is supposed to hide in the open crates and crawl into the small crates to avoid being seen, but we're going for speed here. Ain't nobody got time for that!

Subway Surfers

  • In the third room, we use Damage Knockback Cancel to crush a rat in a tight space.
  • The level ends over half a second faster if you change characters in midair near Marty instead of landing as the current character.

Operation: Ship Sneak

  • Due to the design of the second room, karate chopping the rats is almost always faster than damage boosting from them.
  • Damage boosting in a tight space near a crawling tunnel allows us to get the penguin stuck standing in the tunnel, where we can chop the rat earlier and crawl forward faster.
  • There are multiple routes through the third room, so we chose the fastest one.

On the Beach

  • You're not supposed to be able to cross big pools of water with Marty, but it's possible with a fairly precise jump.
  • Falling onto the sign and using the character switch trick is faster than crossing the water and landing next to it.
  • Lag is manipulated away by staying close to the ground and turning around in midair when needed.
  • A slow water section in the second room is skipped using Alex's double jump and Damage Knockback Cancel to run through the cacti.
  • In the third section, we use Damage Knockback Cancel and invulnerability frames to run through birds and thorny bushes that would normally damage Marty.

Jungle Dub

  • Jumping over the cacti-topped mesa is much faster than crawling under it.
  • Damage is taken from a cactus in the second room to avoid being knocked back by a spider.
  • Switching to Gloria after Alex's double jumps makes us fall faster and allows us to climb the tree really fast.
  • In the third room, some subpixels are lost to manipulate away lag and allow a faster route on the ground.
  • Falling into the last pit is slightly faster than jumping in.

Lemur Rave

  • One of those minigames that's in a lot of GBA games. Hit the buttons shown to whack away the foosa.
  • We manipulated the number of foosa to be 10, the lowest number allowed by the game.
  • The fastest way to clear a foosa is to have a single one or the last of a group hit Melman. This can only be done four times without dying.

Melman's Sneeze Jump

  • Melman can now perform a new ability, the sneeze jump!
  • The sneeze jump moves slower horizontally than Melman's regular jump, so we made sure to minimize the time spent sneeze jumping.
  • Certain ledges in this level are tricky because Melman will "bounce" as the game decides whether or not to let him on top of them. Watching the subpixels is necessary to optimize these ledges.
  • Melman's hitbox for rescuing the lemurs is around his body and legs, which is why touching them with his head and long neck doesn't do anything.
  • The lemur in the deep pit is just low enough that you can't collect him and air-sneeze jump onto the next platform.

Lemur Liberation

  • This level took the most planning and testing of the whole run, but it paid off! Our main strategy was to keep going forward whenever possible. Even if you have to slow down to reach a really high or low lemur, it's faster than going back left.
  • It takes an extra frame to start running before jumping to the first lemur, but the extra speed is worth it.
  • Melman's landing animation is skipped by pressing Down to dig right before hitting the ground.
  • The final section of the first room required a lot of planning, and many tricks were used to pull it off.
  • In the second room, lag frames can occur as often as every other frame. Screen scrolling and character switching were kept to a minimum to reduce the lag.
  • Crawl Clip was almost useful in one of the crawling tunnels, but it can't be done without wasting time unless 10 or more frames could somehow be saved from the first half of the room.
  • The 22nd lemur in the second room is saved using Alex's double jump. This is faster than a sneeze jump because it lets Marty land and start running earlier.
  • Extra Jump was used in the third room to catch both the 14th and 15th lemurs and get up to the 16th lemur's platform without having to land and jump again.
  • Lag was reduced in the third room by facing left and jumping at different times when possible.

Wild World

  • Optimizing this level was a cinch after finishing Lemur Liberation.
  • During the first jump of the second room, you could turn around in midair to reduce the lag, but it would be slower than running through at full speed.
  • The upper route through the second room is faster because it avoids a long crawling section.
  • The spitting flowers are positioned such that they can't damage Marty inside the tunnels, so Crawl Clips can't be done.
  • We face backward once in the third room to slow down and avoid hitting the side of a cliff.

Alex's Claws

  • Alex's B button attack now includes slashing with his claws. This slash can also be stored with Attack Storage (when another characters are present).
  • Turning the 8th foosa into a ninja saves us from having to jump all the way up to his platform.
  • We gain some sort of vertical speed boost from the ledge next to the 10th foosa, which lets us fall to him faster.
  • We go to the leftmost point on the cliff between the last two foosa to hit the 12th on the earliest frame possible.

Alex's Escape

  • This level's design includes multiple double jump ledges in a row. Unfortunately, you can't go over all of them at full speed.
  • Without being able to do Damage Knockback Cancel, we had to avoid enemies, since taking damage drops Alex's speed from 512 to 358.
  • The bridge near the end is very laggy. We double jump across it to scroll the screen away from it and reduce most of the lag.

Gloria's Dive

  • Gloria can now dive into water. This isn't helpful for our run, but it's essential for a 100% TAS.
  • While the tiki trampolines give us a big vertical boost, they unfortunately don't increase our horizontal speed.
  • After swimming up the waterfall, we slow down to avoid hitting the wall and losing all of our speed.

Island Getaway

  • The bridge in the first room lags a lot, like the one in Alex's Escape. We reduce the lag by turning around in midair and walking for one frame while on the bridge.
  • You're supposed to crawl through some tunnels to get around "insurmountable" cliffs, but we make it over those cliffs using Melman's sneeze jump with Marty's fast speed.
  • Damage boosting off the bird is the fastest and easiest way to clear the large gap in the third room.
  • The boxing alligators are pretty hard to avoid, even with Damage Knockback Cancel. We jump over them when possible.

Marty to the Rescue

  • This music creates just the right mood for this part of the movie.
  • Sneeze jumping is not an option, and damage boosting is too slow, so we had to slow down in order to avoid sharp plants, hit flower trampolines and make it over ledges.
  • We use the facing backward and one frame walk strategies to reduce or eliminate the lag on the bridges.

Alex's Claw Climb

  • Mort is so weird.
  • Alex can now climb up walls. The fastest way to climb them is to single jump as soon as he grabs onto the wall, and repeat until he reaches the top.
  • Double jumping is faster than climbing up to the lemurs, so it is used when possible.
  • The short cliffs after the 9th lemur could be surmounted faster with double jumps, but it would put us in worse positions for clinging to each of the next cliff sides.

Foosa Lair

  • For the first room, avoiding or running through the enemies is generally faster than slashing them with Alex's claws.
  • We abuse damage invulnerability to make it to the cliff without wasting time fighting the big spider.
  • Each room is a maze, and the first two have paths that branch off and then come together later to confuse the player into going back the wrong way. We chose the fastest of these paths:
  • We make a precise (one frame for both jumps) double jump to reach the second big spider and follow the fastest path.
  • It's barely faster to attack foosa in tight spaces than to take damage and run through them.
  • We turn around before entering crawl tunnels to land as far into the tunnel as possible so Marty will have less time to move at the slow crawling speed. Saving 256 subpixels doing this is a whole frame less of crawling.
  • Boosting off of that one spider is the fastest way to get to the bottom of that small room.
  • The last leftward jump of the second room is a strange one. We have to get Marty to land in a narrow tunnel as far left as possible, without hitting the big wall on top of the tunnel. We do a strange-looking jump to accomplish this.
  • Once we have both characters, we can do character switching tricks again, which moves things along a little faster.
  • Health point management is important in the last area. There are lots of enemies in the way, and we need to be able to run through them as fighting them takes too long. We could take one more hit and use the "sixth" health point to enter Zombie Mode, but it would make progress impossible since Alex and Marty constantly need to switch off for their special moves. For instance, if we became a zombie after being hit by the last big spider, Alex could climb up the cliff, but we would not be able to switch to Marty to enter the crawling tunnel at the top.
    • We kill a spider for its health flower, which gives us just enough health to finish the level without fighting anything. This spider is the fastest enemy to kill by a quarter of a second, and is faster than avoiding damage at any point.
    • We have to wait a little bit for the flower to become grabbable. This wait also allows the foosa to moonwalk right some, putting it in a better position for jumping over it.
    • We have to jump over the foosa, as we can't afford to lose the health point we'd need to run through it.
    • The next spider is quickly dispatched using Attack Storage with Alex's claws.
    • Finally, we barely avoid hitting the small spider near the end and hang on to our last health point.

Foosa Arena

  • The foosa and giant spiders have joined their evil forces!
  • We restart the level a few times to manipulate the foosa and lemur spawns. Very few things influence these spawns, but we found that restarting only this level (not other levels, and not through wasting frames or different input) changes the pattern each time. Even with the time spent restarting, this spawn pattern is over 17 seconds faster than the original one.
  • The goal of this level is simple: don't let the foosa get the lemurs. As we can't speed anything up until the end, we use the time to entertain.
  • Kicking the lemurs makes them start running to the right instead of prancing slowly. It's important to kick the last two as soon as possible to end the level on the earliest frame we can.
  • It is possible to get an in-game time of 00:45, but it requires many more restarts (16 total), too many for it to save time.
  • At the end, we press A to get through the screens of the final cutscene, as pressing Start would skip the credits.

CoolKirby's comments

Ma-Ma-Madagascar, Ma-Ma-Ma-Ma-Madagascar...
I'm really glad we got this done! Back in 2012, it used to be a struggle for us to even complete one level with our busy schedules. But this fall, things opened up for me, so after talking with YoungJ, I went ahead and finished our run. Hope you enjoy it!
I think my favorite screenshot is the second one.

YoungJ's comments

I like to move it, move it... No, but seriously, this all started with me watching Madagascar over and over again. So when I found out there was a Madagascar GBA game, I immediately downloaded of CoolRoms (sorry mum)...and played it on VBA, which was one of only a few workable emulators on my crappy 2006 Compaq. And then, 14 year old me said "You know what? This is perfect TASing material." Keep in mind that I, at the time, was probably one of the most annoying users on the forums since JWinslow. So me actually TASing a game was unheard of. I was surprised to see the positive feedback from everyone once I uploaded the WIPs for the run, but then I needed some help, because school was happening. So I called upon CoolKirby...was it spring 2012? I think it was. And from then on, the rest is history. I would like to thank everyone who has been supporting us throughout the run. You guys are awesome. And a special shout-out to CoolKirby for helping me out with the run when I couldn't finish it. You are the best :)

Possible improvements

  • Alex can probably turn around a little faster in midair during the double jump in the first level, saving a frame or two, though this and any other early changes would change lag patterns for the rest of the run.
  • A few early levels that utilize Alex's double jump could also probably be improved by 1-2 frames by switching to Marty between the jumps.
  • Most of the levels that utilize Marty's crawl could possibly be improved by up to a frame each by using the trick to go the opposite direction on precise frames and press against the wall (used starting in Foosa Lair).

Suggested screenshots

8299, 47319, 59714

Thanks to

  • NitroGenesis for finding out you can damage boost to save time (back in 2012)
  • VanillaCoke for teaching us how to look up memory addresses (way back when), which were crucial to optimizing the run
  • Everyone who posted in the Madagascar forum thread
  • Vicarious Visions for making the game
  • You, for watching

Nahoc: Judging...
Nahoc: Good audience response. Accepting for publication in the vault tier.
sheela901: Processing...
Last Edited by adelikat on 10/12/2023 3:47 AM
Page History Latest diff List referrers