Jump to content

Ranking points


onthespot

Recommended Posts

Hello. Ok i understand that this is a very advanced script to be writing.

However, I am looking to create a feature that will allow users to enter match results against one another and this will change their points.

So if a lower ranked player beats a higher ranked player, they will get more points then if a higher ranked player beats the lower ranked player.

 

The points will be deducted from one player and added to the other.

 

I have no idea where to start here, but if anyone could give me some insight into what is required to create such a feature i would be very very grateful.

Thankyou

Link to comment
https://forums.phpfreaks.com/topic/167545-ranking-points/
Share on other sites

Yes, though if it is a case of any users can sign up you might want to factor games played in to avoid second accounters

 

im not sure what level the points are but im going to make a few assumptions

 

  • a game is worth 50 points with no level bias
  • if two players in a ranking range of a difference of 500 play and the higher ranked player wins then no bonus points are awarded ( to avoid newbie preying)
  • the most bonus points a user can gain is 100


so lets try some pseudo code shall we?

 

assign 6200 to total players

assign ranking 1500 to playerA

assign ranking 1300 to playerB

assign winner to playerB

 

ranking diff equals

difference = loser ranking( playerA 1500 ) minus winner ranking ( playerB 1300 ) = 200

 

* TRUE: calculate bonus points

* FALSE: no bonus points

if ranking diff GREATER THAN 0 AND ranking diff LESS THAN OR EQUAL to 500

  total players INT DIVISION winner ranking = 4

  * Higher ranked players should get less bonus points

  so give the player 4% of the difference points

  = 8 points

  points = 50 + 8

else

    points = 50

 

so the winning player gets 58 points total

 

now lets retry this

 

PlayerA being ranked 600

playerB being ranked 100

 

so loser ranking( playerA 600 ) minus winner ranking ( playerB 100 ) = 500

so 62%

 

so now we give them 62% of 500 so thats 310 points

so now playerB gets 360 points

 

this allows the new players to rise faster while stopping the "Big Guys" preying onthe little guys.

 

Just an idea.

 

 

 

 

 

 

 

 

 

Link to comment
https://forums.phpfreaks.com/topic/167545-ranking-points/#findComment-883587
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.