Jump to content

Code more dynamic DL vs OL play (for JSTOUT to look at)


bruddog

Recommended Posts

THe @offsets are the actual offsets with the 10byte header included. I used the original rom.

I wrote over a few defensive sections that based on my sheets are only used in the WR reverse defenses.

Basically what I wanted the code to do is this

40% of the time SET HP to 38

~6% Boost HP 50

~6% BOOST HP 44

...

~6% leave HP as is.

Th percentages are approximate since the randoms don't allow for that much precision. Also I replaceced all the FF AD AA in the defensive section to FF 92 A4

@A4A2 29 C1BF (44% chance jump to SET 38)

@A4A5 2E C5BF (56%*12%=7% jump to boost 50)

@A4A8 2E CCBF ((56-7%)*12.5*=6.1%) jump to boost 44)

@A4AB 2E B0BF (... jump to boost 38)

@A4AE 2D D4BF (... jump to boost 31)

@A4B1 2D D8BF (... jump to boost 25)

@A4B4 2C DCBF (... jump to boost 19)

@A4B7 2B E0BF (... jump to boost 13)

@A4BA 28 E4BF (... jump to boost 06)

@A4BD FF BCAA ( jump to set to grapple then pass rush)

@BFD1 F6 07 FE 23 (Set HP 38 loop forward to jump to FF BC AA)

@BFD5 F7 20 FE 1F (BOOST HP 50 loop forward to jump to FF BC AA)

@BFDC F7 1C FE 18 (BOOST HP 44 loop forward to jump to FF BC AA)

@BFE0 F7 18 FE 14 (BOOST HP 38 loop forward to jump to FF BC AA)

@BFE4 F7 14 FE 10 (BOOST HP 31 loop forward to jump to FF BC AA)

@BFE8 F7 10 FE 0C (BOOST HP 25 loop forward to jump to FF BC AA)

@BFEC F7 0C FE 08 (BOOST HP 19 loop forward to jump to FF BC AA)

@BFF0 F7 08 FE 04 (BOOST HP 13 loop forward to jump to FF BC AA)

@BFF4 F7 04 (BOOST HP 06 )

@BFF6 FF BC AA (jump to set to grapple pass rush)

LEt me know if you see something wrong with this...

Link to comment
Share on other sites

Everything there looks alright. There is a typo on the list at @A4AB 2E B0BF (... jump to boost 38) but that may not exist in your rom. I didn't calculated the random numbers myself but it appears to be a bit off.

I need to look further and possibly code something like your other post to see what works best. But overall, I don't see anything really wrong.

Link to comment
Share on other sites

Yes, that was a typo. I have it correct in the rom.

I realized having something in code would be bad unless it can be restricted to just the front 5 guys (RE NT LE LOLB ROLB) I don't really want middle lbs, cbs and safeties getting boosts/sets one very play.

Everything there looks alright. There is a typo on the list at @A4AB 2E B0BF (... jump to boost 38) but that may not exist in your rom. I didn't calculated the random numbers myself but it appears to be a bit off.

I need to look further and possibly code something like your other post to see what works best. But overall, I don't see anything really wrong.

Link to comment
Share on other sites

  • 4 years later...

I'm trying to figure out how to boost an attribute and then loop back to where the code was if that's possible.


 


I noticed this from the original rom @91b5:  E3 06 FE 0E E3 05 FE 0A E3 04 FE 06 E3 03 FE 02 E2 12 FE.


It seems to me that the boosts are being taken into account and then the player is continuing to play.  Am I mistaken here?  The full string is @9018: 


D4 | C8 3B B0 09 | C8 3F B0 05 | C8 43 B0 02 | C7 47 B0 | D8 F0 D8 | D8 EC D0 | D8 E0 C8 | D8 D4 C8 | D8 CC D0 | E4 [man control] 2B [random?] 38 B8 [jump to 9848] | D8  C4 E0 | D8 C0 F8 | D8 C0 00 | FF 38 B8 ["] E3 07 FE 12 E3 06 FE 0E E3 05 FE 0A E3 04 FE 06 E3 03 FE 02 E2 12 FE


      @9848:  E4 [man control] DF [com control] FE [jump back], I don't know what this means


 


All of the C8 pointers take you someplace along this string:


@904B:  E3 06 FE 0E E3 05 FE 0A E3 04 FE 06 E3 03 FE 02 E2 12 FE


Each of these sequences as an FE 0X command, which takes it (I guess) to FE, which then boosts RP by 12 (E2 12).  Is this correct? 


 


The command C7 47 B0 takes you to 9057:  E3 03 FE 02 E2 12 FE CB.  This seems to be telling the computer to jump forward two spaces to the FE to then kick back to E2 12, no?  I don't know what the CB is doing.


 


But, unless I'm missing something, the computer is boosting and then coming back to its place and continuing.  Am I correct about that?  This doesn't seem to be possible that it could remember the place, but there are plenty of examples where the computer on defense boosts to get to a spot and then probably reduces the boosts in order to not through things off.  I can't follow that using the Defensive Patterns spreadsheet though. 


 


Also, I opened up one of Bruddog's roms with random HP boosts and got this:


 


Defensive code in Bruddog’s defense_hack.nes rom @bd17:  F6 07 FE 23 F7 20 FE 1F FF FF FF F7 1C FE 18 F7 18 FE 14 F7 14 FE 10 F7 10 FE 0C F7 0C FE 08 F7 08 FE 04 F7 04 D8 D4 2C FF BC AA


  • F6 07 is set HP (at 07 skill?)
  • My problem is that FE 23 I think means jump forward 35 (=[2*16]+3, or hexdec[23]) spots, which gets you at 2C, which is in the middle of the string D8 D4 2C (a location code) and before the pursuit pointer (FF BC AA).
    • Same thing is the case for FE 08, which lands in the same spot.

  • Why is one falling “short” and the other isn’t?

 


What I want to do is have the option of boosting whatever I want to boost (and maybe a string) to X (or Y) level using a 2x function and then kick to the original place in the code and have the player continue.  So, there will be times when the assignment is carried out with a boost and times when it's not.  I want this for HP and I'm thinking the player might get interrupted in his path before the HP boost takes hold.  Also, writing a pointer and a kick back (if possible) is less code.  Is this doable?


Link to comment
Share on other sites

@drunken_honkey: 


  1. What do those figures mean? does 0 spaces backwards mean 80 in hex? That's what I'm guessing.
  2. The rest of the code from the CB command in the original rom goes to a d8 command.  The code goes (from 9057):  E3 03 FE 02 E2 12 FE CB | D8 F0 C8 D8 F8 D4 D8 18 D8 D8 30 E8 D8 34 00 FF 32 B8. This is Y, X movement and then stand forever, so the computer is jumping back to something it already knows.
  3. I tried enterin in a CB command for what I wanted on defense and it will only work if you have a C7 pointer for the rush, etc. command, so this seems to be a com/coa command only b/c I'm sure you get no boosts in man play; and it can only be coupled with another C-series command it seems (FF XX XX won't work).
  4. I got the code to 'run' (i.e., do what I said after the jump to where the boosts are), but it's not taking the boosts into account.  They're set at e2 07 and e3 07, but the player is moving at the same speed in both instances.  I entered at a267:  D0C810EC| C76DA2 [com jump to the boost code]| D700C0 [move backwards] | E100E200 [reset boosts] F470 [pause] C718BF [moved pursuit code] FFFFFF | E207E307 [boosts] CB [kick back].  It's kicking back, but the boosts aren't being taken into account, even when in coa mode. The second c7 command (for pursuit) will only work if it's FF.
  5. Above @9018 you have:  D4 C8 3B B0 09 C8 3F B0 05 C8 43 B0 02.  09 + 05 + 02 = 16, so 100%.  Is this necessary to make things function and is that the only way to get the boosts moving?
Edited by quince3800
Link to comment
Share on other sites

 

 

The command C7 47 B0 takes you to 9057:  E3 03 FE 02 E2 12 FE CB.  This seems to be telling the computer to jump forward two spaces to the FE to then kick back to E2 12, no?  I don't know what the CB is doing.

 

No that is incorrect. The CB is telling it how many spaces to loop backwards. 

 

 

 

Also, I opened up one of Bruddog's roms with random HP boosts and got this:

 

Defensive code in Bruddog’s defense_hack.nes rom @bd17:  F6 07 FE 23 F7 20 FE 1F FF FF FF F7 1C FE 18 F7 18 FE 14 F7 14 FE 10 F7 10 FE 0C F7 0C FE 08 F7 08 FE 04 F7 04 D8 D4 2C FF BC AA

  • F6 07 is set HP (at 07 skill?)

My problem is that FE 23 I think means jump forward 35 (=[2*16]+3, or hexdec[23]) spots, which gets you at 2C, which is in the middle of the string D8 D4 2C (a location code) and before the pursuit pointer (FF BC AA).

 

You are counting wrong. You start at the FE command. The FE command location is 0 spaces.so from the example above FE 08....

 

FE= 0 spaces forward

08= 1 space

F7= 2space

08= 3 space

FE= 4space

04= 5 space

F7= 6 space

04= 7 space

D8= 8 space and the start of the move command.

 

 

 

 

Link to comment
Share on other sites

FE CB breaks down like so. The FE code when used at the begining of a command says count next byte. (If used elsewhere it would mean something else: D8 FE 08 would read FE as a X or Y axis) The CB code in this example counts backwards starting with FF FE FD FC etc. To count forward start with 01 02 03 04 etc. So if after a boost you want to jump back up to a code that is 16 bytes back from the boost E2 12 FE F0 would boost the player then jump back 16 bytes starting from the byte following the FE command. If you want and infinate loop FE FE. This would send the code back 1 space... and the loop begins. FE 00 does no jump and countinues following the next byte... hope this helps.

FE xx is a jump to command. The xx will be the count. 80-FF counts back from the xx. 01-7F counts forward.

Example:

00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F = xx

01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 = Count

F0 F1 F2 F3 F4 F5 F6 F7 F8 F9 FA FB FC FD FE FF = xx

16 15 14 13 12 11 10 09 08 07 06 05 04 03 02 01 = Count

Edited by drunken_honkey
Link to comment
Share on other sites

Thank you for the responses. I'm getting it a bit more now.  My questions are:


  1. Why does FE XX mean do backwards on offense, but to go forward on defense?
  2. I can get a c8 command written in, but not read. The computer is simply skipping over it.  I know this b/c doing the boosts with an ff command gets it done clearly.  If c8 then only for offense? b/c it seems clear to me that the QB sneak is randomly jumping to any one of 3 boosts with the c8 commands (I don't know what the c7 is doing) and then coming back to the beginning.  it's just not reading anything for me though.
  3. I can't get multiple boosts going using an ff command.  The code will jump to the boost, take it into account and then pursue.  It won't read the ff command to take it back to movement (which has an boost to 00 before that).  Is that me or something about the game?
Edited by quince3800
Link to comment
Share on other sites

Is it not possible to reset boosts or is there a particular way in which it needs to be done?  I can get the first boost to take with an FF followed by an FE XX (= 80-FF) or an FF pointer (XX XX), but in the example code d7 00 c0 f4 07 e2 00 e3 00 ff 18 bf [moved pursuit code] the player just continues running fast as if the boost were still in effect, which clearly it is.  I'd had the 00 boost before the f4, but the effect is still the same.  What am I not doing?  I don't see why there'd be a 00 (reset) boost option if you can't apply it.


 


Edit:


I figured out most of what I wanted to know.  There is no single location for the boosts; they're each placed in their own location with the appropriate FE XX (80-FF) command for the offensive plays with the c8 XX XX 0x sequences.  This allows them to jump back to the movement command within the individual code string/block belonging to each.


Edited by quince3800
Link to comment
Share on other sites

  • 3 months later...

This is how to set up and Excel equation to allow you to jump forward using FE commands:


  • Take a cell (I'm at U31) and enter the location that the FE sits on (for my example 9EC9).
  • In the cell below (U32) you'll enter the jump hex value (9EC9 reads FE 2F, so you'll enter 2F)
  • In the next cell over on this same row (V32) enter "=hexdec(U32)."  This should yield a value of 47, meaning that 2F is/covers 47 bytes.
  • Now move up one space to the same row as the original hex location (for where the FE command started).  In my example you'll be at W31.  There should be a gap between the 9EC9 and the space in which you want to type (i.e., V31 will be empty, just to make things neat).  In W31 type "=hexdec(U31)," which will convert the location into a numerical value and yield 40649.
  • In the next cell down from that one, in the same column, so (W32, next to V32 where you should have the value of 47 from a previous entry), type "=V32+W31."  This means you're adding the value derived from 2F in the FE 2F sequence (= 47) and the numeric value of the starting position at 9EC9, which came out to 40649 (i.e., what you just did in W31).  The result will be 40696.  This is the numeric value of the 'jumped to' location.
  • Now you will convert this numeric value back into hex by moving to cell X32 and typing "=DECHEX(W32)."  This will yield 9EF8; this is the location of the 'jumped to' call up in this particular FE sequence (FE 2F as called from 9EC9, where you started; that is where the FE was).
  • The above is an offensive location, so converting this new location into a pointer is not difficult (assuming you want to get there via an FF command).  You go to a cell that will call up this new value (which is your 'jumped to' location) and type "=HEXDEC(X32)+8176."  (Let's say this is in X33).  Then move one cell and type "=DECHEX(X33)."  This will give you the value that you need for the offensive pointer values (i.e. location + 1FF0), which in this case is BE E8.  (8176 is the numeric value of 1FF0).  You'll switch those bytes and this is your pointer.

This is really not complicated once you enter it in.  All you have to then do is change the locations and the FE entry/value to figure out the jump.  Also, to find your pointer you can change the location to anything; just change the location and it'll come out whenever you need. 


 


Similary, you can go backwards by reversing the pointer value given in the code (so, for example, 32 B8 B8 32) and then change the command to "=HEXDEC(X##)-8176."  This will give you value in the 9000 range, which you can follow to see what the code is talking about (9842 in this example). 


 


This is just to make things easier.  I don't suppose that people haven't already figured this out, but it's useful in that it saves time.  I'll add counting/jump backwards when I need to know it for myself.


 


Edit:  What I know about going backwards right now is the following:


  • Hexdec(ff) = 255.  I'm toying around in cell E17, so this reads "=HEXDEC(D17)," or one cell to the left.  (D17 reads "ff").
  • Move over one (to F17) and type "=E17-1," which gives you 254.
  • Move over one again (to G17) and type "=255-F17."  The 'answer' is 1.
  • Change the value in D17 to anything and it comes out as what drunken_honkey typed above, but it's on command.  (Be careful because the columns don't line up).  This will allow you to figure out the value that you'll enter in hex to go back X number of values.  You just toy with the D17 value until you get what you want and then place this with the FE.  This really is overly complicated though because it allows you to mess up when you're counting, so I'll deal with this in earnest when I care.
Edited by quince3800
Link to comment
Share on other sites

can we get more examples of FE power?


 


will somebody break this code down?  it is basically code for COM running the ball.  It's from the original rom, but I use it frequently in plays I make because it makes COM run better, in my opinion.  I would like to understand it better.



FCFFE0DFFEFC


Edited by buck
Link to comment
Share on other sites

Isnt FE just a jmp command? The number that follows it either jumps forward or backwards. (00-7F = jump forward / 80-FF jump back) The above FC FF E0 DF FE FC code is a loop. The last part FE FC says jump backwards 4 spots. It loops back to E0.

I dont know what E0 is in TSB. But i think its a boost of some kind. So this code loops the DF (ball control code meaning this is the code that creates the ball carrier) and it loops in the E0 boost then that would be why the com would play better using this code)

Edited by drunken_honkey
Link to comment
Share on other sites

so FC FF E0 = something to do with players on the other team (defense in this case)?


 


DF = "computer take control"


 


FE FC = loop back to DF


 


The effect of this code is that the COM runningback avoids everyone.  He will dodge whoever gets in his way, instead of running straight line.  I have never noticed a "speed boost" per say, but they do "cut better".


 


can the DF be explained better?


 


where I am going with this is that I think this code is neat.  maybe something like this can be used for other parts of the game, like defense, so that a defender will "avoid all blockers" but still chase the ball?


Edited by buck
Link to comment
Share on other sites

Yeah the DF is the universal code for give player the ball.  It makes that player the focus of other coding like the DA, DD, and the mirror codes. Ill look into the E0 coding as i thought it was boost but thinking about it im pretty sure its not. E1-E3 i think do boosting. So it might be that the E0 code is doing a search of some kind. FE FC (04 bytes back) actually goes back to the E0 code then the DF. I know there is a search for area and jstout and i have discussed this before. So it could be E0 is added to create a "smarter" com player. Do you recall which original play use this? It could be helpful to see if thats why this is used sometimes. Ill test it out on our rom and see if i get the same effect. This is interesting if it is doing a search for. Ill keep you informed if i figure something out.

Link to comment
Share on other sites

1. Its looping back to the FC not E0

FC is explained in the play command document. I think its a set to grapple command. Each bit is a player. If the opposing player(s) cant be grappled the player will pass through them. one use of this is to let RBs pass through the o-line on pass plays.

DF= computer take control. this basically means let the computer AI take over the movement of offensive player rather than run scripted commands.

Link to comment
Share on other sites

1. Its looping back to the FC not E0

FC is explained in the play command document. I think its a set to grapple command. Each bit is a player. If the opposing player(s) cant be grappled the player will pass through them. one use of this is to let RBs pass through the o-line on pass plays.

DF= computer take control. this basically means let the computer AI take over the movement of offensive player rather than run scripted commands.

 

all the play command document says about FC is "set to grapple"...which is why I have asked about it in the past, unfortunately with minor response.  but, the FC obviously does something else besides "run through line" or "set to grapple" because in the code I outlined, it makes COM try to run "around" any defender.

 

so now it sounds like FC can be used for all kindsa stuff....run through OL, run as ball carrier, grapple.  what else?

 

 

oh, honkey.  I believe the code is used on the Run 1 offset I RB2 sweep.  you know, sometimes COM cuts back instead of turning the corner like a sweep.

Edited by buck
Link to comment
Share on other sites

THe FC command does not make a player run around a defender its sets which players that player can and can't collide with. 


 


As I said the DF computer take control command is basically the computer is taking over the running of the player. All of the avoidance mechanisms are contiained within that commands code.  The computer will change diections based on a few simple checks that go something like


 


1. Is there a player in front of me I can collide with?


NO- continue moving in current direction


YES- am i near the out of bounds line


       -YES- keep moving forward


       - NO- got to juke check


 


JUKE CHECK- Move towards middle or sideline depending on location of defender. 


Link to comment
Share on other sites

i could use an explanation on the implementation of the FD and FC commands.  I know you always see FC XX YY ZZ with a FE EC (loop) at the end.  but the XX YY ZZ is what I don't totally understand.


 


I know for ZZ, you can use player numbers



30 RE
31 NT
32 LE
33 ROLB
34 RILB
35 LILB
36 LOLB
37 RCB
38 FS
39 LCB
3A SS


and honkey/hurricane wrote these might work for ZZ (at least on TSB3)



DA=Follows ball carrier wherever it goes, blocking any of the other team that gets too close/go afterthe ball(on Defense).
DB=Mirrors ball carrier from distance when code is activated behind the line of scrimmage on offense.
DC=Take off upfield from activated spot blocking any opposing player it runs into.
DD=Follows behind ball carrier wherever it goes, blocking any of the other team that gets too close.
DE=Pitches ball indefinately to the player assigned the DE code, but playe never gets possesion.
DF=Ball control is given to he player with this code (used int the final code of all RB's).


but how exactly does the XX YY (usually FF E0) work?


Edited by buck
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...