123
-=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- (c) WidthPadding Industries 1987 0|385|0 -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=-
Socoder -> Blitz -> Weighted wages depending on rating

Mon, 02 Feb 2009, 06:08
LostUser
Hi there.

In the following code, a player can hire "Hoods", each of them have a 0/100 rating system.

What I'm after is a weighted rating system, so that the closer to 100 the rating is, the higher the salary is.

My system is a quick fix, however I get a problem:

Sometimes the person at a rating of 80 gets a higher salary than a person of 100 (this seems to happen a lot).

Anyway, what I'm after is a weighted wages system.

Here is my code;


Mon, 02 Feb 2009, 08:07
Scherererer
here's a quickie: Instead of doing your random wage mod + blocks of if-statements, you can set it like this:



-=-=-
YouTube Twitter
Computer Science Series: Logic (pt1) (part 2) (part 3) 2's Complement Mathematics: Basic Differential Calculus
Mon, 02 Feb 2009, 09:10
LostUser
I tried this, but it gives me a really big number for all my tests and the number is always the same for every "hood".

ie;


The wages should be at least different for each person, and not the same number.

I understand what you're doing with the quadratic equation, but its not getting the result I was after.

Also, the modding I was doing was for asthetic reasons - its easier to read a fixed round number (say in blocks of 5, 10 or 25).

Perhaps it just needs a bit of tweaking.
Mon, 02 Feb 2009, 11:52
Scherererer
oh shoot! I made a mistake, haha:




-=-=-
YouTube Twitter
Computer Science Series: Logic (pt1) (part 2) (part 3) 2's Complement Mathematics: Basic Differential Calculus
Tue, 03 Feb 2009, 02:25
LostUser
That's much better!

Now all I have to do is make sure its a round number (ie: is divisible by 5, 10, 25 or something like that) so that it is more visual appealing.

So instead of 6993 it's just 6990. I should be able to do this (I hope!)

Many thanks!
Tue, 03 Feb 2009, 08:24
Evil Roy Ferguso
You've probably already done this, but

prettyWage = (GenerateWage(rating)/5) * 5

is probably the easiest way to make the wage 'pretty.'
Wed, 04 Feb 2009, 04:00
LostUser
I did a rounding up thing.

ie:
1. generate the wage
2. if its not a MOD of 10 then keep adding 1 until it is.
3. if > max then wage = max (which is a mod of 10 anyway).

I'll probably do as you state to make it a bit better.

Thanks to all for their help!