Super Mario Slugger CPU Fantasy League ML Predictor
The best thing that happened recently was that I found out my friends are equally as nerdy as me and wanted to run a CPU Mario Sluggers (Baseball) “Fantasy” League. The worst thing that happened to me recently was getting hyperfixated on making a ML program to determine who would win a match. The way this works is that each real life player has drafted a team of 9 players (Which can be traded later). During the match, both players determine what stadium they’ll be playing a 9 inning game on. Once a stadium is selected, both teams will determine their batting order and fielding positions. Once that’s all done, a match with CPU’s takes place with the players only controlling fielding position changes. This program aims to predict which team would win a game if a player inputs all the characters, lineups, stadiums, and positions.
What is Mario Super Sluggers?
Mario Super Sluggers was a Wii game released in 2008… with Mario characters… made by Nintendo… Some might just read that and think “Ok, cool, seems simple enough”; others would realize what that actually means. Mostly everyone has played a nintendo party game, but there are those who realize how needlessly deep those games can be. I can go on and reference Smash Bros. as a series, or maybe even Mario Kart, but for now I will focus on explaining the mechanics that matter to this project and how it made stuff too complicated for its own good.
Synergy / Chemistry
Characters in this game have chemistry with certain other characters. Either it’s neutral, positive, or negative. This is determined by lore or even cool obscure references. For example, Mario has good chemistry with his brother Luigi, neutral chemistry with Donkey Kong, but bad chemistry with Bowser. So what purpose does this system serve? It matters in these circumstances:
- If a character is batting and the next batter has synergy, the current batter pulls an item.
- The current batter gets a 10% hitting power buff for every good chemistry teammate they have on a plate
- Outfielders can throw each other in the air to steal a homerun if they have chemistry.
- Fielders can dive a ball and pass it to a “buddy” (Which I will now be using to refer to people who have good chemistry with one another) and the receiver of the ball gets a buff on throwing speed.
- Buddies throw each other the ball faster.
- People with negative synergy with each other will have worse aim. This doesn’t mean they now have a chance of not catching it, but let’s look at an example to illustrate this mechanic: If Mario (Center field) threw Bowser (First base) the ball, Bowser would have to leave the plate to catch the ball, and return back to plate.
As you can see, there are multiple benefits to having a team with good chemistry, this fundamentally changes the game and makes this a more complicated project than doing this for a typical baseball game here.
Stats
Each character is shown with four stats when you highlight over them during character selection:
- Batting Power
- Pitching stat
- Fielding Stat
- Running Stat
Ok four is not that bad, is what I would say if it was actually just four stats. Sadly since this is a Nintendo game, there are way more stats under the hood, such as curve trajectory, pitch speed, trajectory angle, stamina, etc. Wait, I just said there are hidden stats and referenced pitch speed right after mentioning the a pitching stat is shown? Yeah, here’s the thing, only Batting Power and Running are objective stats. Both the pitching stat and fielding stat are thought out to be predictions by the devs on how good they’d be at fielding or pitching. An obscure fact about this game’s community is that before they dug into the game’s code, it was widely thought that the fielding stat correlated to how likely they won’t bobble the ball while fielding… apparently it’s completely unrelated!
Items
As mentioned earlier, items exist in this game, but they only come into play when a batter is buddies with the next batter. The items are randomized from 6 options and it doesn’t really matter that nowhere in the datasheet did I include items; however, the program will know who was given an item during batting.
Star Power
There’s a resource in this game that both Pitchers and Batters can utilize called “Star Power”. Every character has a “Star Swing” and a “Star Pitch” that uses this resource. Before I go deeper with this subject, I need to explain the captain system. There are 12 captains in the game, with the rest being normal characters. Each player must choose ONE captain to represent their team before they pick anyone else. After players select their captain, the other captains can then be chosen. So why did I decide to explain this here in the star power category? It’s because the 12 captains have unique star pitches and swings. An example of a Captain pitch is Bowser Jr.’s pitch blocking the screen with paint, or Luigi’s being a tornado that goes from side to side. The non-unique star abilities are just a super buffed version of a type of pitch/hit (Super curve ball, linedrive, etc). The last thing that I need to emphasize, each star ability costs 1 resource unit (out of a max of 5) UNLESS the character is a Captain character that was not selected as their first character, otherwise it would be 2 resource units.
Stadiums
There are several stadiums in the game that can both be played at day or night, with the time of day actually mattering. Stadiums have varying sizes and even different hazards, with the hazards changing depending on what time of day it is. I go in depth about this during the actual writeup of the project.
Possible Issues
Default CPU behaviour
The default CPUs are…. incredibly unbalanced… some characters that would get use in actual play by actual humans rely on mechanics that CPUs simply just do not use anywhere near as often. An example would be toadette, which the game advertises as a steal demon (I can not vouch for this personally, but she does have insane speed), but CPUs rarely steal, you’d be lucky if you see two steal attempts in a 9 inning game. To resolve this, we used a gecko code which edits characters’ stats specifically for CPU leagues. While this isn’t an issue for this project, it does affect anyone who would like to run this program at home and isn’t using the CPU balancing gecko code.
We had to record stuff???
So everyone knows that ML programs train on data, while yes I do have the data stating which characters were on what team, the scores, and stadium… My friends did not record their exact batting lineups and defense positions. Yeah for most of the league it looked similar, but there have been some slight adjustments to take into account the enemy team and stadium. For each record that didn’t have the lineups recorded, I will be using the “average” lineup they used. Kind of a footnote at this point, but each team picks 9 players, those players will always have to be on the field, there are no substitutes and there is no bench.
We had to record stuff??? Pt. 2
I sadly do not have the mental capacity to either record mid-game swaps or actually implement that in the dataset. So there might be some games that were only won because they changed player positions later on.
Black Box game / missing stats???
There is a lot about this game that isn’t revealed to the player, such as certain stats only being viewable when inspecting the game’s source code. There are still some stats and mechanics that aren’t fully known to us. I don’t think this will matter that much, but it would have been nice to have. I also forgot to include certain features such as if they’re female characters (I swear this matters in just ONE super specific scenario) or if they have wings (Which makes them immune to one item and one star swing)… yeah there’s a lot of weird interactions that made this project all the more fun to undergo.
Future Improvements because I am lazy
There’s a star player mechanic that you can activate on each character during a match to give them buffs, my league decided to implement this mid-season and I am too lazy to retroactively add this to the feature extractor (It only gives a 10% buff so it’s not that impactful in the grand scheme of things). More TBD
This is a project currently being worked on whenever I can. I have implemented the feature extraction part of this project. I have yet to fill the datasheet with games that have been played, I will update this post as I go