Wednesday, April 06, 2005

The Math, the Mod, and the Moron

Bugs Bunny pronounces it 'maroon,' obviously.

This isn't about the mod, actually--it's about the math. I know some of you people appreciate math as much as I do, and those of you who don't can skip along to the next post. Here's a hall pass, but don't try to use it for anything but this period.

Do you remember that? In high school, we generally had to have a 'hall pass' to be out and about during class. And we would spent hours trying to impersonate the ridiculous scribbles that the teachers would put on the passes. They signed hall passes like doctors sign prescriptions. I never actually forged one, but it was critically important to be at the ready with the necessary skill.

Some teachers gave out hall passes like they gave out fifty dollar bills. If they handed you one, it was like being knighted. It felt like you should get on your knees so they could touch each of your shoulders with the sacred pink paper.

Then there was Ms. Brown, the drama teacher. Every school had a Ms. Brown, and usually it was the drama teacher. Flamboyant, loud, married four times--and quite fun, really. The rumors of what Ms. Brown did on her free time ran to the sensationally exotic. Illegal diet pills from Mexico? Allegedly. A fifth husband soon? Allegedly. There was rumor of a new scandal daily, and she sailed right through it all, and man, did she ever give out hall passes. At any point during class, at least half the kids in the entire school roaming the halls were her students. She had an enormous, swiping character that she signed as her name, and I can still hear the passes ripping off the pad at the beginning of class. She was a hall pass factory.

When the Hall Gestapo arrived, you'd hold up your pass. They'd look at it, mutter when they saw Ms. Brown's majestic swipe, and wave you along.

So tonight's column is dedicated to Ms. Brown--an anarchist in a pant suit.

Apparently, though, I digress.

The way that player progression works in MVP is through basically two files: progress.big, which contains sub-files governing progression, and rookie.big, which contains sub-files that govern player creation.

For progression, each season there's a roll for each rating to determine if it goes UP/DOWN/SAME. Then there's another roll to determine the amount of the change. A modder can change all of these variables, and we did, to create a more realistic aging pattern. And along with the aging patterns, the variables build the world that creates simulated stats for CPU vs CPU games (which are over 95% of all games during a season).

There's something pretty irresistable about creating a world out of math. I'm just doing it in a very small way, not building a game world from scratch, but it's still satisfying in a way that's hard to explain. It's like taking all these separate mathematical threads that are too weak to do anything by themselves and combining them into one rope that can't be broken.

So the stats looked very nice in version one with the exception of walks. They went down over 20% in twenty years, and after thirty years they had gone down another 5%. It might not be such a big deal--most people wouldn't even notice--but in a mathematical sense, it's discordant. It's wrong. I wanted to impose statistical order on the game world. That's not order.

We wrapped up the mod last week, and the testers went back to civilian life. Just a little joke, but those guys did really bust their asses. We worked very, very hard. But I couldn't get this stupid walks thing out of my mind. It just wouldn't go away. It was a big element of failure in something that was otherwise very successful, and I felt like I'd let all the testers down, because we were a team. They simmed and I balanced. And they simmed everything they were supposed to.

So for the last few days, I've been thinking about this. I went back and looked in rookie.big to see if I had somehow missed the plate discipline file, the rating which directly correlates to walks. The files with ratings distributions have entries that look like this:

Star, Pos, 95-99, 90-94, 85-89, 80-84, 75-79, 70-74, 65-69, 60-64
1, 1B, 0%, 0%, 0%, 0%, 0%, 5%, 10%, 15%

That’s just a partial line, but that’s how it looks.

So for each position and 'star rating' (1-5), there's a distribution that's used when creating new players each season. There are distributions for contact, for power, for fielding, for baserunning, for discipline--but not for plate discipline.

I looked through all the game directories. Unpacked dozens of .big files in hopes that they had somehow sloppily put the plate discipline distribution inside another file. All I needed to do was change that distribution and walks would be fixed. It would all be fixed.

After looking at the .big files (no luck), I looked at all the .dat files (no luck). I'd looked through nearly a hundred files at this point. Where had they put that *%*$# distribution?

Today I decided there wasn't one. There couldn't be--I'd looked at everything. So I had to ask a new question--if a creation distribution didn't exist for plate discipline, how could there be a rating? And why WOULDN'T there be any definitions to create that rating?

Well, it wouldn't have to be defined it it was derived.

It's said that every time a bell tinkles, a moron gets his wings. Or something like that. That was my bell.

I ran through a player draft with no changes and wrote down the plate discipline rating for the forty catchers in the draft. Then I started changing the distribution for one rating per draft, looking for the rating that would influence plate discipline. The second rating I tried was 'contact,' and as soon as I did, I knew that I'd finally figured it out. Increasing the contract distribution substantially increased plate discipline as well. It wasn't a direct correlation by player, but in aggregate it was very clear.

I tested the other ratings distributions that I could change, but none of them had any effect. So plate discipline was derived from contact, with another variable in the equation that appeared to be random. That part didn't matter, though. What mattered was that I now had a way to influence the plate discipline rating, and that would correspond to increased walks.

And it does. The first version of the mod had 13,164 walks in the twentieth season, over 20% below real Major League totals from 2004. Now I've broken 15,500 after twenty seasons in the last test run. I’m within 5% of real league totals.

Order.

Site Meter