Bug in cup tag <group> check with teams of similar names in the same group
Posted: Sat Oct 31, 2020 4:03 am
Hello all.
Let's just say that I found a most mysterious bug that I never expected. The best way to describe a bug is that it isn't a bug until someone finds it. Well, I found this one. Let me give you some backstory to this one.
I was playing my test game for my new definitions for England, as well as the new UEFA cups (Champions League and Europa League) that are now corrected and work. In addition, I was using my FIFA Club World Cup files, which are also part of my definitions I'll be releasing.
With the European definitions, they have the international cups of UEFA Champions League and UEFA Europa League, which have the tag of <group> listed with a value of 1. When I checked the old South American definitions, their international cups of Copa Libertadores and Copa Sudamericana also have the <group> tag listed with a value of 1, but since the two continental definitions never really played together, it likely was never a problem. Well, since I'm trying to change that with my FIFA Club World Cup files, I currently do have the Copa Libertadores run during the season as part of the Club World Cup qualifiers, and it runs concurrent to the UEFA cup files. As both the UEFA cup files and Copa Libertadores each belong to <group> 1, it would be assumed that no team will be selected twice to either tournament when randomly selected, which would be true. But, there's a catch. The catch is the bug that I found.
As I am playing definitions from England, they have two team names in particular of Everton and Liverpool, both in the Premier League. It appears that there is a team named "Everton" in Chile, which is currently listed in Chile's league1 file, and there is a team named "Liverpool", which is listed in Uruguay's league1 file also. I mention this as if you were to think about this, you might ask yourself how would a team from South America with the same name as an English Premier League side affect the game in any way, if you were to play as Everton or Liverpool. Well, as both international cups (UEFA cups and Copa Libertadores) are being assigned the <group> value of "1" and they are running concurrently, and the Copa Libertadores are being loaded first before the UEFA cups, at least in my definitions, then if you play as Everton or Liverpool in the English definitions and either of the two teams from South America are loaded into the Copa Libertadores tournament, you won't be able to participate in the UEFA cups, even if you qualify. See, a bug. This one really threw me for a loop until I was able to see the debug information myself.
So now to the nitty gritty. Even though the team names are identical in spelling yet located in separate cup files and come from different countries, the <group> check is flagging the team names and not allowing the second one to be selected. This can potentially be a problem as even within the same regions, some team names may be similar to others yet be located in other countries.
In my example, as I said, I'm playing my English definitions. As the zipfile for my test game is about 1.3 megs in size, it is too large to post here. Oh well. But, I will include the debug information too, although edited. As I am going from the end of season 3 to the beginning of season 4, the following teams have qualified for the UEFA cups in their respective places:
Premier League: 1st to 5th places: Everton, Southampton, Fulham, C. P. London, Liverpool
Premier League: 6th to 8th places: Manchester C., A. V. Birmingham, A. London
FA Cup: winner: Southampton loser: Everton
FA Cup: 3rd and 4th places: Swansea, A. London
EFL Cup: winner: Everton loser: Fulham
EFL Cup: 3rd and 4th places: Manchester C., Sheffield
Ok. So from my code, the first 4 teams in the Premier League would qualify for the Champions League. The 5th placed team would qualify for the Europa League. The FA Cup winner (or best not yet qualified) and the EFL Cup winner (or best not yet qualified) would also qualify for the Europa League. So, in my code, the qualified teams SHOULD be Everton, Southampton, Fulham, and C. P. London, who qualify for the Champions League. Liverpool, (Swansea or A. London), and (Manchester C. or Sheffield) should be the other three teams that qualify for the Europa League. But alas, it doesn't happen because of this bug.
Now, the relevant debug info is below:
This is the reference point to where "Everton" is being loaded for the 4th season. Again, this is the "Everton" from the league file of chile1. As you can see, the cup is named the Copa Libertadores, which is not a UEFA tournament:
"cup_get_team_pointers: Copa Libertadores round 1 team 7 Everton (clid 7025)"
This is the point in the definitions that the teams are drawn from the LEAGUE1 file. You can see the reference to Everton failing to be loaded because it "exists" in another cup file:
"cup_load_choose_team: UEFA Champions League, LEAGUE1, teams 1 to 6, random: 0
cup_get_choose_team_league_cup: sid LEAGUE1 league Premier League
team Everton group 1 found in Copa Libertadores
j 0 order 0 team Everton isinint 1 numteams 0
team Everton group 1 found in Copa Libertadores
j 1 order 1 team Southampton isinint 0 numteams 0
j 2 order 2 team Fulham isinint 0 numteams 1
j 3 order 3 team C. P. London isinint 0 numteams 2
j 4 order 4 team Liverpool isinint 0 numteams 3"
These are the reference points to the teams above:
"cup_get_team_pointers: UEFA Champions League round 3 team 0 Southampton (clid 1001)
cup_get_team_pointers: UEFA Champions League round 3 team 1 Fulham (clid 1001)
cup_get_team_pointers: UEFA Champions League round 3 team 2 C. P. London (clid 1001)
cup_get_team_pointers: UEFA Champions League round 3 team 3 Liverpool (clid 1001)"
This is the part when the League Cup winner is loaded in the Europa League:
"cup_load_choose_team: UEFA Europa League, england_league, teams 1 to 9, random: 0
cup_get_choose_team_league_cup: sid england_league cup EFL Cup
team Everton group 1 found in Copa Libertadores
team Fulham group 1 found in UEFA Champions League
cup_load_choose_team: 0 Sheffield"
and its reference point:
"cup_get_team_pointers: UEFA Europa League round 2 team 0 Sheffield (clid 1001)"
This is the last part for the Europa League qualifiers:
"cup_load_choose_team: UEFA Europa League, england_fa, teams 1 to 9, random: 0
cup_get_choose_team_league_cup: sid england_fa cup FA Cup
team Southampton group 1 found in UEFA Champions League
team Everton group 1 found in Copa Libertadores
cup_load_choose_team: 0 Swansea
cup_load_choose_team: UEFA Europa League, england1, teams 5 to 9, random: 0
cup_get_choose_team_league_cup: sid england1 league Premier League
team Liverpool group 1 found in UEFA Champions League
j 0 order 4 team Liverpool isinint 1 numteams 0
team Liverpool group 1 found in UEFA Champions League
j 1 order 5 team Manchester C. isinint 0 numteams 0
cup_load_choose_team: 1 Manchester C."
along with their reference points:
"cup_get_team_pointers: UEFA Europa League round 5 team 0 Swansea (clid 1001)
cup_get_team_pointers: UEFA Europa League round 5 team 1 Manchester C. (clid 1001)"
Ok. So as you can see above, the <group> check which checks for duplicate entries doesn't appear to go far enough, because even though the same two teams are spelled the same, they are clearly from different areas as the clid numbers attached to the teams are different. So, what factors are checked with the <group> tag I might ask? Maybe it might be wise to see what can be added to the <group> check so that something like this may not happen again. At least the team's country sid or league sid could be compared between teams that might share the same name so that if at least the league or country sid is different, then clearly the teams themselves are different, even if they share the same name.
Going forward, this is an annoying bug until it gets resolved. All I can think of doing is that I will have to use different <group> values for the different regions and cups or else when trying to interconnect them like this, this bug can pop up again. Oh well.
So for now, that's all. Hopefully you can figure out how to fix this bug. As my game file was too big to post, if you wanted to see it, I can likely e-mail it to you if I still have it when you ask, which at the moment, I still have it. Bye for now,
will_the_canuck
Let's just say that I found a most mysterious bug that I never expected. The best way to describe a bug is that it isn't a bug until someone finds it. Well, I found this one. Let me give you some backstory to this one.
I was playing my test game for my new definitions for England, as well as the new UEFA cups (Champions League and Europa League) that are now corrected and work. In addition, I was using my FIFA Club World Cup files, which are also part of my definitions I'll be releasing.
With the European definitions, they have the international cups of UEFA Champions League and UEFA Europa League, which have the tag of <group> listed with a value of 1. When I checked the old South American definitions, their international cups of Copa Libertadores and Copa Sudamericana also have the <group> tag listed with a value of 1, but since the two continental definitions never really played together, it likely was never a problem. Well, since I'm trying to change that with my FIFA Club World Cup files, I currently do have the Copa Libertadores run during the season as part of the Club World Cup qualifiers, and it runs concurrent to the UEFA cup files. As both the UEFA cup files and Copa Libertadores each belong to <group> 1, it would be assumed that no team will be selected twice to either tournament when randomly selected, which would be true. But, there's a catch. The catch is the bug that I found.
As I am playing definitions from England, they have two team names in particular of Everton and Liverpool, both in the Premier League. It appears that there is a team named "Everton" in Chile, which is currently listed in Chile's league1 file, and there is a team named "Liverpool", which is listed in Uruguay's league1 file also. I mention this as if you were to think about this, you might ask yourself how would a team from South America with the same name as an English Premier League side affect the game in any way, if you were to play as Everton or Liverpool. Well, as both international cups (UEFA cups and Copa Libertadores) are being assigned the <group> value of "1" and they are running concurrently, and the Copa Libertadores are being loaded first before the UEFA cups, at least in my definitions, then if you play as Everton or Liverpool in the English definitions and either of the two teams from South America are loaded into the Copa Libertadores tournament, you won't be able to participate in the UEFA cups, even if you qualify. See, a bug. This one really threw me for a loop until I was able to see the debug information myself.
So now to the nitty gritty. Even though the team names are identical in spelling yet located in separate cup files and come from different countries, the <group> check is flagging the team names and not allowing the second one to be selected. This can potentially be a problem as even within the same regions, some team names may be similar to others yet be located in other countries.
In my example, as I said, I'm playing my English definitions. As the zipfile for my test game is about 1.3 megs in size, it is too large to post here. Oh well. But, I will include the debug information too, although edited. As I am going from the end of season 3 to the beginning of season 4, the following teams have qualified for the UEFA cups in their respective places:
Premier League: 1st to 5th places: Everton, Southampton, Fulham, C. P. London, Liverpool
Premier League: 6th to 8th places: Manchester C., A. V. Birmingham, A. London
FA Cup: winner: Southampton loser: Everton
FA Cup: 3rd and 4th places: Swansea, A. London
EFL Cup: winner: Everton loser: Fulham
EFL Cup: 3rd and 4th places: Manchester C., Sheffield
Ok. So from my code, the first 4 teams in the Premier League would qualify for the Champions League. The 5th placed team would qualify for the Europa League. The FA Cup winner (or best not yet qualified) and the EFL Cup winner (or best not yet qualified) would also qualify for the Europa League. So, in my code, the qualified teams SHOULD be Everton, Southampton, Fulham, and C. P. London, who qualify for the Champions League. Liverpool, (Swansea or A. London), and (Manchester C. or Sheffield) should be the other three teams that qualify for the Europa League. But alas, it doesn't happen because of this bug.
Now, the relevant debug info is below:
This is the reference point to where "Everton" is being loaded for the 4th season. Again, this is the "Everton" from the league file of chile1. As you can see, the cup is named the Copa Libertadores, which is not a UEFA tournament:
"cup_get_team_pointers: Copa Libertadores round 1 team 7 Everton (clid 7025)"
This is the point in the definitions that the teams are drawn from the LEAGUE1 file. You can see the reference to Everton failing to be loaded because it "exists" in another cup file:
"cup_load_choose_team: UEFA Champions League, LEAGUE1, teams 1 to 6, random: 0
cup_get_choose_team_league_cup: sid LEAGUE1 league Premier League
team Everton group 1 found in Copa Libertadores
j 0 order 0 team Everton isinint 1 numteams 0
team Everton group 1 found in Copa Libertadores
j 1 order 1 team Southampton isinint 0 numteams 0
j 2 order 2 team Fulham isinint 0 numteams 1
j 3 order 3 team C. P. London isinint 0 numteams 2
j 4 order 4 team Liverpool isinint 0 numteams 3"
These are the reference points to the teams above:
"cup_get_team_pointers: UEFA Champions League round 3 team 0 Southampton (clid 1001)
cup_get_team_pointers: UEFA Champions League round 3 team 1 Fulham (clid 1001)
cup_get_team_pointers: UEFA Champions League round 3 team 2 C. P. London (clid 1001)
cup_get_team_pointers: UEFA Champions League round 3 team 3 Liverpool (clid 1001)"
This is the part when the League Cup winner is loaded in the Europa League:
"cup_load_choose_team: UEFA Europa League, england_league, teams 1 to 9, random: 0
cup_get_choose_team_league_cup: sid england_league cup EFL Cup
team Everton group 1 found in Copa Libertadores
team Fulham group 1 found in UEFA Champions League
cup_load_choose_team: 0 Sheffield"
and its reference point:
"cup_get_team_pointers: UEFA Europa League round 2 team 0 Sheffield (clid 1001)"
This is the last part for the Europa League qualifiers:
"cup_load_choose_team: UEFA Europa League, england_fa, teams 1 to 9, random: 0
cup_get_choose_team_league_cup: sid england_fa cup FA Cup
team Southampton group 1 found in UEFA Champions League
team Everton group 1 found in Copa Libertadores
cup_load_choose_team: 0 Swansea
cup_load_choose_team: UEFA Europa League, england1, teams 5 to 9, random: 0
cup_get_choose_team_league_cup: sid england1 league Premier League
team Liverpool group 1 found in UEFA Champions League
j 0 order 4 team Liverpool isinint 1 numteams 0
team Liverpool group 1 found in UEFA Champions League
j 1 order 5 team Manchester C. isinint 0 numteams 0
cup_load_choose_team: 1 Manchester C."
along with their reference points:
"cup_get_team_pointers: UEFA Europa League round 5 team 0 Swansea (clid 1001)
cup_get_team_pointers: UEFA Europa League round 5 team 1 Manchester C. (clid 1001)"
Ok. So as you can see above, the <group> check which checks for duplicate entries doesn't appear to go far enough, because even though the same two teams are spelled the same, they are clearly from different areas as the clid numbers attached to the teams are different. So, what factors are checked with the <group> tag I might ask? Maybe it might be wise to see what can be added to the <group> check so that something like this may not happen again. At least the team's country sid or league sid could be compared between teams that might share the same name so that if at least the league or country sid is different, then clearly the teams themselves are different, even if they share the same name.
Going forward, this is an annoying bug until it gets resolved. All I can think of doing is that I will have to use different <group> values for the different regions and cups or else when trying to interconnect them like this, this bug can pop up again. Oh well.
So for now, that's all. Hopefully you can figure out how to fix this bug. As my game file was too big to post, if you wanted to see it, I can likely e-mail it to you if I still have it when you ask, which at the moment, I still have it. Bye for now,
will_the_canuck