Jump to content
NHL'94 Forums

Recommended Posts

Posted

Defensemen have 2 unique assignments - assdefd and assdefo. One for defense, one for offense. These are assigned to CPU defensemen who do not have the puck. One is used when their team is on offense, and the other when their team is playing defense.

Defensemen are a little different compared to the center and wing positions. On offense, the center and the wingers will skate to imaginary boxed areas, with a position inside randomized, which is reset when the puck crosses some markers (blue lines, offensive goal line). On offense, the defensemen will actually react to the puck location and move inside their imaginary box in a specific fashion.

On defense, the wingers and centers also skate to specific areas, and react to the puck location accordingly. Defensemen will do the same, but they have some added functions depending on certain situations.

The main difference in these assignments is the use of Offensive Awareness. The center and wingers do not use offensive awareness in their normal offense and defense routines. The defensemen will use Offensive Awareness as the offensive assignment timer, and use Defensive Awareness as their defensive timer. When the timer is up, the code will reload the timer, and do some checks to see if the assignment needs to be changed.

 

assdefo - Defenseman on offense

 

When another player on their team has the puck in the offensive zone, the defensemen will be in the assdefo assignment (switching to this assignment depends on the DfA of the defensemen, since this is used as the timer for the assdefd assignment).

DefO.png

When the puck is in the offensive zone, the LD and RD will skate to the yellow line and will move back and forth across that line depending on the X position of the puck. When the puck is on their side of the offensive zone, the defenseman will match their X position with the X position of the puck. When the puck is on the opposite side of the zone, the defenseman will skate between the black mark on their side the center of the rink in X (if the puck is on the right side board in this photo, the LD will be close to the center of the rink in X).

GIF included:
DefO.gif

Notice how when the puck first crosses the center of the ice, Bourque (RD here) goes to skate back towards where the black square would be. This has to do with the skateto routine, which will be covered in another post. To make the game more realistic in a way, players can only change where they skate to every 12 frames or so. At first, when the puck crosses the center, he's told to skate to where the black square is. He won't change his destination until 12 frames or so later. Also, you'll see Sweeney (LD) do the same as he starts skating away from the puck, then when it crosses the center, he initially will skate to where the puck was when it first crossed.

Also, on offense, there is a secondary skating routine which is used to avoid the puck carrier on your team. So if you skate towards a defenseman while carrying the puck, he will skate away from his positioning to try and avoid you.

It's important to note that if the puck is not in the offensive zone, the defensemen will go back to their defensive assignment.

 

assdefd - Defenseman on defense

 This assignment is used whenever the puck is outside the offensive zone, regardless if the team has the puck or not. It's a lot more complicated than assdefo.

DfA is used for the timer here. When the timer is up, the assignment code will determine the new location for the defenseman to skate to.

The code will check for the closest opposing player to the defensive zone in the Y direction. It uses their position and accounts for the player's velocity (so the defenseman isn't lagging behind). If it determines that the player will end up inside the area between the top face-off circle hash and the back boards, they will position themselves in the low slot. If it determines they are outside that area, the defenseman will skate to their Y position. So a player outside of that area, who is not skating or skating very slow (low velocity), the defensman will skate to a spot 50 pixels behind them in Y. Again, this is reacting to skaters who are skating to a spot closest to their defensive zone, not technically the puck carrier.

They will position themselves 65 pixels away from center ice in X. If the puck is opposite side of center in X, they will move to center X (middle of slot). This is regardless if the puck is in their team's possession or not.

Here's a few GIFs, and there are important notes to the FLA defensemen's movements here:

DefD-1.gif

Now, the closest player to the zone, is the LW. The puck is currently on the left side of the rink. The RD of FLA is staying near center ice, while the LD positions themselves 65 pixels away from center (outside zone face-off dots). They only stay put for a short time, and you'll notice them skating back and forth. Why? Right now, BOS LW, C, and RW have no Y velocity (they are not skating). But let's look at the BOS defensemen, who right now are reacting to the player posing the most "threat" to their zone:

DefD-2.gif

Ray and Sweeney are reacting to the FLA LW and C, who are in turn reacting to the puck carrier (switching off to assnearest, the opposite team's player closest to the puck carrier). With the BOS D skating towards center ice, the FLA defensemen are reacting to their skating over the BOS LW, since they are skating towards their defensive zone. So, you get this kind of feedback on defense.

 

Defenseman low in the slot, guarding a player below the face-off hashes:

Def-Low.png

 

When the DfA timer is up, it sets the position to skate to (described above). When the timer is running, the defenseman will continue to skate to that position, while also looking for a "good checking opportunity", where it uses their Chk rating and some RNG to determine if it should look for a check. This is specific to assdefd and assnearest assignments. I'll describe this in another post.

 

  • Love 6
Posted (edited)

Wow. This is interesting. I recently updated the formula for how a player decides to make a pass, but this is an order of magnitude more complex. I think I’m going to need this. Actually, question: do the D-men react to the actual blue lines in the code, or flags, or are manual co-ordinates set?

Edited by AdamCatalyst
Posted
On 3/2/2025 at 1:16 PM, AdamCatalyst said:

Wow. This is interesting. I recently updated the formula for how a player decides to make a pass, but this is an order of magnitude more complex. I think I’m going to need this. Actually, question: do the D-men react to the actual blue lines in the code, or flags, or are manual co-ordinates set?

They are reacting to where the puck is relative to specific Y values, which are the Y positions of the blue lines

  • Thanks 1
Posted

Thanks! When I looked at the Timer code, I interpreted it as taking the players DfA, setting that as the timer, and decrementing with the frame counter. But that would mean that players with a higher DfA were more laggy in updating their defensive positioning. What am I misunderstanding?

Posted
3 hours ago, AdamCatalyst said:

Thanks! When I looked at the Timer code, I interpreted it as taking the players DfA, setting that as the timer, and decrementing with the frame counter. But that would mean that players with a higher DfA were more laggy in updating their defensive positioning. What am I misunderstanding?

 

That's what it does, but OfA and DfA are stored differently than the other attributes.

While most of the other attributes are stored as 0-6 value * 5 + Bonuses, Awareness is different:

AWARENESS CALCULATION

Offensive and Defensive Awareness in-game values are calculated differently, and thus the in-game bonuses have a different effect on them. 

The other attributes that get bonuses are calculated in game as so - Default attribute value (0-6) * 5 + in-game bonuses (ranging from -3 to +4 in some cases)

Offensive Awareness = [30 - ((OfA attribute value * 5) + hot/cold bonus + PP bonus + PK bonus + Team bonus + Comeback bonus) / 2] / 2     (yes, it's confusing, remember PEMDAS)

Defensive Awareness = [30 - ((DfA attribute value * 5)+ hot/cold bonus +  Team bonus) / 2] / 2  

 

All you have to know here, is that the bonuses have a larger effect on players with lower awareness. The lower the awareness, the larger the bonuses make a difference. Players with 5 or 6 Awareness attribute value will not benefit as much from the bonuses as players with 2-4. But, if the bonuses are all positive, a player with a 5 rating may benefit with a small bump. Also, the LOWER the total value here, the higher the actual Awareness of the player (unlike the other attributes, where higher value is better).

For example, a player with 6 Awareness attribute will react twice as fast as a player with 0 Awareness attribute. The timer for a 0 Awareness player is 15 frames (disregarding bonuses), and a player with 6 Awareness will have a timer of 7 frames (disregarding bonuses).

 

Posted

Woah, ok, please help me try to get this right.

The higher the rating, the longer between position checks. BUT, the value used is the opposite of what you would expect… 

Defensive Awareness = [30 - ((DfA attribute value * 5)+ hot/cold bonus +  Team bonus) / 2] / 2  

0 DfA = [30 - ((0 * 5) + 0 + 0 / 2] / 2 = 15

6 DfA = [30 - ((6 * 5) + 0 + 0 / 2] / 2 = 7.5

12 DfA = [30 - ((12 * 5) + 0 + 0 / 2] / 2 = 0

15 DfA = [30 - ((15 * 5) + 0 + 0 / 2] / 2 = -3.75

Therefore, Ratings of 12 or higher would produce the same minimum delay in the calculation?

 

 

Posted
2 hours ago, AdamCatalyst said:

Woah, ok, please help me try to get this right.

The higher the rating, the longer between position checks. BUT, the value used is the opposite of what you would expect… 

Defensive Awareness = [30 - ((DfA attribute value * 5)+ hot/cold bonus +  Team bonus) / 2] / 2  

0 DfA = [30 - ((0 * 5) + 0 + 0 / 2] / 2 = 15

6 DfA = [30 - ((6 * 5) + 0 + 0 / 2] / 2 = 7.5

12 DfA = [30 - ((12 * 5) + 0 + 0 / 2] / 2 = 0

15 DfA = [30 - ((15 * 5) + 0 + 0 / 2] / 2 = -3.75

Therefore, Ratings of 12 or higher would produce the same minimum delay in the calculation?

 

 

Awareness attributes are between 0-6

Assuming no bonuses:

0 DfA = 15 frame timer

1 DfA = 14 frame timer

2 DfA = 12 frame timer

3 DfA = 11 frame timer

4 DfA = 10 frame timer

5 DfA = 9 frame timer

6 DfA = 7 frame timer 

Also, there is a -1 to the timer if the crowd meter record is broken (which is a bug, so it always is broken).

 

This is specific to 94. If you are using a 0-15 hack, I'm not sure how that would work, you'd have to look up how it converts them. 

  • Thanks 1

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.

  • Who's Online   0 Members, 0 Anonymous, 56 Guests (See full list)

    • There are no registered users currently online
×
×
  • Create New...