Jump to content

NES Improved Grappling Code


jstout

Recommended Posts

Thanks for the quick fix.

How would I modify the code to take the Random presses away from the MAN v MAN segment calculations?

Should I just remove these lines?


A5 3C LDA $003C ; RANDOM NUMBER
29 03 AND #$03 ; Make Random x0-3
18 CLC
71 AE ADC ($AE),Y ; HP/8 + Presses + RANDOM
; and then these lines
A5 3D LDA $003D ; RANDOM NUMBER
29 03 AND #$03 ; Make Random x0-3
18 CLC
71 3E ADC ($3E),Y ; HP/8 + Presses + RANDOM

Would this work if the above lines were omitted?

Link to comment
Share on other sites

How would I modify the code to take the Random presses away from the MAN v MAN segment calculations?

Should I just remove these lines?


A5 3C LDA $003C ; RANDOM NUMBER
29 03 AND #$03 ; Make Random x0-3
18 CLC
71 AE ADC ($AE),Y ; HP/8 + Presses + RANDOM
; and then these lines
A5 3D LDA $003D ; RANDOM NUMBER
29 03 AND #$03 ; Make Random x0-3
18 CLC
71 3E ADC ($3E),Y ; HP/8 + Presses + RANDOM

Would this work if the above lines were omitted?

Yes, that would absolutely work. You can also drop also drop the following 91 AE STA ($AE),Y and 91 3E STA ($3E),Y as they get saved before the random and would be redundant.

Link to comment
Share on other sites

ok, now that I'm getting deep into this, I guess I need to know what you guys mean by 'presses' :D . Is this presses per second? If so, how many presses/second are needed to win a grapple?

this code is going to change the TSB rating system a bit. for the good, I think.

Link to comment
Share on other sites

ok, now that I'm getting deep into this, I guess I need to know what you guys mean by 'presses' :D . Is this presses per second? If so, how many presses/second are needed to win a grapple?

I'm quite glad you are looking into this and can form some ideas and numbers that aren't of my own thoughts.

"Presses" is a count. There is an adjustable time frame that I didn't touch where the default is x40 (this is a time amount of around 3 tecmo seconds). Once the players touch and enter the grapple animation it starts this timer and each time you press the button down on your controller it adds 1 to the presses. When the time ends, the numbers are checked and the players start the animation for the player to be thrown or tackled.

Link to comment
Share on other sites

like bruddog mentioned earlier, what is the default presses & calculations (or probabilities) for 'grappling cpu drones'? knowing and/or setting this will help in determining a HP rating system.

on a side note - maybe a scaled-random 'juice' weeks would be a cool feature for the TSB-season vs. CPU...for example, depending on wins (as a baseline), there is a random offset where the CPU will play at +/- 3 juice levels.

Link to comment
Share on other sites

like bruddog mentioned earlier, what is the default presses & calculations (or probabilities) for 'grappling cpu drones'? knowing and/or setting this will help in determining a HP rating system.

On the original rom the default number for Man vs CPU is at x284F9 and is x02. If the player gets 2 or more presses than the CPU loses the grapple. You can change that up or down to test values.

Link to comment
Share on other sites

sorry, I meant CPU vs CPU grappling drones (like OL vs DL, etc.)

The CPU doesn't do anything even resembling what a man player does. With the CPU vs CPU, it loads the players HP and then determines a path to use Offense Popcorn, Offense Better, Equal Grapple, Defense Better, or Defense Popcorn. On these paths it runs a random number (each path has a different value) and if true throws the other player and if not then continues on until later when it checks for more randoms (I stopped checking around here as there was nothing really worthwhile to see).

The first probabilities for the larger HP are: Popcorn 80% and Better 66% (note they'll generally win later in the next checks)

Link to comment
Share on other sites

I love you guys. You are the smartest guys in the world. I feel people who modify Tecmo will get the game perfect in a year or so. Once that happens, Tecmo (the company) will put out an online TSB with fully editable playbooks and graphics. Why don't they just hire you guys?

Link to comment
Share on other sites

I thought of another question, pretty irrelevant to everything else. What is going on when your WR gets stuck in a grapple with a CPU player indefinitely until another defender runs over and slide tackles you? Even when you give up and stop hitting the button you will keep grappling until another player makes the tackle.

Link to comment
Share on other sites

I thought of another question, pretty irrelevant to everything else. What is going on when your WR gets stuck in a grapple with a CPU player indefinitely until another defender runs over and slide tackles you? Even when you give up and stop hitting the button you will keep grappling until another player makes the tackle.

I think that's usually during a diving catch. I'd say somehow it skips the calculations because the players pop into a grapple so fast and it's like a 0 vs. 0 every time the cpu checks, so they just grapple forever. Something is screwed up with dives because sometimes you'll dive in coverage and when you get up even the computer can throw you.

Link to comment
Share on other sites

How do I alter the code to HP/16 instead of 8? Are the LSRs after the 'LOAD PLAYER HP' doing the dividing? I'd like to try weighting HP a little less.

so to make it divide by 16, would I add another 4A LSR? like this:


A0 1C LDY #$1C
B1 AE LDA ($AE),Y ; LOAD PLAYER HP
4A LSR
4A LSR
4A LSR
4A LSR ;extra divider (HP/16)????
C8 INY
18 CLC
71 AE ADC ($AE),Y ; HP/16 + Presses
91 AE STA ($AE),Y

and repeat in the other relevant portions of the code?

Link to comment
Share on other sites


A0 1C LDY #$1C
B1 AE LDA ($AE),Y ; LOAD PLAYER HP
4A LSR ; DIVIDE BY 2
4A LSR ; DIVIDE BY 4
4A LSR ; DIVIDE BY 8
4A LSR ; -> DIVIDE BY 16
C8 INY
18 CLC
71 AE ADC ($AE),Y ; HP/16 + Presses
91 AE STA ($AE),Y

Yes, that is correct and very good spotting that. What you did will divide it by 16 (HP will range from 0 to 3). Just add in the extra LSR where it is needed in the code and you'll have it setup the way you want.

Link to comment
Share on other sites

What you did will divide it by 16 (HP will range from 0 to 3).

is this the scale? :D


HP /16 /8
6 0 0
13 0 0
19 0 1
25 0 1
31 1 2
38 1 2
44 1 3
50 1 3
56 2 4
63 2 4
69 2 5
75 2 5
81 3 6
88 3 6
94 3 7
100 3 7

And, these are "Extra Presses", right?

Link to comment
Share on other sites

  • 2 months later...

Well, something's wrong with the Man V Man code...I've noticed that no matter what the HPs are for "O and D" Man Players, the Defender will outgrapple the Runner *without even pressing a button*.

That's using this code:

MA	N VS MAN		GRAPPLING:
A0 1C LDY #$1C
B1 AE LDA ($AE),Y
4A LSR
4A LSR
4A LSR
C8 INY
18 CLC
71 AE ADC ($AE),Y
91 AE STA ($AE),Y
A0 1C LDY #$1C
B1 3E LDA ($3E),Y
4A LSR
4A LSR
4A LSR
C8 INY
18 CLC
71 3E ADC ($3E),Y
91 3E STA ($3E),Y
; RETURN T O NORMAL
B1 AE LDA ($3E),Y
60 RTS

I can't see what's wrong with it - but I've done extensive testing and it doesn't work right.

Link to comment
Share on other sites

Let me check your code later when I have time. It looks like you removed the random variable.

Is there any specific situation you can point to for a reference of where you think it goes wrong? It would be possible to not push a button and win if the HP are plenty far apart (QB vs a high HP). For 2 same HP players then the button pusher should win (I'll check that first off).

Link to comment
Share on other sites

I'm talking about MAN V MAN here...and I don't want any random numbers in this.

Is there any specific situation you can point to for a reference of where you think it goes wrong? It would be possible to not push a button and win if the HP are plenty far apart (QB vs a high HP). For 2 same HP players then the button pusher should win (I'll check that first off).

Well, a 25 HP defender wins (with no button pressing) vs an 88 HP running back (pressing buttons). :?

Link to comment
Share on other sites

Buck, check this (I'm not going to be home until evening before I can check the code but I saw):

; RETURN TO NORMAL

B1 AE LDA ($3E),Y *** TYPO so I checked my example rom I made and it was $3E ***

60 RTS

Make it:

; RETURN TO NORMAL

B1 3E LDA ($3E),Y

60 RTS

please try that

Link to comment
Share on other sites

Buck, check this (I'm not going to be home until evening before I can check the code but I saw):

; RETURN TO NORMAL

B1 AE LDA ($3E),Y *** TYPO so I checked my example rom I made and it was $3E ***

60 RTS

Make it:

; RETURN TO NORMAL

B1 3E LDA ($3E),Y

60 RTS

please try that

That seems to be a fix (at least looking at the code)...because the MAN V CPU section of code has the ($3E) too. :?

I will have a chance to try it out MAN V MAN here in a couple of hours. Thanks jstout.

Link to comment
Share on other sites

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...