Jump to content

Messing With The COM Player AI In TSB3


amrush

Recommended Posts

If you're like me, then you can't stand when the COM player makes dumb decisions relative to the score of the game at certain moments.

The most annoying dumb moves have to be:

- COM not punting early in the 4th quarter down by as little as 7 points and deep in his own territory

- COM onside kickoffs early in the 4th quarter down by as little as 7 points

- COM calling fake punts and FGs far more often than in the real NFL

- COM going for 2 when down by 14 or 21 before the 4th quarter (or in any other situation where the obvious choice is to kick the PAT)

In tooling around Knobbe the one area of hacking that nobody has ever touched is COM AI relative to field position or score. For TSB3 I'm as dumb as the COM player, because I think I can hack the COM AI. And I've never studied asm.

So anyways, after almost 2 days of nonstop hex crunching, here's my first breakthrough...

x3D2FA - COM Player PAT (or 2Pt Conv) Bypass

In the original rom, the value of these two bytes is 90 25

If you change the 1st byte to 80, a COM opponent will never go for 2 points - either against you or another COM opponent.

If you change both bytes to 80 23, a COM opponent will never kick the PAT - either against you or another COM opponent.

For those of you that create single-season (non-AFL) TSB3 roms prior to 1994, the 80 25 value at this address allows you to prevent the COM player from ever attempting the 2 pointer.

Of course, this is really just the first step in understanding how to tweak the COM player's logic on when it goes for 2 points. That logic immediately follows this bypass address, but I haven't figured it out yet. But I'm getting there...

Future findings for the COM AI will land in this thread.

AM Rush

Link to comment
Share on other sites

Is there a way to reduce the effectiveness of HP without changing the attributes? I like the fact that TSB3 made HP matter, but I think it made it matter too much. A toned down rom would be awesome.

Yeah there's an old discussion about HP somewhere in this forum. I think it's a thread with "Player Attributes" in the title... could be wrong...

AM Rush

Link to comment
Share on other sites

So I've successfully hacked out the COM player's logic for 2 point conversions. I have a couple bugs to hammer out, but should be done by tonite. The original logic had the COM player going thru a series of value checks, where the gamescore and some other factors that I couldn't decisively determine (but are almost certainly quarter- and time remaining-related) add up to a complex singular hex value that the code brings in from elsewhere in the rom or the sram or save state. It then compares that value against a chart of values that represent probabilities, located at x3D340-x3D349.

Rather than kill a lot more time to try to decipher that singular hex value, I decided to replace the logic with a crude logic asembly of my own. Amazingly enough, it works. Here's the basics:

- In the first three quarters of any game the COM player will always kick a PAT no matter how far ahead or behind the COM player's score is. This rule can be relatively easily modified by someone that understands asm better than I do.

- In the 4th quarter, if the COM player is trailing after scoring a TD, it will kick a PAT unless it's trailing by 2, 5, 10, 13 or 18 points. In those instances it will always go for two.

- In the 4th quarter, if the COM player is leading after scoring a TD, it will kick a PAT unless it's leading by 1, 5 or 12 points. In those instances it will always go for two. This is significant because in the rom's original logic, the COM player never goes for two points when it's leading or tied after scoring a TD. The original code never allows it to happen.

I haven't made an IPS patch in at least 5 years, so if anyone is interested in seeing the logic I used I should probably pass a copy of the rom along to one of the asm experts here and have them IPS the section I hacked and make it available here. I've seen some of the conversations here about trying to implement a 2 pointer in the NES version. I'm happy to help out the experts with anything they can use from my experience on the SNES side with this issue.

AM Rush

Link to comment
Share on other sites

After another long day of hacking, I isolated the 2 sections of code that tell the COM player to fake a punt or a FG/PAT. Strangely, each section is player-based, not activity-based.

Player 1 - x1636D-16384

Player 2 - x1647F-16496

In other words, I couldn't find a way that the code's logic separates out the probability of a fake punt from a fake FG/PAT. It lumps the COM player's decision to fake for all 3 instances into this one section of code.

For example, if you change the first 3 bytes of the section for player 1 above (starting at x1636D) from

AD 56 1D

to

EA A9 80

then the COM player will fake every punt, FG and PAT attempt it makes. When it's Player 1, of course. It'll switch to Player 2 at the start of the next quarter and stop running fakes, if you leave the other section alone. So you have to change both sections if you want the COM player to always fake or never fake.

As with the 2 pt conversion code, I didn't really dive into how it arrives at the variable that decides the odds whether a COM player will fake or not, or whether the COM will fake run or fake pass. I only isolated where that info is and how to bypass it. Since in the real NFL, coaches call these plays an average of less than 10 times per year, I don't really care if that functionality isn't in my rom. But at least now the variable can be changed when I feel like learning how to change it....

AM Rush

Link to comment
Share on other sites

Yesterday I hacked extensively into the COM player's AI logic for when to onside kick. The byte sequence for this activity begins here:

x26FBD

The COM player will run through a series of checks involving quarter / OT and minutes left if it's the 4th Q. It will then run one of three sections of code starting at one of the following addresses:

x26FDD - Regular kickoff

x26FD3 - Onside kickoff

x27006 - Either kickoff based on a complex situational formula

I tried modifying the series of checks but didn't get all my mods to work properly. But the addresses are there and can be easily bypassed, as with the 2 pt conversion code.

AM Rush

Link to comment
Share on other sites

  • 8 months later...
  • 9 years later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...