View Single Post
Old 12-08-2014, 06:18 PM   #45
Groundhog
Coordinator
 
Join Date: Dec 2003
Location: Sydney, Australia
No updates in a while, but I'm still plugging away. On the sim-side of things, it's largely just finishing off event blocks and then tying everything together via loop control to make sure the transitions between events happen as they should. I'm pretty happy with everything I've got coded so far, and I've started forcing myself to K.I.S.S. a number of times, leaving comments of '#TODO: "Insert crazy idea here"' throughout my code for things I can come back and look at trying once I've got more of the sim done. I spent about 4 days working on rebounds - tipped rebounds, FT rebounds, airballs, etc. - when I decided it was probably time to scale it back a bit until I've got more done!

One of the key features of my sim is that it will be very easy to tweak just about every calculation. I have a function called "base10" that sets the chances of an event happening for a player with the rating of 10 for the skill to be tested, and a "base10_mod" to be used as a +/- modifier applied for each point the player is rated over/under a 10. All the base10 percentages and mods are stored in an ini file with the sim pulling in the values each time it runs. This applies for every main calculation - from shooting %, alley-oop pass success, spotting open players, etc.

I did like Nol's 'flair' mention above, which led me to incorporate a court awareness rating in addition to off/def aware. At this stage it's solely related to checking for players via the pass value work I mentioned above.

I've made the switch from sqlite to SQLAlchemy for my database stuff. SQLAlchemy makes database queries more python-esque and, though I haven't yet "mastered" it for the basic stuff I'll be using it for, I find it easier to work with than using SQL statements.

I spent a bit of time the past couple of days working on player generation. I mentioned earlier that each nation has a set of attributes that affect player generation. What I worked on yesterday was generating base values for speed and strenght based on a player's height and weight. Each height has a base set of characteristics, and then a point where penalties/bonuses can apply to speed or strenght attributes following that.

I don't have the actual settings handy, by for example a 6'10 player might default to 245lbs with a rating of 11 for strength and 6 for speed. If the player in question is generated weighing 285lbs, there is a 50% chance his strength will increase and speed will decrease by 1 for each multiple of 10 over a limit - say 260lbs. So in this case there's a chance the 6'10 guy will have a 4 for speed, and 13 for strength. This is all just to create the base ratings of the guy, which would change once a template is layed over his ratings - 'outside shooter', 'rebounder', etc. so there's a chance they could jump/drop further.
__________________
Politics, n. Strife of interests masquerading as a contest of principles.
--Ambrose Bierce
Groundhog is offline   Reply With Quote