Submission Text Full Submission Page
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, 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.

Noxxa: 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.


Ford
He/Him
Joined: 3/5/2013
Posts: 183
Location: California
I thought it was a cute little video, though it wasn't anything really amazing.
Sir_VG
He/Him
Player (40)
Joined: 10/9/2004
Posts: 1914
Location: Floating Tower
Unlike everybody else, I thought the payoff was good. However, this shouldn't be published since the game isn't beaten. But make it a Gruefood Delight for sure.
Taking over the world, one game at a time. Currently TASing: Nothing
Player (27)
Joined: 3/2/2014
Posts: 34
Location: Canada
Why am I not the slightest bit surprised that someone actually made another PI TAS?
FractalFusion wrote:
On the way to Lavender Town, 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.
The city's name is Violet City, not Lavender Town. In all honesty, the TAS wasn't that interesting to me. It's a little fun, but isn't that entertaining. Meh vote for me. I'd like to see an "Executes arbitrary code" TAS to make Mew appear under the truck. That would be very interesting to see.
Meerkov wrote:
The human element of the run is far more entertaining than the game itself. If it wasn't for someone lying about their record 40 years ago, I don't think we'd take a second look at this run/game. Meh vote.
Masterjun
He/Him
Site Developer, Expert player (2047)
Joined: 10/12/2010
Posts: 1185
Location: Germany
FractalFusion wrote:
You guys are expecting too much. Though, I guess with stuff like [2513] SNES Super Mario World "arbitrary code execution" by Masterjun in 02:25.19 around, it can't be helped.
I disagree. I think it's justified to expect more after watching 30 minutes of Pokemon gameplay. Think about it, would people be satisfied with less if my movie had never existed? When I was searching for ideas for it, there were a lot of people in IRC that had really crazy ideas (and they were possible to implement, hard but possible). With "total control" if someone asked if something is possible, you can't just answer with "no" or "don't expect so much". You can't blame people for having high hopes (you even said that we have to blame you) as there are a lot of things you could have done.
Warning: Might glitch to credits I will finish this ACE soon as possible (or will I?)
TASVideosGrue
They/Them
Joined: 10/1/2008
Posts: 2792
Location: The dark corners of the TASVideos server
om, nom, nom... sweet!
ALAKTORN
He/Him
Former player
Joined: 10/19/2009
Posts: 2527
Location: Italy
luckytyphlosion wrote:
I'd like to see an "Executes arbitrary code" TAS to make Mew appear under the truck. That would be very interesting to see.
that sounds awesome, haha couldn’t you have just beaten the game like in Mr. Wint’s TAS? it’d be a new record, then
Joined: 12/29/2007
Posts: 489
Silver is faster than Gold because of a faster poison deathwarp, right?
Skilled player (1041)
Joined: 7/24/2013
Posts: 175
Having created a run of this myself, I feel I can appreciate many small things you did in this run that may go unnoticed otherwise. I especially like how your bootstrapping program works, I thought so hard about how to build an ending condition into the loop in my program when the answer is you just overwrite it. It may be possible to create an even shorter one though, e.g. the "or a" at $d8c8 seems to be unnecessary to me.