Jump to content

[Patch] Matchmaker rating


Roshnak

Recommended Posts

What bug does the patch fix? What features does the patch add?

Arena join using matchmaker rating

For which repository revision was the patch created?

11.100

Who has been writing this patch? Please include either forum user names or email addresses.

me using some code off http://code.google.com/p/trinitycore/source/detail?spec=svnfce5b5c2182cc5c2c53e31d3b082cef11f5811ca&r=fce5b5c2182cc5c2c53e31d3b082cef11f5811ca and https://github.com/rsa/mangos/commit/65772551b3ade14a169b929f0bf1e7d73c524319

Arena teams are joining the battle using arena team rating or average members personal rating, if one player who have for example 2000 personal leave team and join to other or the same team its personal rating decrease to 0 and they join the battle with the average of the team if all have 0 entrer with 0 and it shouldn't happends.

To solve this problem I tried to create new arena join sistem using other rating who players can't see, for this I create a new table in characters database who contains this rating and it isn't deleted when player leave team and is not reset when join otrher team too

CREATE TABLE IF NOT EXISTS hidden_rating (guid INT(11) UNSIGNED NOT NULL, rating2 INT(10) UNSIGNED NOT NULL,  rating3 INT(10) UNSIGNED NOT NULL,rating5 INT(10) UNSIGNED NOT NULL);

http://pastebin.com/HKrQM7DK

http://pastebin.com/j6gtXNyu

http://pastebin.com/hLGdyX3E

http://pastebin.com/U9kF8tDA

Its my try to solve this if someone can improve it please post

Link to comment
Share on other sites

  • 3 weeks later...

There's something I still don't understand:

In your code:

+ // update matchmaker rating

+ chance = GetChanceAgainst(itr->matchmaker_rating, againstRating);

+ K = (itr->matchmaker_rating < 1000) ? 48.0f : 32.0f;

+ // calculate the rating modification (ELO system with k=32 or k=48 if rating<1000)

+ mod = (int32)ceil(K * (0.0f - chance));

+ itr->ModifyMatchmakerRating(plr,mod,GetType());

+ // update matchmaker rating

+ chance = GetChanceAgainst(itr->matchmaker_rating, againstRating);

+ K = (itr->matchmaker_rating < 1000) ? 48.0f : 32.0f;

+ mod = (int32)ceil(K * (0.0f - chance));

+ if (int32(itr->matchmaker_rating) + mod < 0)

+ itr->matchmaker_rating = 0;

+ else

+ itr->matchmaker_rating + mod;

In Trinity code:

- float K = (m_stats.rating < 1000) ? 48.0f : 32.0f;

- // calculate the rating modification (ELO system with k=32 or k=48 if rating<1000)

- int32 mod = (int32)floor(K* (1.0f - chance));

+ // calculate the rating modification

+ // simulation on how it works. Not much info on how it really works

+ int32 mod;

+ if (m_stats.rating < 1500)

+ mod = (int32)ceil(48.0f * (1.0f - chance) * (1.0f - chance));

+ else

+ mod = (int32)ceil(24.0f * (1.0f - chance));

- float K = 32.0f;

- int32 mod = (int32)ceil(K * (0.0f - chance));

+ // calculate the rating lost

+ // there is not much info on the formula, but this is a very good simulation

+ int32 mod;

+ if (winnerlowrating)

+ mod = (int32)floor(48.0f * chance * chance) * -1;

+ else

+ mod = (int32)floor(24.0f * (0.0f - chance));

- float chance = GetChanceAgainst(itr->personal_rating, againstRating);

- float K = (itr->personal_rating < 1000) ? 48.0f : 32.0f;

- // calculate the rating modification (ELO system with k=32 or k=48 if rating<1000)

- int32 mod = (int32)ceil(K * (0.0f - chance));

- if (int32(itr->personal_rating) + mod < 0)

- itr->personal_rating = 0;

- else

- itr->personal_rating += mod;

+ float chance = GetChanceAgainst(itr->personal_rating, m_stats.rating);

+ // calculate the rating modification

+ int32 mod = (int32)ceil(24.0f * (0.0f - chance));

+ itr->ModifyPersonalRating(NULL, mod, GetSlot());

+ // update matchmaker rating

+ chance = GetChanceAgainst(itr->matchmaker_rating, againstMatchmakerRating);

+ // calculate the rating modification

+ mod = (int32)ceil(24.0f * (0.0f - chance));

+ itr->ModifyMatchmakerRating(mod, GetSlot());

As you can see, you're still working with 48 and 32 but in trinity that was deprecated and it's working with 48 and 24 and changes from 1000 to 1500.

Why are you still working with those numbers and where do you get the info of that? Because when I'm looking for it in wowwiki, for example, there's just 32 (or maybe someone else can explain me).

Link to comment
Share on other sites

  • 2 weeks later...

typo

diff --git a/src/game/ArenaTeam.cpp b/src/game/ArenaTeam.cpp

index 0159d41..8898668 100644

--- a/src/game/ArenaTeam.cpp

+++ b/src/game/ArenaTeam.cpp

@@ -835,7 +835,7 @@ void ArenaTeam::OfflineMemberLost(ObjectGuid guid, uint32 againstRating)

if (int32(itr->matchmaker_rating) + mod < 0)

itr->matchmaker_rating = 0;

else

- itr->matchmaker_rating + mod;

+ itr->matchmaker_rating += mod;

if(GetType() == ARENA_TYPE_2v2)

CharacterDatabase.PExecute("UPDATE hidden_rating SET rating2 = '%u' WHERE guid = '%u'", itr->matchmaker_rating, guid.GetCounter());

Link to comment
Share on other sites

×
×
  • 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. Privacy Policy Terms of Use