(Link to video)
All your base are belong to pi.
Download package (C++ input parser and script file): http://tasvideos-moviefiles.googlecode.com/files/piscript.zip
Information that is even more technical than what is covered here: Forum/Posts/342003

Goals

  • Pi
  • Pi
  • Pi

About the TAS

Well, this TAS is a bit different. Instead of ponies, you get pi.

What in the name of pi is going on

To hijack program control, you need two things:
  • A way to divert the program counter (PC) into RAM.
  • A way to write the right program.
Conventional thinking (such as in p4wn3r's 1:09.63 TAS) has shown that the address D36D-D36E is a well-used gateway to send the PC into RAM. Just put any 16-bit number there (little-endian) and the PC will jump to whatever it says when you close the menu. Furthermore, using memory-manipulation glitches such as switching Pokemon beyond the 6th position, and switching and tossing glitched items, you can pretty much write whatever you want from D16A onward. And how do you switch Pokemon beyond the 6th position, if such a thing is even imaginable? Just do a reset at the right time while saving and it will overwrite the Pokemon counter so the game thinks you have 255 Pokemon.
I inject the following sequence into D366 (don't ask): 22 00 76 00 F0 F5 D4 50 D3
Provided that the bytes from D350 to D365 are all 00 (which they are), these 9 bytes will magically hijack the GB and give you complete control of everything you ever wanted, only limited by the GB's hardware. Other sequences including shorter ones exist but I chose this sequence to be as fast as possible. To help out, the rival is given a completely illogical name.
Once the sequence is planted, I close the menu. The game reads D350 off the gateway address and thinks that it is a valid ROM address and so jumps there. The sequence and all future programs are craftily hacked together in a way that is hard to describe casually, so I'll just say this: given enough room (which I have more than enough of), you can write a very simple RAM-writing program. Congrats, you can now write whatever you want.
The payload (final program), which is only 152 bytes long, is a simple VRAM manipulator. It starts out by writing into the tile bank at positions F3-F7 the 8x8 tiles for pi, pi upside down, decimal point, zero, and one, where the last 3 are in Pokemon font (they were somehow erased after leaving the menu; none of the other digits were harmed). The program then enters an input-interactive state where you can feed it key input which can change the tile map. For this TAS, visible tilemap is practially divided into two spaces: topspace (top 12 rows) and bottomspace (bottom 6 rows). The two columns on both sides are unusable. For technical reasons, the bottomspace effectively extends below the bottom of the screen by two rows.
It works somewhat like this (0x means hexadecimal):
  • Feeding it a number from 0x00 to 0xED writes to a cache (at D600) representing the bottomspace (8 rows by 16 columns). Each number writes the tile for either pi or pi upside down in the cache at a given position. The cache exists in order to sync the bottomspace input. To perform a do-nothing-visible action, feed it the number 0xED. It writes off the bottom of the screen.
  • Feeding it the number 0xEE dumps the cache into bottomspace and clears it with the all-black tile.
  • Feeding it the number 0xEF ends the program. It fakes a GB crash and sends itself into an infinite loop.
  • Feeding it a number from 0xF0 to 0xFF writes directly to topspace (12 rows by 16 columns). Each number writes its own value (tile values F5-FF which are decimal point and digits) to the first available position in topspace. It writes serially (left to right, then top to bottom).
There is no guarantee that VRAM writing occurs in a safe (to a real GB) manner; it does not check for status of FF40-FF41 (for reference, pages 51-53 of http://marc.rawer.de/Gameboy/Docs/GBCPUman.pdf ).
Anyway, scripting VRAM to do what I want is a bit too hard to do entirely with manual hex-editing, so I wrote a simple C++ parser that converts ANSI (ASCII) into input. This allows me to use a text editor instead, and organize the script using characters that the parser ignores.

About the script used

I did my best to sync the "actions" of the tiles with the background music. First, note that dumping cache to bottomspace and writing directly to topspace cannot occur on the same frame, so they must be at least one frame apart.
Second, placing the frame on which the tile appears and the frame on which the peak of a sound effect first occurs on the same frame is not guaranteed to be perceived as sync. The human brain does not work that way. From my own testing, it seems best for the frame on which the tile appears to occur 5 or 6 frames back. Results may vary by person, state of mind, and method of encoding of course.
The normal beat window is 15 frames (this is the width between the first two notes of the Pokemon music when you start in the bedroom). This means that, when syncing to a 15-frame beat, each frame is limited to dumping 14 tiles into VRAM. Some notes occur with a window of 7-8 frames; I can pull this off early on, but I decided that later on it was too much of a hassle to maintain so I ignored those notes.
I threw in a few references to pi, games, or mathematical stuff that can easily be represented by dot matrix display. Otherwise, there's not much else to talk about. For more information about technical details, see this post: Forum/Posts/342003.
Well anyway, enjoy the TAS and help yourself to some pi. It's a neat soundclip from the Hard n' Phirm song "Pi"; however, you shouldn't look for the rest of the song or its music video unless you are willing to lose a few brain cells. You can also listen to "Mathematical Pi" if you wish.
Happy Pi Day!

Nach: Accepting as improvement to existing run.

Personman
Other
Joined: 4/20/2008
Posts: 465
Voting yes for publication and obsoletion. This is faster and better. Which does not diminish the enormous respect I have for the original, but time goes on.
A warb degombs the brangy. Your gitch zanks and leils the warb.
MESHUGGAH
Other
Skilled player (1888)
Joined: 11/14/2009
Posts: 1349
Location: 𝔐𝔞𝔤𝑦𝔞𝔯
Voting yes, because you documented very well in the other NES/Pokémon thread what I really appreciate. Also the ammount of ponies is awesome in this movie, I hope every movie uses this as a standard (0).
PhD in TASing 🎓 speedrun enthusiast ❤🚷🔥 white hat hacker ▓ black box tester ░ censorships and rules...
Spikestuff
They/Them
Editor, Publisher, Expert player (2292)
Joined: 10/12/2011
Posts: 6337
Location: The land down under.
MESHUGGAH wrote:
Also the ammount of ponies is awesome in this movie.
*grabs Katana* Lets remember who encoded your videos... evil person. Also this Katana needs more blood.
WebNations/Sabih wrote:
+fsvgm777 never censoring anything.
Disables Comments and Ratings for the YouTube account. Something better for yourself and also others.
Active player (422)
Joined: 9/27/2004
Posts: 650
Location: Canada
I was like "this is cute". Then the numbers started and I laughed. Good job.
XYZ
Former player
Joined: 12/9/2006
Posts: 165
Location: 2bastuz
This movie reminded me JXQ's 100% SM movie with input animation in some moments, that is a sign that they both awesome. Yes vote.
Joined: 1/26/2009
Posts: 558
Location: Canada - Québec
FractalFusion wrote:
After finishing the H.E.R.O. submission, I decided to work on a "Pi Day" TAS, which I only had a week to work on. Initially, I thought about doing a TI-83 submission, but then decided not to pursue it, as apart from rattling off the first 10000 digits of pi and using curves to graph the shape of a pi, the idea didn't stick with me.
On the TI-nspire CX, you can actually run a game boy emulator on it without sound, but savestate work. I guess it's a bit to late for it, but someone should definitely take that gb emulator and add a "replay movie" feature so we can PI-jack this game even more.
Editor, Active player (296)
Joined: 3/8/2004
Posts: 7469
Location: Arzareth
I have now watched this submission's video about 3.14 times. So there's that.
Samsara
She/They
Senior Judge, Site Admin, Expert player (2121)
Joined: 11/13/2006
Posts: 2793
Location: Northern California
Yes vote, and obsolete the pony run.
TASvideos Admin and acting Senior Judge 💙 | Cohost
warmCabin wrote:
You shouldn't need a degree in computer science to get into this hobby.
Joined: 2/7/2009
Posts: 52
Location: 127.0.0.1
Why can't I hold all these Pi's? I dont think I've laughed so hard at such a TAS. Yes vote.
Joined: 6/25/2011
Posts: 15
One of the most entertaining TAS I have ever seen ! Even if bortreb's TAS has it's own merits for both being a precursor and the type of achievement produced, I agree that this run should obselete it, since it is far more interesting to watch as a playaround, especially for the casual audience.
Editor, Player (44)
Joined: 7/11/2010
Posts: 1022
I think this TAS should obsolete the previous run because it gains control in a much technically better way, which is the important part of total control runs. Given that you can do anything after that, what you do to show you've gained control is mostly irrelevant, it's the start of the run that's the important bit.
Joined: 3/19/2012
Posts: 9
I don't think this TAS is even comparable to the old Total Control TAS, given that this just takes control of the screen and displays funny things synched up to the music. It's funny, but nowhere near as impressive as reprogramming the game to make it do something completely different. Voted no.
Post subject: /me grabs knife
Spikestuff
They/Them
Editor, Publisher, Expert player (2292)
Joined: 10/12/2011
Posts: 6337
Location: The land down under.
STJrInuyasha wrote:
I don't think this TAS is even comparable to the old Total Control TAS, given that this just takes control of the screen and displays funny things synched up to the music. It's funny, but nowhere near as impressive as reprogramming the game to make it do something completely different. Voted no.
What.... The tas does more than the MLPTC (MLP Total Control) one in a shorter amount of time. "The funny things" is the programming itself being hidden basically.... HOW DARE YOU MAKE FUN OF PONG AND BREAKOUT "synched up to the music" It makes it easier to sing pi along to a beat "Reprograming the game" HE MADE PI FFS, and he also shows a few different things, the coding is much harder in this than the MLP one, he made pong and breakout with the pi shapes. "Something completely different" ... I want to smack you so hard right now. THIS is DIFFERENT, THE PI SHAPES DOING STUFF, HE DISPLAYS PI WITH PI LETTERS... I would go on but I don't want to waste my time with you (that goes for all the other points I noted). (end rant)
WebNations/Sabih wrote:
+fsvgm777 never censoring anything.
Disables Comments and Ratings for the YouTube account. Something better for yourself and also others.
Joined: 7/7/2012
Posts: 16
This is completely fucking hilarious and I couldn't vote anything but yes.
Post subject: Re: /me grabs knife
Player (12)
Joined: 11/23/2012
Posts: 94
I've never seen a brony rant so hard before about something being better than ponies. Spikestuff, there should be a Total Control TAS all about you.
Post subject: Re: /me grabs knife
Spikestuff
They/Them
Editor, Publisher, Expert player (2292)
Joined: 10/12/2011
Posts: 6337
Location: The land down under.
mathgrant wrote:
I've never seen a brony rant so hard before about something being better than ponies. Spikestuff, there should be a Total Control TAS all about you.
*reads the something better than ponies* Because I'm a magical sunova bitch <3. Yeah... no-one would be able to control me especially as a tas XD.
WebNations/Sabih wrote:
+fsvgm777 never censoring anything.
Disables Comments and Ratings for the YouTube account. Something better for yourself and also others.
Editor, Skilled player (1938)
Joined: 6/15/2005
Posts: 3246
By the way, I forgot to mention one thing. I thought someone else would have noticed by now. VBA assumes 60fps when calculating its time, and outputs AVI at 60fps, so I will make the assumption that 60fps is correct behavior (even though this is supposed to be a wrong assumption; I'll get to it later). Thus, I made the TAS proper (as stated in VBA) to be 11649/11650 frames long (exact number depends on version of VBA), or 3m14.15s/3m14.17s. The movie length, as well as its encodes, report to 3m14s. (Well, except Youtube. It messed up somehow.) The site parser assumes a framerate for GBx/GBA TASes of about 59.7275fps. This is supposed to be the correct framerate, as Ilari says. Using 11649 for the frame count, TVA would report a time of 3m15.04s. Obviously I didn't want that. Address 0x0C of a VBM file is "number of frames". It is a redundant reference to number of frames that VBA writes in but never actually uses (it will always check the actual length of controller data to determine a VBM's true length). This reference is used by TVA to calculate the time, regardless of the VBM's true length. I discovered this when bortreb submitted the Total Control Hack run and the time was reported wrong. As you can see, the trickery is now obvious: change the "number of frames" address value to 11596. TVA then reports a time of 3m14.15s, as intended, and VBA acts like nothing ever changed. This isn't really a big problem or anything1; if necessary, I can easily change the TAS proper to 11596 frames, without losing anything (the TAS movie file ends on at least 5 seconds of no input just to get the framecount to 11649/11650), at the cost of VBA displaying the time I want. As a side note, GBx/GBA movies on this site display times that indicate inconsistent fps values. Newer ones are calculated with ~59.7275fps, older ones with 60fps. Ilari says that there is no easy way to fix this. ---- [1]: Ignoring the fact that this can be abused by dishonest submitters.
Former player
Joined: 3/27/2010
Posts: 270
FractalFusion wrote:
The movie length, as well as its encodes, report to 3m14s. (Well, except Youtube. It messed up somehow.)
It's Youtube. Gotta love it, but gotta hate it. Probably the whole 30fps stuff and how it counts movie frames.. If you ever go find 10 hour video loops of something, you'll notice a lot of them are 9:59:59 or 10:00:01 instead of flat on 10:00:00.
Site Admin, Skilled player (1236)
Joined: 4/17/2010
Posts: 11267
Location: RU
Now this DOES look like a Star!
Warning: When making decisions, I try to collect as much data as possible before actually deciding. I try to abstract away and see the principles behind real world events and people's opinions. I try to generalize them and turn into something clear and reusable. I hate depending on unpredictable and having to make lottery guesses. Any problem can be solved by systems thinking and acting.
Banned User, Former player
Joined: 3/10/2004
Posts: 7698
Location: Finland
I'm not completely sure I understand what's going on here. And I'm not talking about the run. I'm talking about people's reaction to it, and how it was accepted as some kind of "improvement" on the other run. What "improvement"? This is not a regular speedrun. It has no specific goal. Unless you count "hack the game into executing arbitrary code" as a goal. However, if that is what's considered the "goal" of the run, then defining "improvement" is completely and horrendously arbitrary. If someone makes a 1 minute shorter run that executes 1 second worth of arbitrary code, does that constitute an "improvement"? Are we going to accept all "executes arbitrary code" submissions now? Or are we going to accept only those that "improve" (by an extremely subjective measurement stick) on the previous one, and have it replace it? And about this submission in particular, personally I don't see how this "improves" anything compared to the other one. Sure, it gets to the arbitrary code faster, but the code being run is, to be frank, less than impressive. Not to diminish the author's efforts, but I'm just being honest and expressing my personal views here. It prints numbers on screen, and makes a small animation out of a character. Neither of which looks extremely impressive to me. (Yes, I appreciate the fact that it's executing arbitrary code on the console, which ought to not be possible in normal circumstances, but I already saw that in the previous submission and, honestly speaking, I was more impressed with that one than this one.) Maybe if this had done something a lot more surprising and visual, but getting there faster, perhaps then I could consider it a true improvement. As it is now, I'm sorry but I just don't. I'm voting no, and these are my arguments why. (I wouldn't mind this being published. It replacing the other one, however, is a shame IMO.)
Site Admin, Skilled player (1236)
Joined: 4/17/2010
Posts: 11267
Location: RU
Obsoleting as much as possible is the current site policy, isn't it?
Warning: When making decisions, I try to collect as much data as possible before actually deciding. I try to abstract away and see the principles behind real world events and people's opinions. I try to generalize them and turn into something clear and reusable. I hate depending on unpredictable and having to make lottery guesses. Any problem can be solved by systems thinking and acting.
Noxxa
They/Them
Moderator, Expert player (4138)
Joined: 8/14/2009
Posts: 4083
Location: The Netherlands
Warp wrote:
What "improvement"?
100% less MLP is an obvious significant improvement. Also, doing roughly the same level of game-breaking in roughly a quarter of the time seems like a significant technical improvement - no matter whether the end results are pony music or pi digits. I agree that the pi's are not exactly the most impressive thing that could have been done, but I think it's still good enough anyway at showing the fact that the game has been utterly taken over by the TASer.
http://www.youtube.com/Noxxa <dwangoAC> This is a TAS (...). Not suitable for all audiences. May cause undesirable side-effects. May contain emulator abuse. Emulator may be abusive. This product contains glitches known to the state of California to cause egg defects. <Masterjun> I'm just a guy arranging bits in a sequence which could potentially amuse other people looking at these bits <adelikat> In Oregon Trail, I sacrificed my own family to save time. In Star trek, I killed helpless comrades in escape pods to save time. Here, I kill my allies to save time. I think I need help.
Joined: 2/20/2010
Posts: 209
Location: I'm in space
I liked this but prefer the MLP one, mainly because of the shock I experienced when the screens of seemingly random hex codes suddenly became Pinkie Pie's balloons set to the ponies theme song. The dancing pi's are cool, but I think the original video's "Holy Shit!!" moment is more valuable than this video's 2-minute "WTF?".
Oh, play it cool. Play it cool. Here come the space cops.
Banned User, Former player
Joined: 3/10/2004
Posts: 7698
Location: Finland
Mothrayas wrote:
Also, doing roughly the same level of game-breaking in roughly a quarter of the time seems like a significant technical improvement
Since this is not really a speedrun (because by convention a speedrun is completing the game as fast as possible), a shorter time in itself cannot be considered an improvement per se. (It could be considered an improvement if the executed code were the same, but not IMO if it's something totally different, especially if it's something significantly less impressive.) I would consider this an improvement if the arbitrary code did something more impressive than the first submission. This, in my opinion, is significantly less impressive. Thus not an improvement. I stand by my no vote. (Not that it will change anything, but I think every opinion counts for something at least.)
Samsara
She/They
Senior Judge, Site Admin, Expert player (2121)
Joined: 11/13/2006
Posts: 2793
Location: Northern California
Warp wrote:
I would consider this an improvement if the arbitrary code did something more impressive than the first submission.
Ahem.
Mothrayas wrote:
100% less MLP is an obvious significant improvement.
If you look at it from an audience perspective, it's a lot more technically impressive since this run delivers nearly the same amount of control over the game (in much less time) as well as making the run accessible to as many people as possible. Not everyone is an MLP fan, and hell, a fair amount of people outright despise the idiotic fandom it spawned. On the opposite side of the spectrum, everyone knows pi, right? It's a common concept, everyone's going to "get it", and even the people who saw the last control hack will still be impressed because this shows something new. And, as I said before, this run does it... what, a little over 10 minutes faster? This means there's no 12-minute wait to get to something that might piss off half or more of the people watching the run, and it gets to the entertaining action that much sooner as a result. What the last run does for setting a precedent, this run does for accessibility. Less wait to get to the payoff, an interesting concept that goes far, far further than just the game itself, and something that everyone watching can enjoy without a bunch of idiots spouting out shit about ponies or pony hating. The right decision was definitely made to have this obsolete the last run.
TASvideos Admin and acting Senior Judge 💙 | Cohost
warmCabin wrote:
You shouldn't need a degree in computer science to get into this hobby.