award MVP Fragger based on: 1) frags, 2) HS's, 3) total dmg
ok, i collect the following data for each round of play:
1. total frags (each player) 2. total headshots (each player) 3. total damage (each player) objective: assign the title "MVP Fragger: playername" based on: 1. Rank of total Frags comparing each of the 32 players against the others 2. Rank of total Headshots comparing each of the 32 players against the others 3. Rank of total Damage comparing each of the 32 players against the others if You have the time, show me a structure i can use to evaluate the rank of each player in relation to all the others in each of the 3 categories. i'll probly figure out how to do this in time, but if You feel like offering suggestions on how to go about it, that'd be cool. Code:
Playername Frags HS's Damage Player1: 3 2 320 Player2: 7 1 1200 Player3: 12 6 1200 Player4: 16 8 1900 Ok, the MVP Fragger for the round should be: Player4, because he ranked #1 in each of the 3 categories. |
Code:
Example: Code:
playerWithMostFrags in this case would be 4 (the index). If the last parameter was a 0 it would be 16 (the number). |
allright, forgive me, i didn't do a very good job of describing the scenario for end-of-round processing.
here is a table of data: Code:
task: for each player, calculate rank against all players in each of the 3 categories. this is represented by the three Rank columns in the data table. then, calculate each players overall score. here is how we arrive at Player[1]'s overall score: Player[1] Overall Rank Calculation: ----------------------------------- Rank in Frags: 4th Rank in Headshots: 3rd Rank in Damage: 3rd =================================== Player[1] Overall Rank: 3.3333 =================================== Player Overall Rank Calculation: -------------------------------- player[1]: (4+3+3)/3=3.3333 player[2]: (5+2+2)/3=3.0000 player[3]: (6+6+9)/3=7.0000 player[4]: (7+5+6)/3=6.0000 player[5]: (2+4+5)/3=3.6667 player[6]: (1+7+4)/3=4.0000 player[7]: (3+1+1)/3=1.6667 player[8]: (9+8+10)/3=9.0000 player[9]: (8+6+8.0)/3=7.3333 player[10]: (7+8+7)/3=7.3333 ================================= MVP Overall: Player[7] 1.6667 ================================= |
ok, break it down to simplest terms.
let's look at only the frags for each player. need to sort them descending so that the most frags are in position 1, or at least, can be assigned rank=1. then spin thru the list, putting the rank value with the associated frags for a specific player. reader: feel free to offer Your suggestion(s) |
| All times are GMT -4. The time now is 23:40. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.