News:

RIP GoReds

Main Menu

Contact explained

Started by nightwulf, 08/10/04, 02:01:57 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

nightwulf

Ok. Finally I think I've got enough of a grasp on what contact does to try to explain it. This is not an explanation for the faint of heart. Just because I'm way too lazy to convert everything, and explaining this is odd enough as it is, all numbers in this post are hexadecimal.

Any time the batter swings after the pitcher has released the ball, a number of calculations are performed. Once it's been determined that the batter will hit the ball (if the ball is over the plate, if the bat is in range, if the pitch isn't a sinker which is hitting the ground, etc.) the calculations for the hit itself begin.

One number used is the left/right position of the ball on the screen. It's tough to determine the absolute minimum and maximum range of this value without artifically raising curve ability stats for appropriate handed pitchers, but I'm fairly sure this number ranges from $6x-$Ax (that is, somewhere from $60-$6F to $A0-$AF). The higher the number, the further the ball is on the right side of the screen. I'll refer to this number as "ballpos."

The next number used in this calculation is the left/right position of the batter in the box. This number ranges from $78 to $89. The higher the number, the further the batter is toward the right side of the screen. Note that this holds true for both left- and right-handed batters. I'll refer to this number as "batterpos."

These values are used in the following equation:
ballpos - (batterpos - $0C)
It's late, and I can't come up with anything better, so I'm calling this value the "hit index." This is also where I'm not 100% clear on things, but I feel it's accurate enough to report.

EDIT: added the parentheses above

For any successful hit, the hit index will be between $00 and $0F. The more "lined up" the bat is with the ball, the number will fall more towards the middle of the $00-$0F range. If you're barely making contact, the number will fall closer to one edge or the other of the $00-$0F range.

Next, the hit index is used in a lookup table, which is listed below:

         If the hit index is: 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
Then this number is returned: 06 05 04 03 02 01 00 00 00 00 01 02 03 04 05 06


So, the more "lined up" the batter is to hit the ball, the lower the number returned from the lookup table. If the hit index is $06-$09, then zero is returned from this lookup table. This is where what we call "contact" comes into play.

If the number returned from this table is zero, then the hit is calculated with whatever power your batter has. If the number is NOT zero, then the batter's contact is subtracted from his power.

So, it's true that players with lower contact are (generally) better hitters. Players with a low contact will get less of a penalty subtracted from their power on a bad swing.

I'm sure this could be explained more accurately, but this is pretty close. Does this make any damn sense at all?

Nightwulf

fknmclane

Quote from: BDawk on 08/29/12, 07:52:41 AM
I just wiped my ass then smelled the toilet paper.  What's wrong with me? 

Quote from: Kane on 08/22/16, 11:56:48 AM
the dude either has some high float or a mess between the cheeks.

Gantry

It makes sense, though I haven't had the requisite amount of sleep to truly process this...

I'm a bit confused about the lookup table though.  If any non-zero value subtracts contact from your power number, what role do #'s 1-6 play?  It is a multiple of contact or does it correspond to an as-yet-unknown portion of the batting engine?  They put the other #s in there, what do they do?


nightwulf

Quote from: Gantry on 08/10/04, 03:41:53 AM
I'm a bit confused about the lookup table though.  If any non-zero value subtracts contact from your power number, what role do #'s 1-6 play?  It is a multiple of contact or does it correspond to an as-yet-unknown portion of the batting engine?  They put the other #s in there, what do they do?

I'm sure they play a role in determining the characteristics of a successful hit (power, trajectory, etc.). However, since I was really only looking for the use of contact, I kinda stopped there, and didn't really trace the code any further than was necessary to see what the hell contact does.

The bottom line, as far as use of contact is concerned, is that contact is subtracted from power if and only if the "hit index" does not equal zero.

Nightwulf

BeefMaster

Wow - great work, nightwulf!  At last, we have a reason for the contact rating!  As we suspected, though, it isn't very important, as even for the worst hitters, you're not getting a huge amount subtracted from your power.  Also, it's pretty much useless in straight-pitch.
"Nobody in football should be called a genius. A genius is a guy like Norman Einstein." - Joe Theismann

Gantry

#5
QuoteAlso, it's pretty much useless in straight-pitch.

Well, I'm not too sure about this part.  One certain fact about straight pitch is that it is super tough to hit a lefty pitcher with a lefty batter.  The mid-power lefties like Spilman and Wilfong are all but worthless against the Hernandez's of the world and this may provide some insight.  The way a lefty pitcher throws all the way outside on lefty batters, they may get the contract subtraction everytime by virtue of the bat to ball difference...

If that is true, you dip Wilfong's 816 power minus 28 contact to a 788 power against lefties who pitch outside.  That drops him to Dickie Thon level in terms of power.  The other two guys who immediately come to mind as worthless against lefty pitching are Spilman & Blank Morris, who suffer a 24 & 31 point power drop respectively.  The question is does pitching a lefty hitter all the way outside with a lefty pitcher result in the contact penalty?  I bet it does and I also bet nightwulf can find out...

Thoughts?  

BDawk

I just went crosseyed.

ultimate7

Quote from: DÄrky on 11/02/10, 12:04:50 AM
The Raiders are a successful organization

Dryden

That makes some decent sense.  It also reinforces the value of putting the middle of the bat on the ball...

Of course, the next question of interest is to try to figure out what determines ground/fly/line drives.  With that information (if it can somehow be controlled), an optimal pitching/batting strategy can be devised.

Totally impressive work.
dee-nee i love you because
when you're hard up you pawn your
intelligence to buy a drink

fknmclane

Quote from: Gantry on 08/10/04, 07:51:25 AM
QuoteAlso, it's pretty much useless in straight-pitch.

Well, I'm not too sure about this part.  One certain fact about straight pitch is that it is super tough to hit a lefty pitcher with a lefty batter.  The mid-power lefties like Spilman and Wilfong are all but worthless against the Hernandez's of the world and this may provide some insight.  The way a lefty pitcher throws all the way outside on lefty batters, they may get the contract subtraction everytime by virtue of the bat to ball difference...

If that is true, you dip Wilfong's 816 power minus 28 contact to a 788 power against lefties who pitch outside.  That drops him to Dickie Thon level in terms of power.  The other two guys who immediately come to mind as worthless against lefty pitching are Spilman & Blank Morris, who suffer a 24 & 31 point power drop respectively.  The question is does pitching a lefty hitter all the way outside with a lefty pitcher result in the contact penalty?  I bet it does and I also bet nightwulf can find out...

Thoughts?  


Well, if this is true, I'm throwing nothing but heat on the outside corner with a lefty/lefty matchup.
Quote from: BDawk on 08/29/12, 07:52:41 AM
I just wiped my ass then smelled the toilet paper.  What's wrong with me? 

Quote from: Kane on 08/22/16, 11:56:48 AM
the dude either has some high float or a mess between the cheeks.

MarquisEXB

Excellent work Nightwulf! I never even considered that it was in reverse order (low = good) because it would be subtracted from power. You've outdone yourself!

What would I have to pay you to put in NHL 92's fighting into 94? :-D

Mike
Check out my b-ball blog:KnickerBlogger
Also working on a beta Madden92 & NHL 94 editor.

nightwulf

Thanks everyone. I'm glad that made sense, and I'm very happy to finally have an explanation of what contact truly does. I thought I'd throw up some examples to show contact in action.


ballpos= $7B, batterpos= $81
hit index= $7B-($81-$0C)= $7B-$75= $06
lookup table returns 0 for $06; contact is not subtracted


ballpos= $77, batterpos= $80
hit index= $77-($80-$0C)= $77-$74= $03
lookup table returns 3 for $03; contact is subtracted


ballpos= $75, batterpos= $80
hit index= $75-($80-$0C)= $75-$74= $01
lookup table returns 5 for $01; contact is subtracted

As you (hopefully) can see from the pics, the difference is very subtle, but easy enough to notice. If you've got the middle of the bat lined up with the ball, contact never comes into play.

Nightwulf

Gantry

Man, from those pictures would you say if a right-handed pitcher pitched it straight all the way outside to a right-handed pitcher would contact be taken away?  I'd say yes...

Terrible wording I know - is an outside straight pitch going to incur the contact penalty regardless of handedness?

nightwulf

Well, I tested this out. I setup a two-player game with NL batting against Henke of AL (sidearm scares me; just say "no" to Saberhagen). I moved both Henke and the batter as far right as I possibly could, then pitched. I hit the pitch as best I could. Here's the hit index calculated for each batter:

Raines: lefty, who cares
Sandberg: $0C
Santiago: $0C
Dawson: $0B (fouled off), $0C
Davis: $0B
Schmidt: $0C
Gallarraga: $0C
Pedrique: $0C
Sutcliffe: $0C (chose a right-handed pitcher for batting purposes)

So yeah, although that was a pretty short test, it does seem that in the situation you described, contact will always come into play. That said, I hit a home run with Davis with a hit index of $0C (next time up), and he has a relatively high contact of 20.

Nightwulf

nightwulf

#14
While I'm at it, here's how you can play around with "hit indexes" yourself in FCEU. Note that this only works in the Windows version (as the Linux version has no GUI), and was written using the most recent version of FCEU (0.98.10).

- Load your RBI ROM.
- From the menus, NES -> Debugger to bring up the 6502 debugger.
- See the "BreakPoints" section? In the two smaller input boxes on the top right of the section, type "C8A6" (no quotes) in the left-hand box. Underneath that, check the boxes next to "Read" and "PC Same." Now click the "Add" button. You should see "R P $c8a6 - $c8a6" appear in the large box.

Now, play the game normally. Any time you hit the ball, the game will pause. Check the debugger window. The first line of the huge box on the left will look something like this:
"c8a6:  AC 43 01  LDY $0143  @ $0143 = $08"
Whatever you see at the end of that line ($08 in this example) is the "hit index" for that swing.

You can also quickly see the result from the "lookup table" in the next line. Hit the "Step" button once. The top line of the debugger window will now look something like:
"c8a9:  BE 14 9E  LDX $9E14,Y  @ $9E1C = $00"
The end of this line ($00 in this example) is the number returned from the lookup table with your hit index. If this number is $00, contact will not be subtracted from your batter's power.

Edit: oh yeah, then hit "Run" to continue playing. :)

Nightwulf

fknmclane

Quote from: Gantry on 08/10/04, 03:24:39 PM
Man, from those pictures would you say if a right-handed pitcher pitched it straight all the way outside to a right-handed pitcher would contact be taken away?  I'd say yes...

Terrible wording I know - is an outside straight pitch going to incur the contact penalty regardless of handedness?

Gantry, this is what I was getting at with my post.  If it actually takes away power, I'm all for it.  Plus, when it comes down to it, it's a pretty tough pitch to hit...as long as you're mixing it up.
Quote from: BDawk on 08/29/12, 07:52:41 AM
I just wiped my ass then smelled the toilet paper.  What's wrong with me? 

Quote from: Kane on 08/22/16, 11:56:48 AM
the dude either has some high float or a mess between the cheeks.

Big Hath

Bravo!  Impressive work Nightwulf.
Battle not with monsters lest ye become a monster, and if you gaze into the abyss, the abyss gazes also into you.

Attezzobal

Bump...Because I wasn't here for this...

Is there anything new on this topic, any new ideas? Any other tests that were done?

I'm not very computer literate, but was it explained what happens if you "jam" a hitter? If contact is subtracted the same way if you were to hit it with the end of the bat?

Also, if you were moving in the batter's box when you hit the ball (obviously a bit tougher to do on a rom without the fluid movement of an NES) does that subtract contact or does it not matter and it's only about where the bat meets the ball?

Also, stay put in the batter's box? Or move around a bit, which is best?

Good thread, christ almighty, nice work.

Stock

It seems that if the hit index is anywhere from 06 to 09, contact will not come into play.  If the number is anywhere outside of 06 to 09, then contact comes into play.
It looks like (if a player has a contact rating of 20) if a batter gets jammed, hits off the end of the bat or hits the ball just a hair off-center, 20 will always be subtracted from the power number.
It also looks like a ball should never be pitched over the middle of the plate, since as long as you hit the outside corner every time, there is no way possible for a batter to maximize their power by reterning a hit index of 06 to 09.
This still would not come into play if playing the way I usually play though.  I play that the pitcher stands in the middle of the rubber in straight pitch.

Quote from: Gantry on 07/27/12, 12:39:03 PM
I said it once and I'll say it again - stock is smart

PHole717

#19
Quote from: nightwulf on 08/10/04, 03:05:02 PM
Thanks everyone. I'm glad that made sense, and I'm very happy to finally have an explanation of what contact truly does. I thought I'd throw up some examples to show contact in action.


ballpos= $7B, batterpos= $81
hit index= $7B-($81-$0C)= $7B-$75= $06
lookup table returns 0 for $06; contact is not subtracted


ballpos= $77, batterpos= $80
hit index= $77-($80-$0C)= $77-$74= $03
lookup table returns 3 for $03; contact is subtracted


ballpos= $75, batterpos= $80
hit index= $75-($80-$0C)= $75-$74= $01
lookup table returns 5 for $01; contact is subtracted

As you (hopefully) can see from the pics, the difference is very subtle, but easy enough to notice. If you've got the middle of the bat lined up with the ball, contact never comes into play.

Nightwulf

Obviously if Fernando Valenzuela were pitching the pitch would either
1.) Curve out at the last second leaveing Trammel on his ass
2.) Go through his bat because Valenzuela can do anything he wants.

But in all seriousness, You're a very smart man.
Fernando Valenzuela can play every position, including the umpire, and does every night of the week, and nothing can stop him.