Engine Sample Results

For discussion about creating our own sim engine.
Post Reply
User avatar
WigNosy
Posts: 6908
Joined: Fri Apr 04, 2014 6:39 pm
PBSL Team: Portland Trailblazers

Engine Sample Results

Post by WigNosy »

Based on the "opposing card draw" discussion, I've just made a rough first attempt at creating an engine based on "opposing cards" from the defender and offensive player. There's going to be a lot of tweaking as I go through this, but after doing some research, I found a typical "touch" in the NBA (of which there are about 360 per game) ends as follows:

FGA = 19.06%
Defensive Foul = 4.88% (Non-Shooting Fouls are 1.95%, Shooting Fouls are 2.93% and 21.9% of shooting fouls result in a made Field Goal so the possession ticks both the FGA and Foul boxes)
Steal = 1.86%
Unforced Turnover = 1.26% (three seconds, step out of bounds, travel, pass out of bounds, etc.)
Offensive Foul = 0.42% (this is a separate category from unforced turnover)
Technical Foul = 0.055%
Clear Path Foul = 0.007%
Flagrant I = 0.011%
Flagrant II = 0.001%
Pass = 71.20%

(This doesn't quite add up to 100% due to some rounding but I'm going to call the last 0.58% or so a "shot clock violation" because of the way I'm working the engine)
The Cat is Back
User avatar
WigNosy
Posts: 6908
Joined: Fri Apr 04, 2014 6:39 pm
PBSL Team: Portland Trailblazers

Re: Engine Sample Results

Post by WigNosy »

Preliminary results, "baseline" decks (i.e., completely average players), 100,000 simulations:

'Field Goal' => int 20236
'Common Foul' => int 4735
'Steal' => int 1787
'Unforced Turnover' => int 1248
'Offensive Foul' => int 423
'Technical Foul' => int 50
'Clear Path Foul' => int 3
'Flagrant I' => int 9
'Flagrant II' => int 1
'Pass' => int 71508

Those numbers are looking darn good for a "first pass" :)
The Cat is Back
User avatar
WigNosy
Posts: 6908
Joined: Fri Apr 04, 2014 6:39 pm
PBSL Team: Portland Trailblazers

Re: Engine Sample Results

Post by WigNosy »

Another "baseline" set:

'Field Goal' => int 20502
'Common Foul' => int 4691
'Steal' => int 1788
'Unforced Turnover' => int 1267
'Offensive Foul' => int 456
'Technical Foul' => int 49
'Clear Path Foul' => int 13
'Flagrant I' => int 12
'Flagrant II' => int 2
'Pass' => int 71220
The Cat is Back
User avatar
WigNosy
Posts: 6908
Joined: Fri Apr 04, 2014 6:39 pm
PBSL Team: Portland Trailblazers

Re: Engine Sample Results

Post by WigNosy »

And one more "baseline" set:

'Field Goal' => int 20322
'Common Foul' => int 4609
'Steal' => int 1790
'Unforced Turnover' => int 1175
'Offensive Foul' => int 378
'Technical Foul' => int 59
'Clear Path Foul' => int 6
'Flagrant I' => int 6
'Flagrant II' => int 0
'Pass' => int 71655
The Cat is Back
User avatar
WigNosy
Posts: 6908
Joined: Fri Apr 04, 2014 6:39 pm
PBSL Team: Portland Trailblazers

Re: Engine Sample Results

Post by WigNosy »

Goosing the deck with 100 extra "FGA" cards for the offensive player (set 1):

'Field Goal' => int 22777
'Common Foul' => int 4232
'Steal' => int 1628
'Unforced Turnover' => int 1045
'Offensive Foul' => int 378
'Technical Foul' => int 42
'Clear Path Foul' => int 4
'Flagrant I' => int 5
'Flagrant II' => int 1
'Pass' => int 69888
The Cat is Back
User avatar
WigNosy
Posts: 6908
Joined: Fri Apr 04, 2014 6:39 pm
PBSL Team: Portland Trailblazers

Re: Engine Sample Results

Post by WigNosy »

Goosing the deck with 100 extra "FGA" cards for the offensive player (set 2):

'Field Goal' => int 22684
'Common Foul' => int 4356
'Steal' => int 1597
'Unforced Turnover' => int 1108
'Offensive Foul' => int 361
'Technical Foul' => int 53
'Clear Path Foul' => int 4
'Flagrant I' => int 15
'Flagrant II' => int 2
'Pass' => int 69820
The Cat is Back
User avatar
WigNosy
Posts: 6908
Joined: Fri Apr 04, 2014 6:39 pm
PBSL Team: Portland Trailblazers

Re: Engine Sample Results

Post by WigNosy »

Goosing the deck with 100 extra "FGA" cards for the offensive player (set 3):

'Field Goal' => int 22329
'Common Foul' => int 4362
'Steal' => int 1669
'Unforced Turnover' => int 1088
'Offensive Foul' => int 380
'Technical Foul' => int 34
'Clear Path Foul' => int 2
'Flagrant I' => int 11
'Flagrant II' => int 0
'Pass' => int 70125
The Cat is Back
User avatar
WigNosy
Posts: 6908
Joined: Fri Apr 04, 2014 6:39 pm
PBSL Team: Portland Trailblazers

Re: Engine Sample Results

Post by WigNosy »

...and now a "baseline" offensive player vs a defensive player with 100 "deny" cards (when drawn, turns all results into a harmless pass):

'Field Goal' => int 18580
'Common Foul' => int 4242
'Steal' => int 1606
'Unforced Turnover' => int 1154
'Offensive Foul' => int 431
'Technical Foul' => int 86
'Clear Path Foul' => int 6
'Flagrant I' => int 11
'Flagrant II' => int 0
'Pass' => int 73884
The Cat is Back
User avatar
WigNosy
Posts: 6908
Joined: Fri Apr 04, 2014 6:39 pm
PBSL Team: Portland Trailblazers

Re: Engine Sample Results

Post by WigNosy »

100 deny cards, set 2

'Field Goal' => int 18340
'Common Foul' => int 4385
'Steal' => int 1635
'Unforced Turnover' => int 1036
'Offensive Foul' => int 408
'Technical Foul' => int 75
'Clear Path Foul' => int 6
'Flagrant I' => int 7
'Flagrant II' => int 2
'Pass' => int 74106
The Cat is Back
User avatar
WigNosy
Posts: 6908
Joined: Fri Apr 04, 2014 6:39 pm
PBSL Team: Portland Trailblazers

Re: Engine Sample Results

Post by WigNosy »

100 deny cards, set 3

'Field Goal' => int 18468
'Common Foul' => int 4210
'Steal' => int 1669
'Unforced Turnover' => int 1097
'Offensive Foul' => int 358
'Technical Foul' => int 79
'Clear Path Foul' => int 3
'Flagrant I' => int 5
'Flagrant II' => int 0
'Pass' => int 74111
The Cat is Back
User avatar
WigNosy
Posts: 6908
Joined: Fri Apr 04, 2014 6:39 pm
PBSL Team: Portland Trailblazers

Re: Engine Sample Results

Post by WigNosy »

Goosed offense (100 extra FGA cards) vs Goosed defense (100 Deny cards)

Set 1:

'Field Goal' => int 20379
'Common Foul' => int 3928
'Steal' => int 1446
'Unforced Turnover' => int 997
'Offensive Foul' => int 330
'Technical Foul' => int 74
'Clear Path Foul' => int 7
'Flagrant I' => int 11
'Flagrant II' => int 1
'Pass' => int 72827

Set 2:
'Field Goal' => int 20457
'Common Foul' => int 3919
'Steal' => int 1502
'Unforced Turnover' => int 961
'Offensive Foul' => int 329
'Technical Foul' => int 69
'Clear Path Foul' => int 7
'Flagrant I' => int 5
'Flagrant II' => int 2
'Pass' => int 72749

Set 3:
'Field Goal' => int 20627
'Common Foul' => int 3916
'Steal' => int 1441
'Unforced Turnover' => int 1007
'Offensive Foul' => int 372
'Technical Foul' => int 64
'Clear Path Foul' => int 4
'Flagrant I' => int 9
'Flagrant II' => int 1
'Pass' => int 72559
The Cat is Back
User avatar
WigNosy
Posts: 6908
Joined: Fri Apr 04, 2014 6:39 pm
PBSL Team: Portland Trailblazers

Re: Engine Sample Results

Post by WigNosy »

So, in the interest of trying to get something that slightly resembles a "game engine" instead of a "touch engine" I did a little more work putting together a VERY basic skeleton system. The initial results look VERY promising. :)

Using just the "base decks" I prepped a simulation - with crude play-by-play - of an 850 touch game (per NBA.com each team averages about 420 touches per game).

"Basic Assumptions to be changed later"
* It is assumed all field goals are worth 2 points and have a 50% chance of going in.
* It is assumed free throws have a 75% chance of going in.
* It is assumed all common fouls grant 1 free throw (this is an over simplification but since I'm not tracking time and quarters yet, I don't have a mechanism for getting 0 free throws until bonus is reached, then granting 2 free throws. This will come with time.)
* There are no blocked shots or assists yet (though the stat to track them exists).
* All players are completely "baseline" - the centers don't rebound better than the point guards, etc.

Stats from a representative game:

East 101, West : 125

EAST:
'Min' => int 0
'FGM' => int 41
'FGA' => int 83
'FTM' => int 19
'FTA' => int 24
'TGM' => int 0
'TGA' => int 0
'ORB' => int 6
'DRB' => int 35
'AST' => int 0
'STL' => int 7
'BLK' => int 0
'BKA' => int 0
'TVR' => int 20
'PFL' => int 33
'FLG' => int 0
'TEC' => int 0

WEST:
'Min' => int 0
'FGM' => int 51
'FGA' => int 93
'FTM' => int 23
'FTA' => int 28
'TGM' => int 0
'TGA' => int 0
'ORB' => int 12
'DRB' => int 41
'AST' => int 0
'STL' => int 7
'BLK' => int 0
'BKA' => int 0
'TVR' => int 12
'PFL' => int 23
'FLG' => int 0
'TEC' => int 1

Slice of extremely crude play-by-play from the above game:

West Center can't get a good move off. He passes the ball.
The ball goes to the PowerForward on Western Team
West Power Forward shoots the ball for the Western Team but misses the shot.
The defensive rebound is taken by Center for the Eastern Team.

East Center can't get a good move off. He passes the ball.
The ball goes to the PowerForward on Eastern Team
East Power Forward can't get a good move off. He passes the ball.
The ball goes to the ShootingGuard on Eastern Team
East Shooting Guard can't get a good move off. He passes the ball.
The ball goes to the PointGuard on Eastern Team
West Point Guard commits the foul for Western Team.
East Point Guard misses the free throw.
The defensive rebound is taken by PointGuard for the Western Team.

West Point Guard can't get a good move off. He passes the ball.
The ball goes to the SmallForward on Western Team
West Small Forward can't get a good move off. He passes the ball.
The ball goes to the PointGuard on Western Team
West Point Guard can't get a good move off. He passes the ball.
The ball goes to the ShootingGuard on Western Team
West Shooting Guard commits an unforced turnover.

The ball goes to the ShootingGuard on Eastern Team on the change of possession.

East Power Forward can't get a good move off. He passes the ball.
The ball goes to the Center on Eastern Team
East Center can't get a good move off. He passes the ball.
The ball goes to the PowerForward on Eastern Team
East Power Forward can't get a good move off. He passes the ball.
The ball goes to the SmallForward on Eastern Team
East Small Forward can't get a good move off. He passes the ball.
The ball goes to the Center on Eastern Team
East Center can't get a good move off. He passes the ball.
The ball goes to the PointGuard on Eastern Team
East Point Guard can't get a good move off. He passes the ball.
The ball goes to the PowerForward on Eastern Team
East Power Forward can't get a good move off. He passes the ball.
The ball goes to the SmallForward on Eastern Team
East Small Forward can't get a good move off. He passes the ball.
The ball goes to the Center on Eastern Team
East Center can't get a good move off. He passes the ball.
The ball goes to the PointGuard on Eastern Team
East Point Guard can't get a good move off. He passes the ball.
The ball goes to the PowerForward on Eastern Team
West Power Forward commits the foul for Western Team.
East Power Forward makes the free throw.

The ball goes to the PowerForward on Western Team on the change of possession.

West Center can't get a good move off. He passes the ball.
The ball goes to the SmallForward on Western Team
West Small Forward can't get a good move off. He passes the ball.
The ball goes to the PointGuard on Western Team
West Point Guard can't get a good move off. He passes the ball.
The ball goes to the PowerForward on Western Team
West Power Forward can't get a good move off. He passes the ball.
The ball goes to the ShootingGuard on Western Team
West Shooting Guard can't get a good move off. He passes the ball.
The ball goes to the SmallForward on Western Team
West Small Forward can't get a good move off. He passes the ball.
The ball goes to the ShootingGuard on Western Team
West Shooting Guard shoots the ball for the Western Team but misses the shot.
The offensive rebound is taken by ShootingGuard for the Western Team.
West Shooting Guard can't get a good move off. He passes the ball.
The ball goes to the SmallForward on Western Team
West Small Forward can't get a good move off. He passes the ball.
The ball goes to the ShootingGuard on Western Team
West Shooting Guard shoots the ball for the Western Team and makes the shot.
The Cat is Back
User avatar
WigNosy
Posts: 6908
Joined: Fri Apr 04, 2014 6:39 pm
PBSL Team: Portland Trailblazers

Re: Engine Sample Results

Post by WigNosy »

Just for fun, two more games with team stats output:

Score: East 91, West : 103

EAST
'Min' => int 0
'FGM' => int 36
'FGA' => int 83
'FTM' => int 19
'FTA' => int 26
'TGM' => int 0
'TGA' => int 0
'ORB' => int 12
'DRB' => int 35
'AST' => int 0
'STL' => int 6
'BLK' => int 0
'BKA' => int 0
'TVR' => int 10
'PFL' => int 18
'FLG' => int 0
'TEC' => int 1

WEST
'Min' => int 0
'FGM' => int 43
'FGA' => int 91
'FTM' => int 17
'FTA' => int 18
'TGM' => int 0
'TGA' => int 0
'ORB' => int 14
'DRB' => int 42
'AST' => int 0
'STL' => int 7
'BLK' => int 0
'BKA' => int 0
'TVR' => int 13
'PFL' => int 27
'FLG' => int 0
'TEC' => int 0


Score: East 110, West : 92

EAST
'Min' => int 0
'FGM' => int 49
'FGA' => int 92
'FTM' => int 12
'FTA' => int 15
'TGM' => int 0
'TGA' => int 0
'ORB' => int 12
'DRB' => int 38
'AST' => int 0
'STL' => int 5
'BLK' => int 0
'BKA' => int 0
'TVR' => int 12
'PFL' => int 28
'FLG' => int 0
'TEC' => int 1

WEST
'Min' => int 0
'FGM' => int 35
'FGA' => int 76
'FTM' => int 22
'FTA' => int 28
'TGM' => int 0
'TGA' => int 0
'ORB' => int 9
'DRB' => int 34
'AST' => int 0
'STL' => int 7
'BLK' => int 0
'BKA' => int 0
'TVR' => int 14
'PFL' => int 15
'FLG' => int 0
'TEC' => int 0
The Cat is Back
T
TheSyndicate
Posts: 3717
Joined: Mon Jan 19, 2015 2:15 pm
PBSL Team:

Re: Engine Sample Results

Post by TheSyndicate »

WigNosy wrote:Just for fun, two more games with team stats output:

Score: East 91, West : 103

EAST
'Min' => int 0
'FGM' => int 36
'FGA' => int 83
'FTM' => int 19
'FTA' => int 26
'TGM' => int 0
'TGA' => int 0
'ORB' => int 12
'DRB' => int 35
'AST' => int 0
'STL' => int 6
'BLK' => int 0
'BKA' => int 0
'TVR' => int 10
'PFL' => int 18
'FLG' => int 0
'TEC' => int 1

WEST
'Min' => int 0
'FGM' => int 43
'FGA' => int 91
'FTM' => int 17
'FTA' => int 18
'TGM' => int 0
'TGA' => int 0
'ORB' => int 14
'DRB' => int 42
'AST' => int 0
'STL' => int 7
'BLK' => int 0
'BKA' => int 0
'TVR' => int 13
'PFL' => int 27
'FLG' => int 0
'TEC' => int 0


Score: East 110, West : 92

EAST
'Min' => int 0
'FGM' => int 49
'FGA' => int 92
'FTM' => int 12
'FTA' => int 15
'TGM' => int 0
'TGA' => int 0
'ORB' => int 12
'DRB' => int 38
'AST' => int 0
'STL' => int 5
'BLK' => int 0
'BKA' => int 0
'TVR' => int 12
'PFL' => int 28
'FLG' => int 0
'TEC' => int 1

WEST
'Min' => int 0
'FGM' => int 35
'FGA' => int 76
'FTM' => int 22
'FTA' => int 28
'TGM' => int 0
'TGA' => int 0
'ORB' => int 9
'DRB' => int 34
'AST' => int 0
'STL' => int 7
'BLK' => int 0
'BKA' => int 0
'TVR' => int 14
'PFL' => int 15
'FLG' => int 0
'TEC' => int 0
I like this. The west seems better.
6 Rings. That's it. That's the tweet.
Post Reply

Return to “Roll Your Own Sim Engine”