Team Ranking
-
I think this has actually been answered before, but for some reason, I just can’t seem to figure it out.
Points
When we add or take away points from the team (For whatever reason), shouldn’t it effect the team ranking?For example, I have 2 teams that have an equal amount of wins. Team 1 has beaten Team 2, so I want to add a single point to Team 1 so they rise in the standings.
At this point, when I add points to a team, no matter how many I add, it doesn’t do anything in the rankings.
-
Even if manually adding points is the way to adjust the team standings, shouldn’t there be a way to have the program calculate standings properly without adding points?
If it doesn’t change the PCT function it is probably OK, but then since all players can view the standings and calculate the points it will generate confusion….
I went into the SQL database and the leaguemanager_teams table for my league. The only difference I could find between the two teams that are tied (but with different for and against runs) is that the points2_plus and the point2_minus fields are different.
One team has 1 for both and one team has 9 for both fields. Not sure if this is what is being used to rank them or not.
@ intellicents the baseball.php file hasn’t been updated in the main code in over two years according to what I’m seeing and there’s no ‘Sort_Numeric’ in any of the code I have. Can you send me the file you have? Something’s not right…
@unimaxx – the best answer I can give you is that the baseball.php ‘sport’ file is incomplete at best. I spent a bunch of time with it last night and feel that there are a few things that need to be addressed. I’m also splitting out a softball file, so that we can keep the sports separate (my wife is a middle school softball coach and I coach Senior American Legion, I know better that to keep them together!) and have different rules for ranking.
What I see in putting a league together for softball is that when I go to update scores I’m asked the score and then the runs for and runs against, then something for shutouts. Two things, if I put the score in, I already put in the runs for and runs against, so that’s not needed and if I need to track shutouts all I need to do is calculate the number of games my opponent didn’t score. Seems we can eliminate a few steps in the process…
I’m going to have the system calculate the standings like this in the softball ‘sport’ for right now, until I can figure out how to work with some other options like head-to-head:
Win Percentage
# Games won
Points
# Games lost (descending)The default points will be two for a win, one for a tie
Let me know if that works for you guys for now, we can update as needed.
@lamonte, I may have inadvertently tried using the code you had for basketball in another thread.
This is all I have on the rankTeams function:
function rankTeams( $teams ) { foreach ( $teams AS $key => $row ) { $won[$key] = $row->won_matches; $lost[$key] = $row->lost_matches; } array_multisort( $won, SORT_DESC, $lost, SORT_ASC, $teams ); return $teams; }
I tried that code (from basketball) as well, but the team ranking didn’t change and I tried removing a score and then re-entering it.
I like what LaMonte has suggested, but have asked for concurrence from our league president. However some questions:
1. Why do we need points if it is not used in the ranking….
2. In order to ensure fair ranking and to incent teams to submit their scores then I would suggest including a minimum # of games be played prior to ranking (# used could be an option-able entry), or games back could be used, or game differential could also be used or the points system could be used . How fair is it if a team that has played and won a single game and is tied with a team that has played 10 games and won all 10?Possibly a system that could take into account multiple groups so that teams that are within 5 games back of the leader would be ranked, then between 5 and 10 and then the rest. Not sure how that would work or if it is even doable….
As of this moment, we’re using the points in order to manipulate the standings. As we continue to work on the code, that will change.
What we are hoping for is a system that will fully generate fair standings based on certain criteria.
Having the option to set a certain number of games would be awesome. We usually play 14 games, so taking that into account when viewing standings would be a good thing. I just don’t think it’s something that should be priority.
The first thing we need to figure out is how to automatically generate fair standings based on the most basic rules of the game.
Softball and Baseball are similar in that the team with the most wins is in first place. So, what happens when 2 teams or even 3 teams are tied for first place?
Just like our league, the team with the most head-to-head wins will be in 1st place. One of the biggest complaints we get is when a team in 2nd place has the same record as the team in first place, yet the 2nd place team has beaten the 1st place team. As you can see, that wouldn’t be very fair.
So in my opinion, we need to look first at the games played, the winning percentage and head-to-head victories.
I have a new softball file that I would like you guys to test. It’s radically different, to say the least…
Here’s what I’ve done (this is most likely incomplete):
1). Took out the entries for Runs For, Runs Against and Shut outs. That’s what the score is for, no point re-entering the data.
2). Updated the Win Percentage formula and format.
3). Updated the Games Behind formula and format.
4). Fixed where Runs For and Runs Against come from in the code, added Diff as a column in the standings.
5).The ‘sort’ has changed quite a bit. Here’s what it down’s now:
Win Percentage, SORT_DESC
# Games Won, SORT_DESC
# Points, SORT_DESC (teams are given two points for a win and one for a tie)
Games Lost, SORT_ASC
Run Differential, SORT_DESCThis is a temp fix that includes basic ranking. To start calculating head-to-head tie breaks will be a nightmare, but I have some ideas on how to implement it on a wide scale. The problem with tie breakers is everyone is different. What I’d like to do is build a series of potential tie breakers and allow the user to pick what they want to use. That way they can be added to as needed (keeping with the modular nature of the rest of the plug in). There actually is some very basic tie breaking code in the core that I’ll use to add head-to-head, but I’ll work on that over the weekend…
I have to fix one more thing and then I’ll post it on pastebin…
LaMonte, you are simply awesome!!!
Hola. Perdón, pero no sé inglés. He utilizado el traductor para seguiros.
Enhorabuena por el plugin, es una maravilla.
Quería comentaros en las ligas de fútbol (soccer), al menos en las de Espa?a, ocurre un problema parecido: en caso de empate a puntos, se miran primero los resultados entre los equipos empatados y, en caso de seguir empatados, entonces sí la diferencia de goles a favor y goles en contra en el total de la Liga.
Y, claro, aquí no podemos modificar los puntos (sumándoles +1, por ejemplo) porque es la primera columna de la clasificación por la que se ordenan los equipos.
?Se os ocurre alguna solución?
Hi Xabir,
The marvels of an online translator never cease to amaze me…
The tie-breaker issue is a massive one and I basically got about four hours of sleep all weekend working on it. My plan is to have a way to pick the tie-breakers that your particular sport/league needs out of a list of possibilities that we’d be able to add on to. I’m close to having a solution for ties between two teams, but things get complicated when there are more than two teams involved. My experience is with European basketball, and over the last season I’ve dealt with a number of situations that I’d like to deal with.
My other thoughts are once we have the tie-breaker handled, it would be nice to have a ‘simulated week’ where a user could enter simulated results of upcoming matches to see how the tie-breakers would play out. That’s a long-term wish list, but considering the amount of time I’ve spent on spreadsheets going over possible outcomes in various leagues, it would be more than worth it…
Anyway, the thing with LeagueManager is, much of the power in the system lies in the fact that the ‘sport’ files control how things work. The plan is to have tie-breakers linked to the sport, so for instance, we’d get the full list of FIFA tie-break scenarios, build them into the system, and then anyone doing anything with football(soccer), could use those rules if they wanted to. Maybe we can also give independent leagues reason to go with standardized tie-break rules instead of making them up themselves, so that there aren’t 100,000,000,000 different sets of rules. OK, that’s wishful thinking, but I think you can follow what I’m thinking.
The bottom line for you is once I get the tie-break code working where I can set a rule and actually have the system reorder the teams based on the rule, we’ll get something working for you. I’m close to getting things working, so I expect to be able to have something moving forward this week that we can get tested.
Good to hear from you, and thank you for using LeagueManager…
I just don’t see how you will ever get everyone to agree to a standardized tiebreaker. In a league that I am in with just 10 teams, we had 4 different opinions on how the tiebreakers should be done. I think that if you dont have some sort of flexibility, then you will end up with a hundred requests asking for method A or method B or Method C, etc. Thats just my 2 cents for whatever decision you decide to go with.
And as a footnote, even here in the US, professional football, baseball, hockey and basketball all use different tiebreakers.
Agreed, that’s why the plan to have multiple methods and the ability for the user to pick which to use…
Each sport has a different way of handling tie-breakers, which is why the sport files will be increasingly more important as time goes on. My point was that it would be great if leagues within a similar sport could have a standard tie-breaker system. I know in the leagues I’ve been involved in over the years we’ve never had any similarity, down to the point that we had a County Championship determined by a coin flip a few years ago.
Thanks for the feedback…
Hi all, just an update on this problem, or actually we should call it an enhancement since we’re making things better, shouldn’t we…
Anyway, I’ve spent a great deal of time on this and am pretty close to having the basics working, just one problem I’ve spent a couple days working on that I’m not getting through. Once I do, I’ll be able to focus on adding a couple of tie-breaker rules to a file that will house all the rules that we can need and can figure out how to implement (if that makes any sense). The point is that it’s been a challenge, but one I think is very important, so instead of putting a band-aid on it, I tackled it to just do what needed to be done. I’m hopeful that this will be a nice new feature that we’ll have soon.
Sorry for the delay, but I think it’ll be worth the extra days.
LaMonte
Hi LaMonte,
I’m another one waiting for this great achievement.
Regards.Hi again Lamonte.
I reed again your reply to Xabir.
I just have the exact same problem and I have a league running live with wrong rankings due to the the tie between two teams games.
I understand and appreciate what you are doing, and the whole strategy for tie-break scenarios.
But in order to solve now my problem, can you post the code for 2 teams ties, that I could include in soccer.php rank teams. Is that possible?Thanks.
Hi LaMonte.
You must be busy, but the wait has made me appreciate the current scoring system a bit better. After giving it some thought and viewing the way that rankings are calculated for softball I note the following:
A team that has played more games but has a worse win/loss ratio may be ranked higher than another. That is, a team that has played 2 games and won both would be ranked lower than a team that has won 8 out of 10 games. I think this method is fair, but obviously is an issue for teams that are relatively close in games. This has led to some controversy in our league. Rainouts and injuries mean that teams during regular league play will not play the same amount of games.
For the most part that is fine. However, I also note that two teams that have played the same number of games, with the same win/loss record and the same number of points are ranked 1 and 2. I am assuming that the higher ranked team is due to the higher number of runs for. Shouldn’t this be marked as a tie?
And likewise, why are two teams ranked as a tie with an uneven number of games played and with different win/loss records, but with the same amount of points (one for a win, nothing for a loss and nothing for a tie).This is confusing. I know you had indicated the scoring system is incomplete, but how the devil are the standings calculated?
Any update on the new code?
- The topic ‘Team Ranking’ is closed to new replies.