Jump to content
NHL'94 Forums

Recommended Posts

Posted

Centers, wingers, and defensemen have specific offensive and defensive assignments, depending on where the puck is, and what team is in possession of it. In normal play, the skaters will cycle through these two assignments. But, there are special assignments for certain cases (scoring a goal, winning the finals and holding the cup, receiving a pass, in a faceoff, on a breakaway, etc.). These are temporary assignments, and once complete, will switch the player back to the offense/defense cycle.

It should be noted that a joypad controlled skater does not get assignments. 

assnearest - Player closest to the puck

One such assignment is labeled "assnearest", which in the 92 source code is described as " a special assignment used for the player who is nearest the puck but doesn't have it".

- Team playing defense will always have a player in the assnearest assignment.

- Team playing offense (puck carrier's team) will not have one. (Technically, the puck carrier gets this assignment for breakaway testing and exits it before doing anything).

- When the puck is loose (including during a pass or shot), both teams will have a player with the assignment.

 

What's special about this assignment?

- The only AI controlled players that can check in the game are defensemen in their defense assignment (assdefd) and players in the assnearest assignment

- The assignment uses Offensive Awareness as a timer. And since part of the assignment is determining who is the closest to the puck, the Awareness timer will affect other players on their team (Low awareness = more time before switching the assignment to a player who is closer to the puck)

- When the puck is located in the "slot", there are special effects: the OfA timer is divided in half, the player will have a chance to get a +6 or +8 to their Spd value (which is equivalent to a +1.2 or +1.6 to their Spd attribute, not to exceed max 6 attribute), and the player may also get their Chk value doubled (not exceeding the max)

- There is another timer that is set based on certain conditions (player location to the puck, PP/PK, Chk rating and RNG)

- The assignment is also used to jump off to others (breakaway, puck carrier). The player will stay in this assignment until it exits it by jumping out, or if it switches it to another player who is closer to the puck.

 

Reminder, the game considers the slot the shaded area below:

Slot.png

 

The assignment routine will take a few different paths depending on conditions. The beginning is always the same. This mostly is for making changes if the assnearest player is currently the puck carrier. It will check conditions for a breakaway, and will change the assignment to assbreakaway if needed (which is just used to check if the breakaway is still good). It will make the changes needed for breakaway (set the flags, add 1 to the team's breakaway attempts, boost the crowd level).

Side note - There is no longer a breakaway if the breakaway player loses the puck, their Y velocity is 0 (they've stopped skating), or their Y velocity is less than their Y position (meaning they are not moving forward towards the net). Shoutout to @kingraph for finding this.

If this is a new assignment (player was just assigned this, first run through), there are 2 timers that are set to 0 (Awareness timer and a temporary timer).

If the player is the puck carrier:

The player will switch to the puck carrier assignment (asspuckc). The puck carrier will actually switch between the asspuckc and assnearest assignments until something else changes, as assnearest tests for breakaways.

 

If the player is not the puck carrier:

The number of frames that passed since last time through (usually 1 frame) is subtracted from the OfA timer (if this is a "new" assignment, the timer is set to 0 before this step).

If the OfA timer is 0 or less:

  • Reset the timer: 
    Awareness attributes are between 0-6
    
    Assuming no bonuses:
    
    0 OfA = 15 frame timer
    1 OfA = 14 frame timer
    2 OfA = 12 frame timer
    3 OfA = 11 frame timer
    4 OfA = 10 frame timer
    5 OfA = 9 frame timer
    6 OfA = 7 frame timer
  • If the goalie on the player's team is pulled, or if the crowd meter is currently broken, 1 is subtracted from the timer
  • Check if the puckc slot flag is set. This is set when the puck carrier is in the offensive slot area. If they are not, or if there is no puck carrier, the flag is not set 
    • If the flag is set, divide the timer by 2
  • Check if the puck carrier is on the same team as the player. If so, it will assign assnearest to the puck carrier, and end assnearest for the current player. If the puck is loose, or opposite team possession, continue
  • Check if the current player is still the closest to the puck. If not, change the assignment of the player who is to assnearest, and end this assignment for the current player. Note, it will ignore a player who is assigned to receive a pass
  • After this, there is a timer that is set that will be used later (this timer is initially set to 0 if a new assignment). Let's call it the decision timer. This gets a little complicated:
    • - There's a multiplier used for this calc. It starts with a value of 2.
      
      - First, it checks if the player is within a 20 pixel radius of the puck.
      	- If inside the radius, subtract 2 from the multiplier (would be 0 now). If the player is a D, and is inside the 20 pixel 
      		radius, it skips the rest of the timer calc.
      	- If outside the radius, the multiplier stays at 2, regardless if F or D. 
      
      - Check if there is currently a PP (doesn't matter which team)
      	- If not, move to next step (Timer Calculation).
      	- If there is, check if the player is on a PK. 
      		- If so, subtract 2 from the multiplier.
      		- If they are on the PP, add 2 to the multiplier.
      
      Timer Calculation:
      	- 40 decmial to start
      	- Subtract player's Chk value (0-30)
      	- Use the multiplier as a shift of the result (2 would be mult. by 4, 4 would be mult. by 16, -2 would be divide by 4)
      	- RNG the result
      	- Compare it to 2. If higher than 2, do not change the timer. If 2 or less, set the timer to 240.

       

The decision timer works like this - If the timer is not zero, or if there is no puck carrier, the player will skate to the puck, and along the way, look for checking opportunities (high Chk = more likely to check players). If the timer is zero, they will skate to a spot and get some attribute boosts depending on where the puck is. I'll give a brief explanation down below.

 

If the OfA timer is not zero (or if it was just reset): 

  • Puck is loose (no puck carrier):  Skate to the puck, look for checking opportunities along the way
  • There is a puck carrier (player is playing defense)Subtract # of frames passed since last time checked (usually 1 frame) from the decision timer.
    • If the Decision Timer is not 0the player will just skate to the puck carrier and look for checking opportunities. 
    • Decision timer is 0: The player will skate to a location keeping themselves halfway between their crease and the puck in Y, and halfway between the puck and center ice in X.
      • If the puck carrier is in the slot area: 
        • The player will get a boost in Spd (a +6 to their Spd value, equal to +1.2 on their Spd attribute), and can also get an extra +2 to their Spd value (+0.4 to their Spd attribute) if the crowd meter is currently broken. This is checked to make sure it doesn't exceed 30 Spd value (6 attribute), if it does, set to max. Boost is only if puck carrier is in the slot. It's a way to "catch up" to the play if they are farther away.
        • If the player is out of the play (the puck carrier is between them and the back of their defensive zone in Y, or they are in between the puck carrier and the back of the zone in Y, but farther than 15 pixels away in X), they will just continue to skate to their spot
        • If they are "in the play" (between the puck carrier and back of zone in Y, within 15 pixels in X), the player gets a double Chk value boost and will look to check 
      • If the puck carrier is not in the slot: The player doesn't get the Spd and Chk boosts, but they will still look for checking opportunities while skating to their spot.

 

Recap

  • The only AI-controlled players who can check are those players who have the assdefd or the assnearest assignment
  • The team that has puck possession will not have a player with the assnearest assignment (other than when checking if there is a breakaway, and switching to the asspuckc assignment)
  • If the puck is loose, both teams will have a player with the assnearest assignment
  • Offensive Awareness is used as the timer
  • The assignment will check and see if it needs to switch to a different player, depending on who is closest to the puck
  • Higher Chk value = more likely to initiate a check
  • When the puck is loose, both players will skate to the puck, looking for checking opportunities along the way
  • Decision timer is used by a player playing defense (other team has puck)
    • When the timer is reset, it is set for 240 frames (4 real-time seconds), and it decrements every frame
    • If the timer is not 0, the player will skate to the puck
    • If the timer is 0, the player will skate to a spot, halfway between the crease and the puck carrier in Y, and halfway between the puck and center ice in X
      • If the puck carrier is in the slot:
        • The player will get a huge boost in Spd (a +6 bonus, equivalent to a +1.2 to their Spd attribute, not to exceed max)
        • If the player is "out of the play" (the puck carrier is closer to the net than they are), they will just continue skating to their spot, not looking to check
        • If the player is "in the play" (between net and the puck carrier), the player will get a double Chk bonus (not to exceed the max) and look to check
      • If the puck carrier is outside the slot:
        • They will skate to their spot, and look to check along the way
    • The timer is checked to see if it will reset every time the OfA timer is up. The odds of a reset:
      • If the player has high Chk rating, they have a greater chance of a reset
      • If the player is on the PK, they have a greater chance of a reset
      • If the player is a defensemen, and close to the puck carrier (within 20 pixels), they will not reset
      • The timer never resets by itself. So it can count down to 0 and stay there until it is reset, unlike the other timers like the awareness ones

 

Examples

The puck is deep in the offensive player's zone here. The 2 wingers playing defense (for Ottawa), are close to the puck carrier. 

 

assnearest-1.gif

Watch the RW of Ottawa. He gets switched to assnearest as the LW skates back into the neutral zone. At first, he does a stutter. When he originally switches to assnearest, his Decision timer is 0. , So he acts as if he is going to skate back to a halfway spot between the puck carrier and the crease. Then, he turns around, and skates to the puck to throw a check. His Decision timer got reset, so now he is getting aggressive with the puck carrier. (no bonuses since puck is outside the slot). The LW is doing his asswingd assignment, where he is skating to the same Y location as the puck, but on his side of the rink. Bob Kudelski's Chk rating is low (2 Chk), but he must have gotten a bad (or good, however you want to look at it) RNG roll on his Decision timer.

 

assnearest-2.gif

 

In this second example, Jamie Baker is considered the closest to the puck. The puck carrier (Cam Neely) is in the slot area, and Baker is between Neely and the back of the zone. Baker is at his position, which is why he isn't skating (halfway between puck carrier and top of crease). So here, if his Decision timer is zero, he would get double Chk rating and the Spd boost. But, notice how long it takes for him to react, and he's not trying to check, he's skating to the puck carrier and poking at the puck (which is what a player will do when they are "skating to the puck"). It looks like although he had the extra Chk boost (which would give him 4 Chk attribute!), he got some bad RNG rolls, and would not try to check, then the Decision timer got reset, and he decided to skate to the puck.

Also, there's a rare moment here. Watch Juneau (LW) move from his zone spot to a new spot. This usually doesn't happen, unless the puck passed over a line (blue line, goal line). There's a small chance of this happening, where the first 7 bits of the frame counter have to equal zero, at the same time the player's awareness timer hits zero (mentioned in the asswingo assignment post).

assnearest-3.gif

In this one, both Neely and Turgeon are skating towards the loose puck, both with assnearest assignment. You'll notice how Turgeon tries to check Neely a few times (but fails). Neely does not try to check because there is no good checking opportunity (he is not facing anyone to check).

 

assnearest-4.gif

 

Here, let's look at Brad Shaw (#4). He is a 2 Spd skater. When Juneau enters the zone on a breakaway, he enters in the slot. Shaw is the nearest defending player. With the puck in the slot, and his Decision timer at 0, he gets a +1.2 to his 2 Spd, useful to catch up to Juneau on this play (he still has 3 Agl which doesn't help him get to speed that quick).

  • Love 1
  • Thanks 1
  • Like 1
  • chaos changed the title to Player Assignments - Nearest to the Puck

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