Shrek 2 is a 2004 side-scroller developed by Vicarious Visions based on the film of the same name. Like onions and ogres, the game has layers; this TAS utilizes tactical damage-boosting, efficient simultaneous multi-character control, and a variety of other techniques to complete the game as fast as possible.

Overview

Shrek 2 has 25 levels, with five levels in each of the five worlds. (Technically, the game refers to worlds as 'Books' and levels as 'Chapters').
The game has five different characters: Shrek, Donkey, Puss in Boots, Gingerbread Man ("Gingy"), and Human Shrek. The characters have varied physics, with different jump heights and specific abilities. Eight out of the 25 levels have multiple characters. In these levels, you can freely switch between characters to control them individually, but you can also simultaneously control multiple characters if they're close enough together.
Each level is basically independent, so I was able to TAS the levels out-of-order and then recombine them. Occasionally, there would be slightly different lag, but overall, this approach was beneficial because it made it easier to isolate each level and to optimize level transitions.

Script

I made a Lua script to help create this TAS: https://github.com/RetroEdit/shrek_gba
It displays the position and speed of all player characters in the level and a few other pieces of information.

Characters

The character have a fixed jump height that's not affected by how long you hold the jump button. Generally, you want to jump as few times as possible, because every time you land, you're penalized with several recovery frames where the character accelerates up to the standard speed. The recovery time varies between characters.
Each character has two different abilities activated by the 'B' button. One occurs while they're walking and completely halts the character's movement, so it's generally avoided in the speedrun. The other is their midair ability and is far more useful. All characters except Ogre Shrek can use their midair ability before they collide with a ceiling to extend their jump width; by doing this, they slide across the ceiling instead of immediately bouncing off back to the ground.
Shrek is the least agile character. He can punch and has a midair stomp ability that breaks through horizontal walls and quickly defeats enemies. He is also the only character who can pick up boxes and mushrooms. Ogre Shrek is in 11 levels.
Donkey can kick objects to move them while standing and can spin-kick in midair. Donkey is in 8 levels.
Puss can sword slash standing and do a spinning sword slash in midair. Puss can also climb walls and slide down vines and banisters for the highest (practically achievable) horizontal movement in the game. Puss is in 7 levels.
Gingy can throw candy canes, the only ranged attack in the game, although the candy canes despawn if they get too far from the camera. Gingy is in 6 levels.
Human Shrek can sword slash both standing and in midair which moves objects in a similar manner to Donkey's stationary kick attack. Human Shrek is in 4 levels.

Movie endpoint

I ended last input at the last dialogue box of the last level. The game does have one last story screen sequence after this, but going through it or skipping it just leads back to level select, so unfortunately the game does not show credits at the end (you can only access them from the title screen, and you can access them even with a fresh save file).
I thought this approach was sensible for this game, and it matches the current realtime speedrun rules.

Levels

The level details often reference tactics described in the 'Tactics' section below.

1-1

One of the more involved levels. Shows many of the basic tactics: damage boosting, tight midair movement, and object management (quick carry), among others. To top it all off, the damage boost at the end of the level is subpixel-perfect.

1-2

A fairly basic level. Donkey wall-kicks, ceiling glides, and damage boosts his way to the end. Spin-kicking through the second-to-last door saves a few frames, but the ending unfortunately has a poor x subpixel that's (surprisingly enough) too far leftward.

1-3

The first multi-character is not too complex compared to some later ones. Shrek and Donkey generally stay grouped together because of obstacles like push blocks and walls, but Donkey is able to get ahead by doing a fast fall in a few places.
The mushroom bounce at the beginning was inspired by losviken's setup.

1-4

Another multi-character level, this time with more switches. The flag bounce relies on both characters: Shrek can't quite reach the flag alone, but Donkey's presence alters the hitbox so it's low enough for Shrek to bounce on.
Like the real-time speedrun world record, the TAS uses damage boosts at the end to skip the intended route of picking up the shield; this requires Donkey to have at least three health at the end.

1-5

This boss level contains my first major discovery that inspired me to make the TAS. Normally, peasants with pitchforks keep spawning from carriages keep spawning until you've defeated around a dozen. However, by defeating the two pumpkin spawners and flying pumpkins at the top and then simultaneously defeating the two peasants on the ground, the level will end before more can spawn.

2-1

A new route the TAS discovered is to only move the trampoline at the beginning to the second platform from the top to jump sooner.
Unfortunately, the flying pumpkin at the very end has a poor cycle, so Shrek has to wait a bit before attacking it; if a damage boost is attempted, Shrek will fall through the flag back down. Better camera management may improve the pumpkin's cycle.

2-2

This is another level where health management was important. I had to redo the beginning of the level so I had enough health to damage boost off the spiked shield knights at the end.
Losviken's old TAS inspired spin-kicking shortly before landing next to the trampoline to avoid the trampoline. It was only a four-frame window, so it was easy to miss.

2-3

This is the first higher-complexity multi-character level. Actions had to be carefully interleaved to do independent actions with both characters. At the end of the level, the camera had to be quickly alternated between Shrek and Donkey so Shrek can catch up to Donkey at the end of the level.

2-4

Another complex level. Setting up Donkey to bounce on the mushroom in midair required some very careful camera management and quickly avoiding the enemies at the end also required some care.

2-5

This is a fairly straightforward boss, almost a fixed time level. Puss's position appeared to sometimes be affected slightly by damage boosting off him, but I'm not sure if that can save any time.

3-1

The first Puss in Boots level does a good job of highlighting Puss's various movement abilities: climbing, sliding down vines, and sword slash landings.
One major trick in the TAS is falling through an invisible gap between the vine and the wall midway through the level, which saves a few seconds.

3-2

Unquestionably the most complex and time-consuming level to TAS in the game and among the longer levels as well. This level has sensitive lag patterns and complex camera routing.
Shrek's damage boost off the archer's arrow was newly discovered in the making of this TAS.

3-3

This is the first level to feature searchlights: the level will restart if a character comes into contact with them. The level also has slug-ray goons, who will similarly cause a restart if they turn the character into a slug, but they're generally easily avoided in this level.
Later on, Puss picks up a ghost, which may not technically be necessary in a TAS, but does probably result in a net time save. This level also features some camera management to move Puss and Shrek simultaneously.

3-4

Another solo Puss level. This is probably the most vertical level in the game. One particularly precise component is avoiding the slug-ray goon's blast after the first wall climb. This is possible in real-time, but difficult.

3-5

One of the simpler levels. Donkey picks up the fairy because it allows him to make longer jumps and land fewer times, allowing net time save; this is made viable by the damage boost upwards from the knight.

4-1

The first human Shrek level. Careful sword slashes allow the first trampoline to be far enough right to quickly bounce upwards. Like the real time speedrun, the TAS skips the intended route of obtaining a shield and instead damage boosts off the thorns.

4-2

Another searchlight level. In this level, Puss has to go all the way right to hear the Fairy Godmother's dialogue before heading back left to complete the level. Puss can generally navigate the searchlights quickly, but unfortunately on the way back, the middle searchlight after the climb is in a poor cycle and causes a noticeable delay.

4-3

The first Gingy level; generally straightforward.

4-4

The third and final searchlight level. In this level, Gingy has to break all orbs and go back to the beginning of the level to finish.
The TAS opts to pick up the ghost, which takes a few seconds. In the long run, this wastes less time avoiding lights, but I didn't rigorously compare the two routes.

4-5

The third Gingy level in a row. Extremely optimized, this basically makes use of all of Gingy's candy cane mechanics. The TAS is able to hit the final bridge's switch very quickly, while a casual playthrough of the game will probably fall and have to backtrack left.

5-1

Fixed-time level. No optimization possible.

5-2

A second solo Human Shrek level. Like many other levels, the TAS avoids the intended route of picking up a shield and instead damage boosts past the spiked shield knights. The damage boost route here utilizing the axe knight beforehand is particularly fast and was newly discovered in the process of making the TAS.

5-3

Another camera-management heavy multi-character level. For the final time, (Human) Shrek skips an intended shield pickup and instead uses the sword ceiling mechanics to damage boost to the door button. At the same time, Puss is moving forward with Gingy to get a head start on the climbing section. In the following section, the camera is moved wildly to allow the spiked shield knight to advance further so he doesn't interfere with Shrek and Puss's retrieval of the trampoline.
All this effort could have been avoided if Shrek could damage boost up to the platform, but unfortunately, the bottom platform in that room is slightly too high.

5-4

A final medium-to-high complexity multi-character level to finish it off. In this level, the characters have to hit the Fairy Godmother three times, gradually leaving characters behind as they advance. Gingy's ranged attack is able to sidestep the intended route by hitting her more quickly on the first two parts. The level is generally fast, but the Fairy Godmother also has a (timer-based?) attack that affects her hitbox and complicates further time save.

5-5

Fixed-time level. No optimization possible.

Tactics

I've tried to label each tactic with a descriptive name and describe how it saves time.

Ceiling glide

For every character except Ogre Shrek, using their midair ability allows them to glide on the ceiling for a few frames instead of immediately falling down.

Climbing

Often, you'll want to counterintuitively land on walls at a lower position so Puss spends less time just barely missing the jump at the top of the wall.

Camera management

Managing the camera (the portion of the level that is visible on-screen) is vital for speed. In multi-character levels, the camera controls are pressing 'l' or 'r' to switch characters. By holding both 'l' and 'r', you can control all characters that are on-screen or nearby. When you switch between characters, you can't always control the other character immediately; it takes a few frames for the camera to "bind" to the character and allow movement. Sometimes, this may take a few dozen frames if the characters are too far apart, so you generally want to keep characters close together.
A few common tricks are letting go of 'lr' when doing actions specific to one character and jumping before switching characters so the original character is still moving even while the camera is focused on another character. Sometimes, moving the camera away from a character will reduce lag. There are also some more esoteric tactics like temporarily focusing on the wrong character so the camera will move to that character faster later and controlling multiple characters simultaneously even when it isn't directly necessary to position the camera itself.
The camera also affects entity movement in all levels, since entities will only move when the camera is close enough to them.

Damage boosting

Damage boosts are a major tactic. They have multiple uses: you move slightly faster while being boosted, you have minimal landing penalty (only one frame of no movement), you have temporary invulnerability to damage, and you can sometimes reach places that would otherwise be inaccessible.
Characters have limited health and very few opportunities for health pickups, so not every damage boost opportunity can be taken. Sometimes routing the optimal damage boosts is not immediately intuitive because each one affects your subpixel.

Fast fall

Donkey and Gingy can start a fall at a high momentum by using their abilities to slide across the floor right before they fall off the edge.
A similar mechanic exists for using abilities right before a ceiling ends to retain a bit of upwards momentum.

Jump chaining

By jumping within a few frames of landing (the exact interval varies between characters), you can avoid one frame of non-movement.
Donkey can spin-kick right before landing to increase the interval before he has to jump again.

Level transitions

Sometimes in multi-character levels you will lost 3 frames to a slower character animation at the end. I'm not exactly sure what causes it, but I think it's related to character's relative positions and perhaps their subpixels. Each character has a different speed ending animation and the ending to multi-character levels is based on the character with the fastest ending animation.

Midair movement

In the air, you can tap left and right to precisely adjust your x speed.
Characters have the most direct control over their x subpixel in the air. Generally, I aimed to optimize x subpixels to within 44 of the goal, but in long vertical sections it's technically possible to optimize within 0-2 subpixels.

Push blocks

There are push blocks that require two or three characters to move. Sometimes, waiting a few frames until the characters are grouped together allows the push block to pushed with more consistent speed.

Quick carry

Continually picking up an object and putting it back down as Shrek moves horizontally is often faster than completely lifting up the object because Shrek is frozen in place while picking up objects. If you actually have to pick up the object to a higher height, this is less effective.

Sliding

Puss can slide down vines and banisters for a high horizontal speed. Some are lower speed, while others are higher speed, but generally sliding is the faster movement option relevant for the TAS. Waiting to jump also allows Puss to jump farther and maintain the speed for longer.

Stomping

Jumping so Shrek is closer to the ground before he stomps allows him to break horizontal walls sooner.

Sword slash landing

Puss and Human Shrek can avoid almost all of the landing penalty by doing a frame-perfect 'B' press to swing their sword shortly before landing. This also allows them to pick up object like keys sooner.

Wall kicks

Generally, you want to break walls as fast as possible so you can move past them, since the wall's hitbox persists for a number of frames after being kicked. Donkey's midair kick will generally hit the wall sooner than the stationary kick. By timing the kick press so Donkey's animation is facing backwards, Donkey's hitbox will collide with the wall sooner.

Time breakdown

InLevel measures starting with the first dialogue-skip Start press in the level and ending with the final dialogue-skip Start press.
I saved a bit over 00:12.98 compared to my last posted WIP. Most of the time save was from better camera routing in multi-character levels. (Specifically, I saved time in the following levels: 1-1: -1F, 1-2: -1F, 1-3: -122F, 1-4: -69F, 2-1: -7F, 3-2: -261F, 3-3: -113F, 5-3: -201F)
These times are somewhat misleading because of lag: see the section 'Future possible improvements' below for more details.
LVL:  Load, InLevel (mm:ss.ms)  | Rerecords
1-1:  588F,   2022F (00:33.853) |      2128
1-2:  214F,   2492F (00:41.722) |       930
1-3:  104F,   2422F (00:40.550) |      2379
1-4:  107F,   3072F (00:51.433) |      2520
1-5:   99F,    519F (00:08.689) |      2470
2-1:   80F,   2459F (00:41.170) |      1797
2-2:  212F,   3220F (00:53.911) |      2306
2-3:  103F,   3948F (01:06.100) |      4077
2-4:  106F,   2359F (00:39.496) |      4350
2-5:   99F,   2530F (00:42.359) |       360
3-1:   90F,   3320F (00:55.585) |      2122
3-2:  257F,   4166F (01:09.750) |      6189
3-3:  106F,   3373F (00:56.473) |      3157
3-4:  215F,   2381F (00:39.864) |       788
3-5:  257F,   3745F (01:02.701) |       889
4-1:  147F,   4502F (01:15.375) |      1034
4-2:  204F,   3532F (00:59.135) |      1104
4-3:  257F,   2182F (00:36.532) |      1675
4-4:  329F,   2688F (00:45.004) |       716
4-5:  327F,   2574F (00:43.095) |      1967
5-1:  369F,   1802F (00:30.170) |      1147
5-2:   40F,   3040F (00:50.897) |      1602
5-3:  204F,   4287F (01:11.775) |      4344
5-4:  206F,   2079F (00:34.808) |      3264
5-5:   49F,   2701F (00:45.222) |        15
Sum: 4769F,  71415F (19:55.680) |     53330

Final: 76184F (21:15.526); Rerecords: 53730
RTA: 21:07.874

Future possible improvements

  • Overall, I did my best to optimize levels by hand. However, this TAS is not perfect by any means. The multi-character levels are particularly complex, so it was easy to lose time despite my best efforts. Here's one potential improvement in 5-4.
  • In other games by the same developer, out-of-bounds glitches are possible, but I couldn't find any setups in this game.
  • This game's lag is emulated very inaccurately in BizHawk 2.9.1's mGBA. On a real-console, an old version of the TAS was ~17.9 seconds longer because of more lag, mostly concentrated in multi-character levels. In the future when lag is better emulated, lag reduction could be approached better. There already exist more accurate GBA emulators like NanoBoyAdvance; NBA is only ~81 frames from real console as of version 1.7.1 (source), but it doesn't have TAS support yet.
    • In the past week, GBAHawk was added to the site. I created an alternate GBAHawk 1.4 movie for this TAS.
    • The GBAHawk movie is probably technically more accurate to the TAS's final time. I considered submitting my movie as this GBAHawk file, but decided against it for a number of reasons: GBAHawk still has ~4 seconds less lag than real console, my movie wasn't optimized for GBAHawk's lag anyway, and my current workflow is dependent on some BizHawk save-anchored files that would take a bit of time to replicate in GBAHawk. GBAHawk also has worse performance than mGBA, so overall, further lag reduction improvements are probably best saved for a future submission.
    • Update (2023-09-02): New resync to GBAHawk 1.7.0. GBAHawk 1.7.0 is much more accurate and now basically has Shrek 2 lag parity with NanoBoyAdvance and SkyEmu. All three emulators are still a dozens of frames faster than real-console over the entire run, though.
    • Update (2023-10-05): New resync to GBAHawk 2.0.0. A resync of this publication. In testing, GBAHawk 2.0.0 emulates Shrek 2's lag perfectly, so it may be sufficient to allow console verification now.
    • Update (2024-02-13): As of GBAHawk 2.1.0, a resync of this movie has successfully been console-verified. This movie is 1199 frames (00:20.07) longer due mainly to extra in-level lag and also some extra load time. 411 of those extra frames (00:06.88) were solely from 3-2, so the route possibly needs adjusted for lag reduction.

Special thanks

(in alphabetical order)
  • Alyosha: for promptly adding support for Shrek 2 in GBAHawk a few days after I requested it.
  • losviken: for creating a TAS in 2016 that went through 2-2. My time ended up being a few seconds faster in each of these levels, but the original TAS inspired several tactics that would have been more difficult to discover otherwise.
  • smartalec24: for providing a starting route as the long-time world record holder of the game and patiently listening to my rambling about new TAS strategies
  • suqd: for some insight on how enemies activate when you approach their proximity
  • ...and to all the emulator developers who make tool-assisted speedrunning possible.

Suggested screenshot

31006 or a nearby frame

ThunderAxe31: Claiming for judging.
ThunderAxe31: Correcting the displayed ROM name to avoid confusion.
ThunderAxe31: It may appear a bit awkward to stop at the beginning of the last story sequence without clearing it, but if we think about it carefully, it's the most meaningful ending point. Beating the game doesn't trigger the credits roll, and beating the last level doesn't unlock anything. Getting back to the Book selection screen doesn't prove that you've beaten the game, as from there you can only see if you gained access to a Book, without telling you if you've beaten the last Book. On the other hand, beating the final boss results in triggering the last story sequence, which is the only thing that can objectively indicate that you've beaten the game.
For the rest, this movie put in play some cool optimization to beat the game as fast as possible. Accepting.

EZGames69: Processing...


TASVideoAgent
They/Them
Moderator
Joined: 8/3/2004
Posts: 15561
Location: 127.0.0.1
This topic is for the purpose of discussing #8442: RetroEdit's GBA Shrek 2 in 21:15.53
Experienced player (671)
Joined: 11/23/2013
Posts: 2230
Location: Guatemala
I've been waiting for a TAS of this game for years, and it did not disappoint, and so I will give it a Yes vote. Great job on this movie!
Here, my YouTube channel: http://www.youtube.com/user/dekutony
EZGames69
He/They
Publisher, Reviewer, Expert player (4458)
Joined: 5/29/2017
Posts: 2761
This was fantastic. I played this game a ton as a kid, and this TAS was a nice way to remember how it played out. I struggled a ton on the puss n boots and giant gingerbread man stages for some weird reason. I wasn’t expecting this game to switch into some Lost Vikings type gameplay, and as far as I could tell, the way it was done in this movie is pretty incredible. I don’t even want to think how complicated it must have been to coordinate all of those character movements using the same inputs. Yes vote from me.
[14:15] <feos> WinDOES what DOSn't 12:33:44 PM <Mothrayas> "I got an oof with my game!" Mothrayas Today at 12:22: <Colin> thank you for supporting noble causes such as my feet MemoryTAS Today at 11:55 AM: you wouldn't know beauty if it slapped you in the face with a giant fish [Today at 4:51 PM] Mothrayas: although if you like your own tweets that's the online equivalent of sniffing your own farts and probably tells a lot about you as a person MemoryTAS Today at 7:01 PM: But I exert big staff energy honestly lol Samsara Today at 1:20 PM: wouldn't ACE in a real life TAS just stand for Actually Cease Existing
Post subject: Movie endpoint
RetroEdit
Any
Editor, Reviewer, Player (169)
Joined: 8/8/2019
Posts: 152
I forgot to mention this in my submission notes, but I ended last input at the last dialogue box of the last level. The game does have one last story screen sequence after this, but going through it or skipping it just leads back to level select, so unfortunately the game does not show credits at the end (you can only access them from the title screen, and you can access them even with a fresh save file). I thought this approach was sensible for this case, as it follows the internal logic of the speedrun, and matches the current realtime speedrun rules.
CoolHandMike
He/Him
Editor, Judge, Experienced player (895)
Joined: 3/9/2019
Posts: 692
This was very good! 8:00 and 18:00 with the multiple characters you can switch between was great. Must have taken some effort to get that fast for those. It is too bad those boss fights could not be sped up though. Yes vote.
discord: CoolHandMike#0352
Post subject: Movie published
TASVideoAgent
They/Them
Moderator
Joined: 8/3/2004
Posts: 15561
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. ---- [5469] GBA Shrek 2 by RetroEdit in 21:15.53