TASVideos

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

Submission #4213: FractalFusion's GBC Pokemon Gold "Mr. Pi's TAS" in 31:41.59

Console: Game Boy Color
Game name: Pokemon Gold
Game version: unknown
ROM filename: Pokemon Gold
Branch: Mr. Pi's TAS
Emulator: BizHawk 1.6.0a
Movie length: 31:41.59
FrameCount: 113577
Re-record count: 61413
Author's real name: Justin Chan
Author's nickname: FractalFusion
Submitter: FractalFusion
Submitted at: 2014-03-14 07:14:09
Text last edited at: 2014-03-16 05:23:52
Text last edited by: FractalFusion
Download: Download (12780 bytes)
Status: decision: cancelled
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:

(Link to video)

Nicovideo:
(account) http://www.nicovideo.jp/watch/sm23090718
(no account) http://www.nicozon.net/watch/sm23090718

Mediafire download (~10π MB): http://www.mediafire.com/watch/iiefdu9y66l79km/pokegold_pi.mp4

Today, Mr. Pi decides to play/TAS Pokemon Gold. Nothing too crazy like last year's Pi movie. Still, he comes out performing the arbitrary execution about 30 seconds faster than in MrWint's TAS, then decides to mess around instead of "beating the game".

Goals

  • Fastest to arbitrary execution.
  • Small Pi playaround after that.
  • Speed/entertainment tradeoffs.

How Pi plays Pokemon Gold

This run uses a different strategy compared to MrWint's TAS. Basically, it involves manipulation of stuff ranging from Trainer ID to Egg!Togepi's DVs/IVs. Also a few different strats were used.

Pokemon Gold was chosen over Silver because, well, just because. Enjoy the night time.

Since a lot of manipulations are tricky, the use of Lua to do brute-force searches came in handy. It's still crude at this point but it works.

Route to arbitrary execution and stuff

What appears constant is the need to listen to the cry of one of five Pokemon (such as Bellsprout) as well as to be aligned correctly on the map (usually, three steps to the left after opening a box of any kind is enough). Beyond that, however, there is a lot of leeway on how to pull it off. This run reaches arbitrary execution through this path:

  Coin Case -> Pokemon cries
  Bellsprout's cry -> map alignment
  Three steps to the left -> Pokemon 3 data
  Egg!Togepi's DVs -> Pokemon 2 data
  Rattata's Tackle + Mud-Slap + Trainer ID -> Box Names
  Box renaming -> arbitrary execution

Run info

Trainer ID

The trainer ID is F8E9. Enough said.

Note that accessing the options menu does not affect the RNG here in any way.

Totodile's DVs

Here, we manipulate a DV of FCFF (AtkIV 15, DefIV 12, SpeIV 15, SpcIV 15). Fortunately it came out with not so much delay.

Diversion after the first rival battle

If you're wondering what's going on, well, let the TAS speak for itself. Basically, poisonwarping is useful, and saves maybe 5 seconds or so (you'd still have to obtain a Poke Ball, and you lose a lot of money, if you need it for stuff like X Attack).

On the way to Violet City, there is a Poke Ball you can pick up, but since we're getting X Attacks, it is better to do so at the Mart.

Falkner

Using Rage is faster than using Scratch, maybe by a couple seconds or so. We pick up Pi's favorite TM, TM31 Mud-Slap, which will come in useful later.

Violet Pokecenter

We ignore the Egg guy and change the box names (only the first three boxes are changed; it may be possible to squeeze this to two). Then we talk to the Egg guy, and then leave. Egg!Togepi's DVs are manipulated to be 18AF.

Bellsprout encounter on Route towards Union Cave.

Encounter, then run away. The point is to register Bellsprout in the Pokedex to hear its cry later.

That Hiker's Geodude

There are a few options but 2 X Attack + Scratch seems to be the best.

Rocket Grunt with the Koffing

It is faster to get poisoned by Poison Gas (than to have it miss) just prior to finishing it off. No poison-related messages occur, and Totodile is healed afterwards anyway.

Rival

A different route that may or may not be faster; fighting the Rival before Azalea gym. Totodile can still OHKO the Gastly with one Water Gun, but requires an extra hit on Bayleef. Here, 2 X Attacks are used; this also makes Zubat OHKO.

Bugsy

Croconaw can OHKO Metapod and Kakuna with Water Guns. Scyther needs three hits, or two with an X Attack.

Rattata encounter on Route before Goldenrod City

Why catch Rattata? Because it has three moves, one of them being Tackle. Using TM31 Mud-Slap, we can get Tackle and Mud-Slap being the third and fourth moves, which, when combined with the trainer ID, gives us the jump in memory we need.

Once we get the Coin Case, everything is ready for arbitrary execution. Note that listening to Bellsprout's cry must be done second-last (Coin Case usage being the last), since certain chimes overwrite that segment of memory.

We could of course beat the game (in the way MrWint's TAS does) in record time, but Mr. Pi has other ideas and decides to make a small playaround in the remaining time.

About last year's pi-around and emulation accuracy/errors/stuff

I have dug into system specs during machine coding for the playaround to determine that, yes, last year's pi-around is invalid (not that anyone cares). Basically, writing mounds of stuff to VRAM without checking for V-Blank results in some areas where the written stuff doesn't go through (even if you checked for V-Blank, you still couldn't write a mass of stuff at once before V-Blank status changes again). I tended to be overly reliant on planning my VRAM abuse (as well as being lazy from one Pi Day to the next), so you have me to blame for not coming up with an awesome audiovisual program.

Improvements?

Well, there are possible improvements in luck-manipulation time. There are also other factors, like:

  • Cyndaquil?
  • Unown?
  • Pokerus?

Each additional factor gives an exponential increase in the complexity of this mathematical optimization problem. I'll leave that for another day.

Lua scripts

Some Lua scripts that were used to make this run: http://www.mediafire.com/download/fxjbcw95yt4ijj4/pokemongold_scripts.zip

A couple of them were used to brute-force some exceptionally low-probability events such as Trainer ID. The other one was used to display own Pokemon/enemy stats to make the stat display for the encode.

Thanks

Thanks to MrWint, Sanky (Sanqui), TheZZAZZGlitch, and others for work on dissecting Pokemon Gold and finding glitches in this game. Thanks also to bortreb for his original arbitrary execution run that got me quite interested in studying GB specs.

I'll write some more stuff if I get around to it. Anyway, Happy Pi Day.


Mothrayas: Judging.

FractalFusion: Cancelling.

I had been TASing Pokemon Gold just a few days ago and thinking, maybe I could casually mix some pi into it just as a fun side project for Pi Day (nothing too serious). Pokemon Gold x pi, what could go wrong? Well, this submission was an unmitigated failure. Not only did it have no way of measuring up to any previous arbitrary execution runs (being 30 minutes long to set up is bad enough), but it completely shut out any reasonable discussion of the actual content (gameplay optimization) of this TAS itself.

I wish I had the foresight to realize how terrible this idea was, but I am only human. I apologize for wasting everyone's time with this submission.


Similar submissions (by title and categories where applicable):