Created a 'hard coded' ratings generator for new players, designed specifically for '1933'. Basically each player type is created in a for loop that controls the number created, and there are two arrays of 16 values (for each of the attributes), one for the min, one for the max, which give the range the attribute can fall into, for each player type. Then the attribute is generated randomly within that range. Complexity is added by allowing for a small range of 'freaks' (high and low values across the board), 'good or poor players' with the rest getting a great, high, average, low, poor rating for three groups of attributes (Physical, Dexterity, Intelligence). Each game attribute is then modified by the player's rating in whichever attribute group it belongs to (STR, END, BLK, BLA, PSS, KST for the Physical group for instance) by the appropriate amount (Poor: -6 to -10, Low: -1 to -5, Average: 0, High: 1-5, Great: 6-10). Final complexity is added by allowing for subgroups of positions. In 1933 for instance, most Quarterbacks were blocking backs (ie, Fullbacks) but Chicago had started experimenting with the T formation which made the QB the primary ball handler. So I created a check for which type (Blocker = 75%, Thrower = 25%) and had two different rating ranges based on which one was chosen. Eventually I'd like to make this more automated, or at least read the values from a text file where all the data is a bit easier to see and modify at once rather than looking through the code.
In game terms, you start a new season, then run the perl script which replaces the first 1 to n (n being the number of players you generate) players by randomly generated ones and then deletes the ones not generated by Perl (mental note... use one of the unused Rating columns to hold a flag for the perl created players so as not to delete them when the season rolls over).
I also created a quick and dirty DraftProfile script in which I made three arrays the size of the draft length (38 - customized the draft length by changing the value in another table). First array holds the Position ID number, second array holds the first criteria, third array holds the second criteria. Then for the number of 'profiles' (the three arrays as a group) I picked one randomly and assigned those values to the team for the draft. Works nicely but it's nasty to change or add more, so I'll be working on a complete change to the draft that bypasses the in game portion entirely.
In effect, draft profiles will be in a seperate text file, with the following information:
(For a 1933 file)
Code: Select all
Position Starters Backups StarterWeight BackupWeight Criteria
DL1 2 2 2.0 1.0 STR,BLA
DL2 2 2 2.0 1.0 STR,AGI
RB1 1 2 1.0 0.5 HND,AGI
RB2 1 2 1.0 0.5 BLK,STR
.
.
.
etc...
Each round, the game will assign a value to each player in the draft based on a formula along the following lines:
CriteriaValue = (Criteria1 + Criteria2 .. + CriteriaN / N) (Number of Criteria)
FinalValue = CriteriaValue * Weight
Then the team will pick the player with the highest rated FinalValue. Note the flexibility I hope to achieve. If you want to create a defensive minded GM, all the defensive players can have higher weights. If you want to create a 'best available player' GM, just set all weights the same.
The program will load all possible profiles into an array and then randomly pick one. I'll probably have a line designating each draft profile with PROFILE=# where # is the number of times it's added to the array (to simulate certain profiles/team types being more popular).
This will probably be my next week's project.
If there's anyone savvy on Perl, ODBC and all that good stuff on Windows, I can easily enough send the *.pl files I've created. Next weekend I'll try to document how to set them up and run them for the non-perl guru... Warning, you'll have to learn to type from a command line.