Darrin

nhl 94 algorithms and structure - Look up tables

Recommended Posts

I know there has been discussion in the player ratings forum about how various parts of the player ratings were broken down and weighted. My question in these older EA sports games, were the player attribute ratings implemented via a lookup table structure. So, if there is a breakaway in the third period or any period and I am Jeremy Roenick or Wayne Gretzky , the statistical probability is called upon a lookup table ( to look at the all player attribute info and the goalie info) to pull the probability value of scoring vs the goalie they are facing into the main algorithm. I heard many of these games implemented a pre-computed lookup table, thus eliminating processing time and tons of conditional case and/or if statements. Could anyone shed more light on this?

Thanks!

DK

Share this post


Link to post
Share on other sites

The goalie reacts according to his attributes. If you are controlling Gretz or Roenick, it's up to you to deke him out, using their speed, agility, stick handling, shooting, etc attributes. There isn't a probability you will score. You have to control the game and beat the goalie.

  • The players have base attributes. Gretzky has 4 speed and 6 agility (6 is the maximum for all the attributes except weight and fighting).  Roenick has 5 speed, 5 agility, as well as 5 shooting power and 5 shooting accuracy. Other attributes are offensive awareness and defensive awareness (inputs to the player AI, which I've heard represent basically how far the player can see), endurance (for line changes), passing accuracy..
  • When the game starts, the code reads in those values, multiplies them by 5 to give a value from 0-30, and then applies a little bit of randomness to each one (from -3 to +2). These values are used by the game to control how fast the player moves, how hard their shots are, etc.
  • Depending on if the player is on the home team or away team, some player attributes get additional bonuses/penalties, depending on the home/away rating of the team. I don't remember which attributes are affected.
  • Teams also have powerplay and penalty killing ratings, which affect some player attributes during those game scenarios.
  • Finally, it is suspected, and vaguely confirmed, that there are some other hidden effects, which people on here often refer to as "momentum". Supposedly as the game goes on, it's more likely for goals to be scored. I don't know if this means goalie attributes are reduced, or player attributes are increased, or what.
  • Like 2

Share this post


Link to post
Share on other sites
40 minutes ago, smozoma said:

The goalie reacts according to his attributes. If you are controlling Gretz or Roenick, it's up to you to deke him out, using their speed, agility, stick handling, shooting, etc attributes. There isn't a probability you will score. You have to control the game and beat the goalie.

Seems to me, when a shot is taken that "touches" the goalie, there is definitely a calculations that take into account shooting skill versus saving skill.

That is, puck speed (which was based on initial Shot Power plus a random whiff factor) and especially Shot Accuracy, calculated against Goalie Skill (various attributes).  Sometimes a high Shot Accuracy forward will score on a shot that looks identical to a low shot accuracy shot guy, where the latter does not score.  Similarly, for goalies, shots will bounce off Roy and Eddie like they are made of stone, and sail right through Hrudey and similar crap tenders like they are swiss cheese. Heck, some slappers look like they go through a hole in Hrudey's chest, like he is a donut. :P

Edited by aqualizard

Share this post


Link to post
Share on other sites

As for pre-calculating things, I don't think it is necessary.  It would be a pretty simple formula to calculate things, so I don't think it would be advantage to do it ahead of time. Furthermore, there are quite a few variables, so it would be a ton of pre-calculated stuff which would defeat the purpose. (I could be wrong, or missing something.  I am definitely not an expert in Assembly Language, which is what I know NHL94 and its ancestors were written in.  But I just don't see the calculations taking much time.)

On a weird tangent, when you take a shot that rings of the corner of the post/crossbar, and it hovers there for a split second, and then goes into the net, I have always thought it is like a supercomputer crunching some insane math and it just can't come up with "Is it in, or out?"  (I wonder why it does that. Makes me chuckle.)

 

Edited by aqualizard

Share this post


Link to post
Share on other sites
1 hour ago, aqualizard said:

Seems to me, when a shot is taken that "touches" the goalie, there is definitely a calculations that take into account shooting skill versus saving skill.

That is, puck speed (which was based on initial Shot Power plus a random whiff factor) and especially Shot Accuracy, calculated against Goalie Skill (various attributes).  Sometimes a high Shot Accuracy forward will score on a shot that looks identical to a low shot accuracy shot guy, where the latter does not score.  Similarly, for goalies, shots will bounce off Roy and Eddie like they are made of stone, and sail right through Hrudey and similar crap tenders like they are swiss cheese. Heck, some slappers look like they go through a hole in Hrudey's chest, like he is a donut. :P

Yes, the goalie's ability to catch or handle the puck is also part of their attributes. I was pointing out that it's not a simple probability, like "Gretzky has a 30% chance to score on this shot". The shot will have a speed and accuracy dictated by his attributes, which will put the puck at a certain place at a certain time with a certain speed. The goalie will react according to his own attributes, to try to block/catch/trap the puck, with success dictated by his attributes. It isn't just a lookup table. It's more like a step-by-step physics simulation, but also partially controlled by the player (where did he shoot from, how long did he hold the shoot button, how far did he deke, etc etc)

Think of the game Plinko on The Price Is Right. While yes you can say there is x probability the disc will end up in the $1000 slot, the result isn't decided at the moment you drop the disc. It has to slide on the surface, hit each peg with a 50/50 probability of going right or left each time, etc etc, before the result is known.

Share this post


Link to post
Share on other sites

ok this makes sense, would all these player movements and decisions including the formulas be incorporated into state machines then? or else, it would be seem to be like a ton of conditional statements trying to explain every scenario

Share this post


Link to post
Share on other sites

Well.. when you deke left, the game sets the puck location to the left. The goalie sees that the puck has moved to the left, so his AI probably decides to move a little to that side, too, which it then does.

The game isn't keeping track of "you deked left, and then shot, and your speed was x and your shot power was y" and then does a big calculation and then says "that's going to be a goal".

So it's not even a "state machine" (like a flow chart), instead it's just the state of the game. The puck is here, each player is at whatever location going at whatever whatever speed, etc.

 

(Edit: there may be some state machine stuff in there, like the puck has been shot rather than it's being carried, but stuff like the shooter's shot accuracy or power isn't in there. It's just how fast the puck is going and what direction it's going, which was originally dictated by those values, but they are no longer relevant once the puck leaves the stick.)

Share this post


Link to post
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.