• Create Account

### #ActualHodgman

Posted 12 May 2012 - 09:20 AM

Any tips on how it can be tweaked?

Seeing sqrt(x) is the same as pow(x, 1/2) (i.e. the inverse of pow(x,2)), you can try tweaking that hard-coded 2 with different values, e.g. what you've got now is the same as this, so replace 2.0f with a variable and see what happens:
int sum=0;
for( int i=0; i!=count; ++i )
sum += pow( scores[i], 2.0f );
score = pow( sum, 1/2.0f );
I guess larger numbers give more weight to perfectionists, and smaller numbers are closer to a regular average.

### #2Hodgman

Posted 12 May 2012 - 09:19 AM

Any tips on how it can be tweaked?

Seeing sqrt(x) is the same as pow(x, 1/2) (i.e. the inverse of pow(x,2)), you can try tweaking that hard-coded 2 with different values, e.g. what you've got now is the same as this, so replace 2.0f with a variable and see what happens:
int sum=0;
for( int i=0; i!=count; ++i )
sum += pow( scores[i], 2.0f );
score = pow( sum, 1/2.0f );

### #1Hodgman

Posted 12 May 2012 - 09:18 AM

Any tips on how it can be tweaked?

Seeing sqrt(x) is the same as pow(x, 1/2) (i.e. the inverse of pow(x,2)), you can try tweaking that hard-coded 2 with different values, e.g.
int sum=0;
for( int i=0; i!=count; ++i )
sum += pow( scores[i], 3.0f );
score = pow( sum, 1/3.0f );

PARTNERS