View Single Post
Old 07-21-2014, 12:46 AM   #4
Join Date: Dec 2003
Location: Sydney, Australia
Playing with Python - Opening Tip

After a couple of hours I theory, I like to give myself a break and try and create something based on what I know, to see if I really understand what I've been reading. It's one thing that make a quick little program that calculates the average of a range of numbers, but trying to apply what you've learnt to a real problem is much more useful.

So, the opening jumpball. This should be the single easiest aspect of the sim as far as on-court stuff goes. You have a situation where two players compete to gain possession of the ball to begin the game. There are no pre-play conditions to take into account other than who is jumping from each team and that it's the first possession of the game.

First Problem: Who is in the jump?
Most sims have this as being the C position for both teams. Often that is the case IRL, but not always. From what I observe, it's typically the best of the PFs and Cs, rarely other positions. There are exceptions to this, but it does not seem to be a situation that coaches strategise over like other aspects of the game, for a number of reasons. I'd like my sim to pick the most suitable jumper from the starting PFs and Cs.

Second Problem: Ratings?
Simply, height and jumping ability. I like a FM-style 1-20 rating system as I think it gives enough spread to cover lower-grade competitions right up to world-class. Although a 1-100 system is most common, I've always found it too granular - playing a guy with an 84 in three point ability over a guy with 81 just feels too spreadsheety to me. 1-20 also ties with the "d20" type system I have been toying with to determine contests between individuals - like hustle rebounds, charges vs blocks on drives, etc.

I had considered something like 'reach' as a rating that would be a modifier for various actions in the game, with a 10/20 basically meaning normal wingspan for a player's height. It's something that I'd probably include in the "final product".

First step is to work out how good the PFs and Cs of each team are at jumpballs. The players heights and jumping ability are added together (heights are stored as integers that treat 0 foot 1 inch as "1", and then count upwards, so 6'6 would be 78). The higher of the two frontcourt players for each team is deemed the best jumper, and variables are populated with their name and ratings to be used in the calculation for the tip. If it's a tie, it defaults to the C position.

Sticking with the d20 idea, the actual jumpball competition would be a random d20 result with the difference between the two players' height+jump ratings used as a modifier for that roll. Winning team gains possession, and on a tie, a random result is chosen. I'd like it to be clear in the PbP for all actions like this how the roll went - ie. if it's a tie, the text should be different to indicate a close result. Not as critical in a jumpball, but in other situations I think it would add some flavour to the sim.

Up next: the code...
Politics, n. Strife of interests masquerading as a contest of principles.
--Ambrose Bierce
Groundhog is offline   Reply With Quote