This is the mail archive of the xconq7@sources.redhat.com mailing list for the Xconq project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: More revisions to exploring_worth


I've been following the discussion with some interest.  Something you
might consider doing is normalizing your calculations for each type of
calculation.  For example,
 if  you determine the speed for all units, then multiply by 1000, and
divide by the fastest unit, you'll come up with a number between 0 and
1000, ranking the unit by speed.  If you do that for each factor you
might want to consider, you can then build a weight table to combine the
factors into a total number representing the value of the unit.  The sum
of the weights shold sum to a number that you divide into the result.
For example, say there are 6 factors, f1 to f6.  You would calculate the
value by ( f1 * w1 + f2 * w2 + f3 * w3 + f4 * w4 + f5 * w5 + f6 * w6) *
1000 / (sum of weights).  This would give yoou a value between 0 and
1000 for the value of the unit.  If you need a negative factor, like
construction points, or tooling points, etc. you'd do the same
normalizing operation, but subtract the result from 1000 to reverse the
rankings.

By spliting each calculation of the indifidual factors into seperate
functions, and combining them via the table, you could get a very
flexable system for calculating worth.  Even more flexability could be
created by looping through the factor calculations using pointers to
functions, so that only needed calculations are done (if the weight for
range is zero, there's no need to call the functions to evaluate the
range), and to provide alternate calculation methods for a given game.
You might want to use diffent calculations for offense/defensive worth
depending on the combat mode, for example.





Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]