# A Good Average Equation?

Hi, I want to make an Average rating system for my game which has builds made by other players. These builds are rated from 1-5.

I know I can just do TotalNumber / TotalRaters but there’s a problem with that.

Let’s say someone makes a build and two players rate it a 5. Now this build is probably going to strong textbe like top 10 rated builds because it’s going to be a 5/5.

But if someone made a build where one player rated it a 5, and another rated it a 1, it would be 3 and it would ruin the whole rating.

I want an equation/algorithm to be able to make an accurate average without making it too sensitive to low TotalRaters.

1 Like

So the truth is, if you’re trying to skew averages, it will never be accurate, that’s just the way it is. Any algorithm or equation will inherently add in some amount of inaccuracy to what the players are actually rating the builds as.

With that being said, you could achieve something close to what you want, in a simple way, by setting a “default rating”

We’ll say, start each build with 10 ratings and they’re all 3/5 ratings, now whenever someone goes to rate it, their rating will be less impactful until more and more people start to show up and rate that build, thus pushing it towards what the players think the actual rating should be.

To prevent this from having a lasting impact on players ratings, you could remove those default ratings when they get up to a certain amount of ratings on their build, say for every 10 real ratings they get, remove 1 of the default ratings, removing them 1 at a time ensures that the rating won’t noticeably jump.

As for how this would look in your code, calculating the new rating would be almost as simple as your original calculation:
(TotalNumber + DefaultNumber) / (TotalRaters + DefaultRates)

Of course, this, like any solution to a problem of low sample size averages, has it’s own share of issues, if you have 10 default rates, and 1 person comes up and sees a terrible build and rates it a 1, then it would make very little difference until more people come up and rate it.

1 Like

I see what you’re saying. One thing though, I don’t really understand what you meant with the default stuff. Can you explain a little more if that’s okay?

2 Likes

It’s kinda difficult to break this down further, but I’ll do my best!

So, when we create a new build, we’ll assign it a starting amount of ratings, for this example I’ll stick to 10 ratings, and each rating will have a value of 3. So, 30 is the rating to start a new build with, and the average of that would be 3/5, so a brand new build would have a starting rating of 3/5.

As players come through and rate it, their ratings would be less impactful at first because those first 10 starting ratings are still in effect, as more people rate it though, the rating that the people actually think the build deserves will come through.

After a certain amount of human ratings have been given you would then likely want to remove the starting ratings so that they do not have a lasting impact, so you’d want to store the starting ratings separately from the rest of the real ratings.

--Something like this:
local AdjustedStartingRates = math.clamp(10 - (math.floor(TrueRatings/5), 0, 10) -- for every 5 real ratings, we'll remove one of our starting ones