Baseball

Objectives

  • Aims for fastest time
  • Manipulates luck
  • Makes epic use of input scripting
  • Genre: Sport

Introduction

Baseball is Shigeru Miyamoto's masterful recreation of America's pastime. The game is rather primitive and has not aged very well, but it's still pretty famous because it was one of the first-ever NES games, and was apparently a big selling point for the system in North America. Still though, there's no reason to actually play it these days. If you have nostalgia for 8-bit baseball, just play RBI Baseball or Baseball Stars or something. They're still decent.
As a big fan of men hitting balls with sticks, I always thought a TAS that aims to beat a baseball game as fast as possible would be a mildly amusing watch. Simply because if you know anything about baseball, you'd know how ridiculous the game depicted in this run is. These two pitchers are either the two greatest pitchers to ever live, or the offensive lineup these teams have shat out are crackheads who are addicted to swinging at every first pitch (and somehow always make contact, which always results in an out). It's ironic that when you think superhuman play in baseball, you think steroid abusers blasting 5000 homers in an inning, but superhuman play in baseball in a TAS sense is actually a monstrous crime against humanity.
I'm not the first one to attempt TASing this game; that would be #6353: Captain_Forehead's NES Baseball "Fastest Win" in 10:45.05. This run is 9255 frames faster than that one. I give Captain Forehead credit since that run sparked my interest in creating this, even though it was not optimized enough to be published. This is also not my first TAS of this game; I made one that finished in 8:45 that I didn't submit, since I only really truly understood the randomness when I was well over halfway done, necessitating a v2.

Mechanics

Setup

Baseball uses a frame-based RNG. My understanding is that this is the same as the other blackbox NES games. To put it simply, if you throw a pitch at frame whatever and the opposing batter doesn't swing, he will never swing on a pitch thrown on that particular frame, and you must find a different frame to throw the pitch. This also means that there is no way to manipulate the pitches thrown by the CPU once a plate appearance begins. So, to "manipulate" the luck, it isn't always optimal to go for the fastest out if it'll result in bad luck during the next plate appearance.
I wait a few frames on the title screen before pressing start, to manipulate the game into giving me the home team. Then, I wait a few frames before selecting my team, in order to manipulate the game into giving me an optimal pitching matchup. I choose the Dodgers for no particular reason. I would've been fine with any team except the Yankees. The A's are the fixed CPU opponent with these frame choices, though it doesn't particularly matter which team is which.

Pitching

Before you actually start tossing any balls, it is very important to make sure the incredibly obnoxious animation of the pitcher shaking off the catcher does not play. It happens at complete random, and wastes significant time. I ran into lots of trouble making this run because of it; I'd spend close to an hour mapping out how an AB would go, finally settle on an optimal solution, only to have all my efforts go to waste because the pitcher decided to wag his head when the next batter is up. I did manage to avoid it for all 27 batters, but it was extremely monotonous stuff.
You have 3 pitches in your arsenal. Pressing A throws a regular pitch, holding down and pressing A throws a fastball, and holding up and pressing A throws a slowball. Of course, there's no reason to use the latter in a TAS. The speed of the pitch is not terribly important in relation to the speed of the batted ball, so I use the first two pitches interchangeably, depending on which pitch gives me the best luck. You can move the pitch while it's thrown with left and right, but it's only really useful if you're going for strikeouts.
The opposing batter's hitting power is randomly generated at the start of an AB, same with the frequency he'll swing at pitches. The hitting power isn't super important, but the swing frequency should be high, so you don't have to waste valuble time waiting for a frame where he'll finally take a hack at a pitch. The fastest way to record an out is to induce an extremely weak blooper that lands in the catcher's glove, but this is often not optimal since it'll result in poor RNG when you face the next batter. Often, my best solution was to induce contact to an infielder, who then throws to the first baseman. Even though this is not as fast, it's incredibly useful because the button press used to throw the ball after it's picked up can be delayed as many frames as you want to influence randomness against the next batter. There's no way to influence randomness when the opposing batter winds up hitting the ball directly into a glove, so it should only be done if you know in advance the randomness will be satisfactory against the next hitter.
Also, if you have played this game, you'll know that the fielders are god-awful defensively. You can't control them, they run extremely slowly, and they often allow balls to slip right through them, as if they're the Invisible Man. Many of the defensive plays in this run that might seem a little loose are incredibly precise by this game's standards. But, I can't deny it, I lost my mind after watching an outfielder somehow miss a ball that narrowly grazes his feet or some shit. It would've made TASing this game a lot easier if these numbnuts had brains, or could dive for pitches or whatever. But maybe that's asking too much.
When it came to selecting a frame to throw the pitch, I'm not going to sit and try out all frames by hand, because that's just way too monotonous. I used a sloppy input writer to go through all the frames within a certain point (usually like 20, because any more than that, you've probably just gotten horrible luck and should change the strat against the last batter) and throw a pitch on each one, then calculate if it results in contact by seeing if the ball's y-position increases. You still wind up with a lot of genuine hits or fouls using this method, so it still required some pruning, but it got the job done with some patience.

Batting

Given that you have very little control over the pitches the CPU throws, batting is pretty tricky. For the most part, I do most of my manipulation for the batting segments on the third batter when I'm pitching, since that's the only time I can painlessly influence what the CPU will throw for the first pitch. The CPU pitcher can also waste time by shaking off the catcher, and it's tougher to get him not to do it, because you have no way to delay frames when batting. Thus, you just have to ensure your hit results in decent RNG. I used a similar input generator to pick out all the hits in the run, which was easier since the window to swing the bat is smaller.
Most speedruns of Baseball rely on a home run to score the sole point of the game, as did the previous TAS. I opted to change the strategy to nab some outs along the way, so I start off the second inning with a double, use a sacrifice hit to move the runner to third, score the runner using a single, then hit into a double play to end the inning. If you're wondering if there's any relevance to picking the second inning, there actually is. If the game detects you're struggling long enough, putting a runner on base will drastically increase your chances of hitting a home run. So, for instance, had I attempted to do this in the sixth inning, my sacrifice hit would have left the yard. Since I'm trying to avoid a home run, I do this as soon as possible. I picked inning 2 over 1, because I was able to manipulate a quicker double there.

Other comments

Well, thanks for reading this far. I concede that this run is probably not entertaining to watch, but if you're a fan of baseball you might get some laughs from seeing these two awful teams go at it. Also, it's nice to get a good run of a classic NES game.
I think I did pretty well here, as evidenced by the fact that it's over 7 minutes faster than the best real-time run, but I would not be surprised if this could be improved, given the stiff mechanics of the randomness. I'm satisfied with the results of my scripts, however.
If this run is accepted, I'll probably move on to some other NES baseball titles. Though, maybe one that features a mercy rule.

Memory: Judging
Memory: So optimization appears to be a home run. The amount of manipulation used is quite high and the strategy used is solid as well.
Too bad it strikes out on entertainment by being 90% outs. It is extremely repetitive and monotonous to watch.
As slamo mentioned in the previous submission for the game, the Vault rules allow for sports games with game modes that have non-trivial speedruns. Since this is quite clearly non-trivial, this is acceptable.
Accepting to Vault.
Spikestuff: OH THAT'S A BASEBALL!


TASVideoAgent
They/Them
Moderator
Joined: 8/3/2004
Posts: 15542
Location: 127.0.0.1
This topic is for the purpose of discussing #6814: tormented's NES Baseball in 08:11.06
nymx
He/Him
Editor, Judge, Expert player (2228)
Joined: 11/14/2014
Posts: 927
Location: South Pole, True Land Down Under
First off...great job on cutting so many frames off of the previous rejected submission. After I reviewed your encode and read the submission, it answered all the questions I had. My first thought was..."Why are you not trying for In-The-Park home runs, or even straight up home runs". It makes sense now that you have to wait on the CPU to decide what and when it will perform its pitch. As for the work of manipulating RNG...very good job. I think with some of my current TASing, it seems that I can clearly see why so much work had to be done in order to get every pitch done with as little waste as possible. A point that needs to be made on the previously rejected submission...you correctly started the game as the home team in order to pitch first...which saves you the time of having to play the bottom of the 9th. Now that you have the optimization up to snuff, the vault rules allow for this game to be accepted...since it doesn't have a time limit like other sports. Yes vote for getting it right.
I recently discovered that if you haven't reached a level of frustration with TASing any game, then you haven't done your due diligence. ---- SOYZA: Are you playing a game? NYMX: I'm not playing a game, I'm TASing. SOYZA: Oh...so its not a game...Its for real? ---- Anybody got a Quantum computer I can borrow for 20 minutes? Nevermind...eien's 64 core machine will do. :) ---- BOTing will be the end of all games. --NYMX
Samsara
She/They
Senior Judge, Site Admin, Expert player (2108)
Joined: 11/13/2006
Posts: 2821
Location: Northern California
I choose the Dodgers for no particular reason. (...) The A's are the fixed CPU opponent.
No vote. Reject this. Worst run on the site.
...these two awful teams...
Yes vote. Star this. Best run on the site. No I'm not a Giants fan what makes you think that ...Having played this, I completely understand how much of a pain in the ass it is to make it do what you want, and I applaud you for looking so deeply into testing many different patterns. Excellent work.
TASvideos Admin and acting Senior Judge 💙 Currently unable to dedicate a lot of time to the site, taking care of family. Now infrequently posting on Bluesky
warmCabin wrote:
You shouldn't need a degree in computer science to get into this hobby.
xxezrabxxx
He/Him
Joined: 7/15/2017
Posts: 199
Location: Kentucky
It's cool to see a Baseball TAS, very impressive with RNG Manipulation. Yes vote
I like to comment on submissions and look around the site. You have probably seen me before (if you have been around for a while) either on the site, Discord, or any other social media. I recently took up making temporary encodes for new submissions. Also, I never forget to greet Tompa wherever I find him! "when resyncing stuff sucks it's called Resuccing" - EZGames69 “If an emulator stops being accepted to the site it should be called an emuLAMEr” - EZGames69 "oh no discord, everything I say will now be logged forever, sdfsdf, time to hide" - Masterjun "just had to give therapy to a taxi with daddy issues" - psx Current Projects: Mother 3 (75% complete)
Post subject: Movie published
TASVideoAgent
They/Them
Moderator
Joined: 8/3/2004
Posts: 15542
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. ---- [4258] NES Baseball by tormented in 08:11.06