Need mathy people for my mathy problem :D

Discussion in 'Plugin Development' started by CreeperShift, Jul 5, 2013.

Thread Status:
Not open for further replies.
  1. Offline

    CreeperShift

    A while back I came up with an easy solution for my problem but I forgot it again and now I cannot remember/come up with anything:


    I have 2 players killing each other. Player A and Player B.

    Player A has a score of 100, Player B has a score of 1500.


    When Player A kills Player B, he should gain a large amount of score, and player B loses a large amount of score.

    When Player B kills Player A, he should only get a small amount of score, and vice-verse.


    The larger the difference, the more points should be given if the kill goes to the underdog, and the fewer points should be given if the kill goes to the other one.


    I tried using ratios but that leads to the underdog getting half or more of the other players score which is too much.

    Can anyone show me a simple equation which solves this and isn't too resource intensive?
     
  2. Offline

    Jogy34

    you could try (killed/killer) * concentrationRate. So if the person that was killed had 100 points, the killer had 1500 points, and the concentration rate was say 35.62 it would be ((100 / 1500) * 35.62) = 2.37 but if the killed and killer were switched it would be ((1500 / 100) * 35.62) = 534.30. The example concentrationRate was just some random number I thought of so that can be easily changed to fit your needs better.
     
  3. Offline

    LucasEmanuel

    What Jogy34 said or you could withdraw a percentage from the killed player.

    Example:
    1. Player A killed player B, player A gets 10% of player B's points which is 150 points.
    2. Player B killed player A, player B gets 10% of player A's points which is 10 points.

    :)
     
  4. Offline

    CreeperShift

    That was what I tried to do, however that way a large difference means it will take almost half or at least a third off the victims points. :(

    In your example, the lower the cR the harder it is to accumulate points in the first place, so even if they don't lose as many they will still lose quite a lot for what they are worth.
     
  5. Offline

    Jogy34

    In my example it would take a third of player B's points. Also you could multiply it by a dilution rate to calculate how many points a player looses. Say you choose 0.4 for the dilution rate that would mean in the first example the player would loose about a point and in the second one the player would loose about 214 points. You could also lower the concentration rate some to make those numbers smaller. If you chose 14.25 the first one the killer would gain a point and the killer would loose a point (assuming you would place a minimum at 1 point) and the second example the killer would gain 214 points and the killed would loose 86 points.
     
  6. Offline

    CreeperShift

    Hmmm... That's a great idea actually :O Thanks, I'll try that! :)
     
  7. Offline

    desht

  8. Offline

    CreeperShift

Thread Status:
Not open for further replies.

Share This Page