Engine Basics
Posted: Fri Nov 06, 2015 11:51 am
Okay, as discussed on Skype this morning, let's try to lay down some guidelines as to what it would take to "roll our own" sim league engine, as well as the kind of things we want to track.
Having taken a couple of stabs at building a sim engine myself in the past, here is what I personally think the best strategy to build is (and also lets us capture the most data):
1. The "basic unit of gameplay" is a "touch." A "touch" ends in one of the following outcomes:
a. Field Goal Attempt (may include defensive and-1 foul)
b. Defensive Foul
c. Turnover (includes offensive fouls)
d. End of Period
e. Pass
2. A "possession" as we generally understand it in basketball is then a "touch" that ends in anything but a pass, and also contains all touches preceding it that ended in a pass.
3. A "touch" should probably track the following:
a. Player with the ball
b. Primary defender against player with ball
c. Player who had the ball on the previous touch (e.g., potential assist man)
d. Location on floor where touch takes place (see http://www.82games.com/locations.htm as a start)
e. Secondary defenders (if any, i.e., secondary shot blockers)
f. All ten players on the floor (tracks +/-)
g. Time elapsed on this possession (how deep into the 24-second clock)
h. Time remaining and point differential (lets us track "clutch performance" etc.)
i. Offensive gameplan
j. Defensive gameplan
4. I suggest player ratings be simple, "direct" ratings that affect:
Offense:
a. How likely a player is to create a shot during a touch (may have multiple ratings, e.g., inside, slashing, spot-up, etc. and may need multiple ratings to decide what kind of shot the player is likely to try to create)
b. How likely a player is to make a shot (may have multiple ratings based on floor location)
c. How likely a player is to draw a shooting foul
d. How likely a player is to draw a non-shooting foul
e. How likely the player is to commit an offensive foul
f. How likely the player is to allow a steal of the dribble ("handles")
g. How likely the player is to commit an unforced turnover (e.g., bad pass, travel)
h. How likely the player is to create a better touch for another player (i.e., good pass)
i. How likely a player is to "Get open" (e.g., Reggie Miller running off screens) when someone else is using a touch
j. How likely a player is to "help others get open" (e.g., set a pick) when someone else is using a touch
k. How likely the player is to allow a steal on a pass ("court vision")
l. How likely the player is to have his shot blocked/avoid a potential block
Defense:
a. How likely a player is to keep the offensive player from shooting (i.e., a good defender reduces chances of creating a shot for himself), may need multiple ratings based on floor position (i.e., the exact opposite of offensive "A" above)
b. How likely the player is to bother a shot as a primary defender (i.e., reduce shooter's chance of making it)
c. How likely the player is to avoid or commit a shooting foul
d. How likely the player is to avoid or commit a non-shooting foul
e. How likely the player is to draw an offensive foul
f. How likely the player is to draw an on-ball steal (i.e., quick hands)
g. How likely the player is to induce a non-steal turnover (e.g., travel, bad pass)
h. How likely the player is to deny a lane to get a better touch for an offensive player's teammate ("crowd the passer")
i. How likely the player is to stick with his assigned player off the ball (i.e., fight through screens)
j. How likely the player is to help when other players get free (i.e., switch)
k. How likely the player is to steal a pass (i.e., "jump the passing lanes")
l. How likely the player is to block a shot as a primary defender/secondary defender
5. As a general rule of thumb, I would suggest that all players are considered to have a baseline level of competence (e.g., shoot 45% from the floor) and that offense or defensive ratings can shift that up by about 15-20% each way (i.e., the best offensive player versus the worst defensive player would get a 40% boost over 45% from the floor - that's 45%x1.4 for a 63% shooting, not 45%+40% = 85%; similarly the worst offensive player versus the best defensive player would shoot 45%x0.6 or 27%, not 45%-40% for a total of 5%)
6. "Secondary" factors (e.g., height difference improving/hindering blocked shots) might be factored in later but I woudl suggest instead we make height completely cosmetic and have height directly boost the "block shot" rating when a player is created.
More later, but that's the basics as I see it and we can start discussion from there.
The database could store the results of each touch so we can get deep analysis of how efficient a player is, and allow gameplanning to increase the number of touches a player gets. There probably also needs to be a rating to reflect how often a player "demands" touches (i.e., affects the likelihood he's the one picked to get the next touch) so we can simulate clueless chuckers (see also: P, Swaggy) that kill team chemistry.
Having taken a couple of stabs at building a sim engine myself in the past, here is what I personally think the best strategy to build is (and also lets us capture the most data):
1. The "basic unit of gameplay" is a "touch." A "touch" ends in one of the following outcomes:
a. Field Goal Attempt (may include defensive and-1 foul)
b. Defensive Foul
c. Turnover (includes offensive fouls)
d. End of Period
e. Pass
2. A "possession" as we generally understand it in basketball is then a "touch" that ends in anything but a pass, and also contains all touches preceding it that ended in a pass.
3. A "touch" should probably track the following:
a. Player with the ball
b. Primary defender against player with ball
c. Player who had the ball on the previous touch (e.g., potential assist man)
d. Location on floor where touch takes place (see http://www.82games.com/locations.htm as a start)
e. Secondary defenders (if any, i.e., secondary shot blockers)
f. All ten players on the floor (tracks +/-)
g. Time elapsed on this possession (how deep into the 24-second clock)
h. Time remaining and point differential (lets us track "clutch performance" etc.)
i. Offensive gameplan
j. Defensive gameplan
4. I suggest player ratings be simple, "direct" ratings that affect:
Offense:
a. How likely a player is to create a shot during a touch (may have multiple ratings, e.g., inside, slashing, spot-up, etc. and may need multiple ratings to decide what kind of shot the player is likely to try to create)
b. How likely a player is to make a shot (may have multiple ratings based on floor location)
c. How likely a player is to draw a shooting foul
d. How likely a player is to draw a non-shooting foul
e. How likely the player is to commit an offensive foul
f. How likely the player is to allow a steal of the dribble ("handles")
g. How likely the player is to commit an unforced turnover (e.g., bad pass, travel)
h. How likely the player is to create a better touch for another player (i.e., good pass)
i. How likely a player is to "Get open" (e.g., Reggie Miller running off screens) when someone else is using a touch
j. How likely a player is to "help others get open" (e.g., set a pick) when someone else is using a touch
k. How likely the player is to allow a steal on a pass ("court vision")
l. How likely the player is to have his shot blocked/avoid a potential block
Defense:
a. How likely a player is to keep the offensive player from shooting (i.e., a good defender reduces chances of creating a shot for himself), may need multiple ratings based on floor position (i.e., the exact opposite of offensive "A" above)
b. How likely the player is to bother a shot as a primary defender (i.e., reduce shooter's chance of making it)
c. How likely the player is to avoid or commit a shooting foul
d. How likely the player is to avoid or commit a non-shooting foul
e. How likely the player is to draw an offensive foul
f. How likely the player is to draw an on-ball steal (i.e., quick hands)
g. How likely the player is to induce a non-steal turnover (e.g., travel, bad pass)
h. How likely the player is to deny a lane to get a better touch for an offensive player's teammate ("crowd the passer")
i. How likely the player is to stick with his assigned player off the ball (i.e., fight through screens)
j. How likely the player is to help when other players get free (i.e., switch)
k. How likely the player is to steal a pass (i.e., "jump the passing lanes")
l. How likely the player is to block a shot as a primary defender/secondary defender
5. As a general rule of thumb, I would suggest that all players are considered to have a baseline level of competence (e.g., shoot 45% from the floor) and that offense or defensive ratings can shift that up by about 15-20% each way (i.e., the best offensive player versus the worst defensive player would get a 40% boost over 45% from the floor - that's 45%x1.4 for a 63% shooting, not 45%+40% = 85%; similarly the worst offensive player versus the best defensive player would shoot 45%x0.6 or 27%, not 45%-40% for a total of 5%)
6. "Secondary" factors (e.g., height difference improving/hindering blocked shots) might be factored in later but I woudl suggest instead we make height completely cosmetic and have height directly boost the "block shot" rating when a player is created.
More later, but that's the basics as I see it and we can start discussion from there.
The database could store the results of each touch so we can get deep analysis of how efficient a player is, and allow gameplanning to increase the number of touches a player gets. There probably also needs to be a rating to reflect how often a player "demands" touches (i.e., affects the likelihood he's the one picked to get the next touch) so we can simulate clueless chuckers (see also: P, Swaggy) that kill team chemistry.