Jump to content

[8268]Arena system in 3.1.3


Auntie Mangos

Recommended Posts

  • 39 years later...

What repair this patch: In client version 3.1.3 arena teams must start at 0 rating and new members that join to arena team must start whit a personal rating=team rating or a max of 1000. This repairs also some formulas for rating<1300

Autor of this patch: me

diff --git a/src/game/ArenaTeam.cpp b/src/game/ArenaTeam.cpp
index 6b88ba6..3c2d50b 100644
--- a/src/game/ArenaTeam.cpp
+++ b/src/game/ArenaTeam.cpp
@@ -34,7 +34,7 @@ ArenaTeam::ArenaTeam()
    stats.games_week    = 0;
    stats.games_season  = 0;
    stats.rank          = 0;
-    stats.rating        = 1500;
+    stats.rating        = 0;
    stats.wins_week     = 0;
    stats.wins_season   = 0;
}
@@ -129,8 +129,11 @@ bool ArenaTeam::AddMember(const uint64& PlayerGuid)
    newmember.games_week        = 0;
    newmember.wins_season       = 0;
    newmember.wins_week         = 0;
-    newmember.personal_rating   = 1500;
+    if ( ArenaTeam::stats.rating < 1000 ) 
+      { 
+         newmember.personal_rating = ArenaTeam::stats.rating;
+      }
+   else newmember.personal_rating   = 1000;
    members.push_back(newmember);

    CharacterDatabase.PExecute("INSERT INTO arena_team_member (arenateamid, guid, personal_rating) VALUES
('%u', '%u', '%u')", Id, GUID_LOPART(newmember.guid), newmember.personal_rating );

@@ -499,6 +502,8 @@ float ArenaTeam::GetChanceAgainst(uint32 own_rating, uint32 enemy_rating)
{
    // returns the chance to win against a team with the given rating, used in the rating adjustment calculation
    // ELO system
+    if (enemy_rating<1300)
+       enemy_rating=1300.0f;
    return 1.0f/(1.0f+exp(log(10.0f)*(float)((float)enemy_rating - (float)own_rating)/400.0f));
}

Link to comment
Share on other sites

hello, besides that i don't realy understand the new rating system i can help to improve your code (:

"ArenaTeam::stats.rating" should be just "stats.rating" because you want to access a variable inside this class and not a static-variable from this class

and

"enemy_rating=1300.0f;" should be just "enemy_rating=1300;" cause storing a float in an integer has no effect

Link to comment
Share on other sites

There you got some info about Season 6: hxxp://www.wowwiki.com/Arena_PvP_system

Wowwiki:

The first time the Arena Team is created, it starts with 1500 Team Rating that you must raise by fighting against other groups; however, as of season 6 newly formed teams have their Team Rating set to 0 (Patch 3.1).

In that post there are team rating calculations and other sorta useful formulas.

Link to comment
Share on other sites

there also needs to be a check for stats.rating... if the rating is 0 and a teams looses, there is a problem...

stats.rating is uint32 if you subtract some number "x" bigger than 0 from 0 you dont get -x you get 4294967296 - x

so there has to be a check that nothing more than the amount of stats.rating itself gets substracted from stats.rating otherwise the teams gets a pretty nice rating ^^

Link to comment
Share on other sites

good point sinaka :) - i think this is also a bug in current code (i'm not sure if a negative rating is theoretical possible with the old 1500 system, but a check wouldn't harm too)

if noone says something against xtzgzorex's patch (espacialy the rating-formula), i would apply it together with negative-value check..

edit:

commited :)

i'll wait a bit - and if no problems occur, i can backport all commits from today too.. (cause we check in config - i think it's ok to have this rating-feature also in mangos-0.12 .. people who don't like it just use seasonids <6)

Link to comment
Share on other sites

@darkside: i pm'ed you..

but maybe now i understand with last post..

so you want to say, that the new season6 formula a team with less than 1300 rating shouldn't lose rating?

is this right? and you're sure?

@alez:

and you say maximum rating gain is 20 - but i don't understand how to determine if a team is equal-rated to set 0 as maximum loss..

or has this again todo with the magic 1300-rating

so people with less than 1300 will always gain 20 on win and always gain 0 on lose?

Link to comment
Share on other sites

@alez:

and you say maximum rating gain is 20 - but i don't understand how to determine if a team is equal-rated to set 0 as maximum loss..

Now that Arena Season 6 is on the horizon, we wanted to share some details regarding upcoming changes to the arena rating system in Arena Season 6. With Arena Season 6, arena teams will start at 0 rating instead of 1500, which will allow teams to have more continuous progression throughout the arena season. In addition, we reevaluated item purchases and felt many of them were too difficult to obtain so we will be altering the rating requirements needed to purchase the latest arena items. For example, items with a rating requirement will now be obtainable starting at 1250 rating.

As with the current system, the matchmaking system will attempt to match teams against opponents who are closest to their average matchmaking rating. Starting with Arena Season 6, a team’s average matchmaking rating will be shown in the scoreboard at the end of each match so that you can see where your team stands compared to the opposing team you just faced. All arena teams that are below a 1500 arena rating will always earn arena points as a 1500 rated team. This will allow teams to continue to build up arena points while working on gaining the ratings needed to purchase items.

In order to make joining teams later in the season a little easier for players, the system will now be setup so if a player joins a team that has a team rating of 1000 or higher, the player’s personal rating will start off at 1000 instead of 0. And Another thing to keep in mind is that until you start to get close to your team's matchmaking rating, you will be gaining around 20 or more points in a win and zero or nearly zero in a loss. So players will make steady progress through games played until they near their team's matchmaking rating.

Link to comment
Share on other sites

  • 4 weeks later...
  • 2 weeks later...
  • 1 month later...

You have corrected my patch, but you have repeated a my typo:

- if (enemy_rating<1300)

- enemy_rating=1300;

+ if (enemy_rating<1000)

+ enemy_rating=1000;

I have verified this typo, i do arena in blizzard servers and the formulas work correct with 1000 and not 1300.

As example:

If you win an arena with rating 0 in offi you win 47 points of rating, if you win an arena in mangos server you win only 31 point of rating.

K in elo formulas must change: when rating<1000 k must be 48, else 32.

Is also needed the "matchmaking system"... i will workin that but i'm not an expert programmer.

See you later! ;)

Link to comment
Share on other sites

thank you very much for this.. :)

i just don't know how arena works now on offi that's why i repeated the typo ^^

edit: yesterday you had 1500 inside it, today 1000 and now triply told me 1500 is right.. :P

i hope it's ok now.. else the next commit would be "fix the fixed typofix from last commit" ^^

edit2: "All arena teams that are below a 1500 arena rating will always earn arena points as a 1500 rated team."

directly from wowwiki (while triply feared me that last commit realy was wrong^^)

1000 is used for new members, if arenateam has more than 1000 rating

edit3:

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

index 891ce63..6c072b9 100644

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

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

@@ -136,7 +136,7 @@ bool ArenaTeam::AddMember(const uint64& PlayerGuid)

if (sWorld.getConfig(CONFIG_ARENA_SEASON_ID) >= 6)

{

if (m_stats.rating < 1000)

- newmember.personal_rating = m_stats.rating;

+ newmember.personal_rating = 0;

else

newmember.personal_rating = 1000;

}

i think this change will be needed..

"if a player joins a team that has a team rating of 1000 or higher, the player’s personal rating will start off at 1000 instead of 0."

Link to comment
Share on other sites

See this graphic:

http://eu.wowarmory.com/arena-team-game-chart.xml?r=Sanguino&ts=2&t=Random+players&select=Random+players

If you set that to 1000 you can obtain similar results. I have remaded arena team 6 times ( yes, i'm mad xD )

colecting a lot of quantity of data, and similar graphics.

See the graphic:

- In first match i won a rating of 47, this is not possible with actualy formulas, K must be 48

- Near to rating 1000 ( see rating 983 ) i won 24, if you set k to 48 and "the number" to 1000 you can obtain these results.

- After rating 1000 ( see 1013 ) i won 18 points, in this case K in elo formulas must be 32 and "the number" not exist. i won against a team with 1063 rating ( set K=32 and "the number" works under rating 1000 )

I'm not a programmer, but i'm a good mathematical xD specialized in find algorithms, and i found this.

I try to create a patch. You mus see the sintaxt, i'm not have compilation's errors.

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

index 891ce63..0a8bc77 100644

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

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

@@ -513,8 +513,8 @@ float ArenaTeam::GetChanceAgainst(uint32 own_rating, uint32 enemy_rating)

// ELO system

if (sWorld.getConfig(CONFIG_ARENA_SEASON_ID) >= 6)

- if (enemy_rating < 1500)

- enemy_rating = 1500;

+ if (enemy_rating < 1000)

+ enemy_rating = 1000;

return 1.0f/(1.0f+exp(log(10.0f)*(float)((float)enemy_rating - (float)own_rating)/400.0f));

}

@@ -542,8 +542,12 @@ int32 ArenaTeam::WonAgainst(uint32 againstRating)

// called when the team has won

// 'chance' calculation - to beat the opponent

float chance = GetChanceAgainst(m_stats.rating, againstRating);

- // calculate the rating modification (ELO system with k=32)

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

+ float K;

+ if (m_stats.rating<1000)

+ K=48.0f;

+ else K)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));

// modify the team stats accordingly

FinishGame(mod);

m_stats.wins_week += 1;

@@ -558,8 +562,12 @@ int32 ArenaTeam::LostAgainst(uint32 againstRating)

// called when the team has lost

//'chance' calculation - to loose to the opponent

float chance = GetChanceAgainst(m_stats.rating, againstRating);

- // calculate the rating modification (ELO system with k=32)

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

+ float K;

+ if (m_stats.rating<1000)

+ K=48.0f;

+ else K)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));

// modify the team stats accordingly

FinishGame(mod);

@@ -576,7 +584,11 @@ void ArenaTeam::MemberLost(Player * plr, uint32 againstRating)

{

// update personal rating

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

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

+ float K;

+ if (personal_rating<1000)

+ K=48.0f;

+ else K)32.0f;

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

itr->ModifyPersonalRating(plr, mod, GetSlot());

// update personal played stats

itr->games_week += 1;

@@ -598,7 +610,11 @@ void ArenaTeam::OfflineMemberLost(uint64 guid, uint32 againstRating)

{

// update personal rating

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

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

+ float K;

+ if (personal_rating<1000)

+ K=48.0f;

+ else K)32.0f;

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

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

itr->personal_rating = 0;

else

@@ -620,7 +636,11 @@ void ArenaTeam::MemberWon(Player * plr, uint32 againstRating)

{

// update personal rating

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

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

+ float K;

+ if (personal_rating<1000)

+ K=48.0f;

+ else K)32.0f;

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

itr->ModifyPersonalRating(plr, mod, GetSlot());

// update personal stats

itr->games_week += 1;

Link to comment
Share on other sites

thank you very much.. sounds like you're pretty sure (and yes, you are mad :P - but all mathematicians are mad anyway.. ^^)

i will wait some days with implementing it this time.. so maybe other users have better ideas and so on

for implementation:

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

and great that you've found this.. i don't have any idea how to get those formulas (:

Link to comment
Share on other sites

Guest
This topic is now 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. Privacy Policy Terms of Use