UEFA club definitions 2020/21

Forum devoted to country/league/cup/team definition topics. You can also get help here if you have trouble writing or using a definition.
Post Reply
billys_boots
Posts: 105
Joined: Wed Apr 17, 2019 4:45 pm

UEFA club definitions 2020/21

Post by billys_boots »

I am currently working on updating the UEFA club competition (Champions League and Europa League) definitions and I am using the UEFA allocations for 2020/19, which is when the new UEFA country coefficients take effect. The way teams progress through the qualifying rounds for both competitions is complex, to say the least. At the moment I am working on the Champions League which I have working until I reach the Group Stage.

This is how the Champions League progresses :
Preliminary round - 4 champions from associations 52–55 enter, 2 one off semi finals and a 1 off final

First qualifying round - 33 champions from associations 18–51 enter (Liechtenstein are exempt) plus winner from the preliminary round.

Second qualifying round (Champions path) 3 champions from associations 15–17 plus 17 winners from the first qualifying round
Second qualifying round (League path) 6 runners-up from associations 10–15

Third qualifying round (Champions path) 2 champions from associations 13–14 plus 10 winners from the second qualifying round (Champions Path)
Third qualifying round (League path) 3 runners-up from associations 7–9 and 2 fourth-placed teams from associations 5–6 plus 3 winners from the second qualifying round (League Path)

Play-off round (Champions path) 2 champions from associations 11–12 plus 6 winners from the third qualifying round (Champions Path)
Play-off round (League path) 4 winners from the third qualifying round (League Path)

All these rounds I have managed to get to work but to do this I had to create 2 separate files, a Champions path, which includes the Preliminary and First Qualifying rounds and a League path. Creating 2 separate cups allows them to run simultaneously. The problem I am having is at the next stage

The group stage and knockout rounds are a new file
Group Stage - Ten champions from associations 1–10, six runners-up from associations 1–6, four third-placed teams from associations 1–6 four fourth-placed teams from associations 1–4 plus the 4 winners from the play-off round (Champions Path) and 2 winners from the play-off round (League Path). I have omitted the Champions League holders and Europa League holders from the previous season and increased the allocations of associations 5 and 6

When the draw for the group stage is made I am getting two groups of 4 and six groups of 3, the teams from the play-off rounds are not being transferred to the new file? I have tried using the existing code from the UEFA Cup definitions as part of the Champions League definition

<choose_team>
<!--4 winners from the champions path-->
<choose_team_sid>europe_champ_league_cp*</choose_team_sid>
<wait_for_cup round="6">europe_champ_league_cp*</wait_for_cup>
<add_week>1000</add_week>
<skip_group_check>1</skip_group_check>
<preload>0</preload>
<number_of_teams>4</number_of_teams>
<start_idx>1</start_idx>
<end_idx>4</end_idx>
</choose_team>

<choose_team>
<!--2 winners from the league path-->
<choose_team_sid>europe_champ_league_lp*</choose_team_sid>
<wait_for_cup round="3">europe_champ_league_lp*</wait_for_cup>
<add_week>1000</add_week>
<skip_group_check>1</skip_group_check>
<preload>0</preload>
<number_of_teams>2</number_of_teams>
<start_idx>1</start_idx>
<end_idx>2</end_idx>
</choose_team>
</choose_teams>

The <add_week> tag makes no difference whatever value I give it. I have tried 1000, the week number which is 11 and also omitted this tag. A tag of 1000 means the group stage is completely ignored. I know that the code above is taken from a league definition and this is a cup definition and this could be it's limitation, maybe this can be confirmed.

I would like to resolve this before writing the Europa League definitions because that work in a similar way but is more complex. Any help or input would be appreciated.

The UEFA allocations can be found at https://en.wikipedia.org/wiki/2020%E2%8 ... ons_League
will_the_canuck
Posts: 141
Joined: Tue Jan 16, 2018 5:54 am
Location: Canada

Re: UEFA club definitions 2020/21

Post by will_the_canuck »

billys_boots wrote:I am currently working on updating the UEFA club competition (Champions League and Europa League) definitions and I am using the UEFA allocations for 2020/19, which is when the new UEFA country coefficients take effect. The way teams progress through the qualifying rounds for both competitions is complex, to say the least. At the moment I am working on the Champions League which I have working until I reach the Group Stage.
I applaud you for working on this as really, it CAN use an update. I potentially have plans to maybe update it too, but not for some time after a few other things get worked on and gathered, like next year. :)
All these rounds I have managed to get to work but to do this I had to create 2 separate files, a Champions path, which includes the Preliminary and First Qualifying rounds and a League path. Creating 2 separate cups allows them to run simultaneously. The problem I am having is at the next stage
Now having it set up the way you do made me think a bit and when I do think of it, it is fair in a way as it relates to bans and red cards and yellow card accumulation for the players and the teams...they get to start anew in the group stage with zero accumulation since technically, the new cup definition would be a new cup and their previous accumulations, if any, would be cleared. Alternatively, you could have had the League Path teams merge with the Champion Path teams and keep the one cup file, but as I said, having it set up the way you do is fairer based on yellow and red card accumulations. Although for my usage, at least for the one I'm thinking of, I might keep it all in one file, to a point.

And for you having a problem with it, this is likely the only reason I'm responding to this now since I won't really be making any definitions myself for at least a few months, if not until next year. Looking at what you wrote, I don't think you're properly understanding the code and whether or not you could resolve it on your own, I don't know. :) Depends on how long it would take you and how many tests you'd be willing to run. So, let me give you my thoughts on it and see where it might lead you.
The group stage and knockout rounds are a new file
Group Stage - Ten champions from associations 1–10, six runners-up from associations 1–6, four third-placed teams from associations 1–6 four fourth-placed teams from associations 1–4 plus the 4 winners from the play-off round (Champions Path) and 2 winners from the play-off round (League Path). I have omitted the Champions League holders and Europa League holders from the previous season and increased the allocations of associations 5 and 6
I will say I was testing to see if it was possible to have an international cup winner load up in an international cup for the following season, but so far, it hasn't been successful. I might try it again later with some different variations but for now, I'll let it sit since it isn't a priority to me or any definitions I'm working on. Though if I can not succeed in it, I'll have to redesign my CONCACAF cups for the USA definitions since some tournaments are played in one calendar year and some of those winners are then forwarded to the CONCACAF Champions League tournament which leads to the FIFA Club World Cup, which takes place the following calendar year. So if I can't resolve this issue, I'll have to redesign the cups to be in the same season. I guess with me in respects to the UEFA Champions League, and subsequently the Copa Libertadores of CONMEBOL, I would likely just use random teams for the title holders' spots and leave it as it is.
When the draw for the group stage is made I am getting two groups of 4 and six groups of 3, the teams from the play-off rounds are not being transferred to the new file? I have tried using the existing code from the UEFA Cup definitions as part of the Champions League definition

<choose_team>
<!--4 winners from the champions path-->
<choose_team_sid>europe_champ_league_cp*</choose_team_sid>
<wait_for_cup round="6">europe_champ_league_cp*</wait_for_cup>
<add_week>1000</add_week>
<skip_group_check>1</skip_group_check>
<preload>0</preload>
<number_of_teams>4</number_of_teams>
<start_idx>1</start_idx>
<end_idx>4</end_idx>
</choose_team>

<choose_team>
<!--2 winners from the league path-->
<choose_team_sid>europe_champ_league_lp*</choose_team_sid>
<wait_for_cup round="3">europe_champ_league_lp*</wait_for_cup>
<add_week>1000</add_week>
<skip_group_check>1</skip_group_check>
<preload>0</preload>
<number_of_teams>2</number_of_teams>
<start_idx>1</start_idx>
<end_idx>2</end_idx>
</choose_team>
</choose_teams>

The <add_week> tag makes no difference whatever value I give it. I have tried 1000, the week number which is 11 and also omitted this tag. A tag of 1000 means the group stage is completely ignored. I know that the code above is taken from a league definition and this is a cup definition and this could be it's limitation, maybe this can be confirmed.
Ok. Here is the coding you did for the cup files above, that was supposed to allow the teams from the respective cups join the new cup file. Below is the coding from the UEFA Cup file for the two references that allow teams from the UEFA Champions League to join the UEFA Cup at the points that they do:

Code: Select all

       <choose_team>
          <!--16 losers of the UCL 3rd qualifying round that enter the 1st round proper of the UEFA Cup-->
          <choose_team_sid>europe_champ_league*</choose_team_sid>
          <wait_for_cup round="3">europe_champ_league*</wait_for_cup>
          <skip_group_check>1</skip_group_check>
          <preload>0</preload>
          <number_of_teams>16</number_of_teams>
          <start_idx>17</start_idx>
          <end_idx>32</end_idx>
        </choose_team>
and

Code: Select all

        <choose_team>
          <!--3rd-placed teams in the UCL group stage that join the 1st knockout round of UEFA Cup-->
          <choose_team_sid>europe_champ_league*</choose_team_sid>
          <skip_group_check>1</skip_group_check>
          <preload>0</preload>
          <number_of_teams>8</number_of_teams>
          <start_idx>17</start_idx>
          <end_idx>24</end_idx>
        </choose_team>
First off, I'll pick you apart and say that with the references to the coding above, do you see anywhere the <add_week> tag as in your example? The answer is no because the <add_week> tag is used in the header section of the cup definition file. It isn't used in the manner of which you used it here. In your example, you don't even need the <wait_for_cup> tag because in your example, the cups would be completed even before your new cup would start, so all you need are the leaders that you call in the <start_idx> and <end_idx> tags. The way you would code this would be similar to the example where the 3rd placed teams from the UCL group stage are joining the UEFA cup. I'll add that with regards to the <wait_for_cup> tag, my thoughts on this one are that it is used when you want to add teams from a point that not all teams have been added yet, like in this example. Since you have teams that have yet to be added, you only want the specific teams out of a specific range, that won't include the entire list since they haven't played yet and are not yet counted, at least by a certain numbered round. That's why in the first example, they load teams numbered 17 to 32 but in the second example, they load teams numbered 17 to 24. As more teams were loaded in the second example, those teams from the first example would no longer be in the 17 to 32 range but further down the list now, but at the time of the particular numbered round, that's where they stood.

I should also add that because the manner in which you want to code this tournament, the <last_week> tag will have different values for the first two cups in comparison to the last cup. By that I mean you can have a <last_week> tag that will end say around week 15 to 20 for the Champions Path and League Path because they shouldn't go any further than that, per say. And the Group Stage cup will have a normal <last_week> value of somewhere in the 40s, wherever you want it to end. It won't start until after the previous two cups before it has ended anyways since the leaders of the previous two cups will enter the latter cup and continue on in the competition. And I should add that all three cups will have an <add_week> value of 0 (zero) in the cup header section of the respective cup files.

But before you do that, you need to understand and comprehend a few things. :) There is always understanding required. As the UEFA Champions League and UEFA Cup are part of the same grouping, the <group>1</group> tag found in the header section of the cup definition, so too must your three files also be a part of the same grouping, in addition to your UEFA Cup / Europa League file(s). This is because as you created/generated so many new teams for the Champions Path and League Path, you still have more teams to play their first match in the Group Stage that you would have created at week 0 (zero) through the <add_week> tag in the cup's header section. Failing this, you could potentially create an error as some leagues may still be running at the time you start your Group Stage cup, at least for the teams/countries that would first begin their competition in the Group Stage. So hopefully this helps.
I would like to resolve this before writing the Europa League definitions because that work in a similar way but is more complex. Any help or input would be appreciated.

The UEFA allocations can be found at https://en.wikipedia.org/wiki/2020%E2%8 ... ons_League
Now hopefully my explanation was correct, as personally I haven't tried it and won't try it out myself until much later when I actually want or need to do similar coding. :) I'm just saying what I think the code represents and how I see the code and feel how it works. So, did it work? And if it worked, how far would you have gotten without this explanation? Or how many trials would you have tried? Might you have given up and thought it impossible? :)

Anyways, I've got other things to do and work on so take care for now and enjoy the weekend.

will_the_canuck
billys_boots
Posts: 105
Joined: Wed Apr 17, 2019 4:45 pm

Re: UEFA club definitions 2020/21

Post by billys_boots »

Thanks for your input. I will do some re coding as you suggest and run some test. Luckily I only have run tests up to about week 11 to be able to check if the Group Stage is populated correctly. Once I get the Group Stage working I can test up to the end of a season.

I checked the UEFA regulations and although I didn't take this into account at the time, not until you mentioned it, all yellow and red cards are wiped after the play off rounds so all players start with a clean sheet for the Group Stage, this applies for both the Champions League and the Europa League.

You mention the carrying over of international cup teams from one season to the next. I read through the documentation and it states that national cup files are cleared at the beginning of a season, so week 0 (zero) whereas international cup files are cleared at the end of a season. I didn't bother to pursue this, maybe I will in the future, so to get around the issue of the winners of both the Champions League and the Europa League getting automatic entry in to the following seasons Champions League Group Stage, instead I increase the number of teams of the 5th and 6th nations in the UEFA rankings from 3 to 4 and adjusted the allocations of those nations accordingly for the Europa League.

I do have a plan B which works and that is to merge both the champions path and the league path and run the Champions League as one definition from start to finish. I have no plan B for the Europa League as yet.

Thanks for you response, I will update you when I have made changes to the definitions and run some tests.

Take care and have a great weekend.
will_the_canuck
Posts: 141
Joined: Tue Jan 16, 2018 5:54 am
Location: Canada

UPDATE: November 10/2020 Re: UEFA club definitions 2020/21 -- Updated UEFA cup files

Post by will_the_canuck »

UPDATE:

As of November 10, 2020, I have fixed the error that was in my original attempt at redoing the UEFA cup competitions. Furthermore, as the new UEFA cups have been updated to include new countries and league files that are not in the original bygfoot definitions and have even changed since my first attempt, you can read about it in the readme file in the zipfile for more information. Those files are also available in the post for the 2020-2021 San Marino updates, which are located here, in the "Definitions" section. So now, back to my post

Before I begin my reply, I want to post an apology to billys_boots in relation to this topic as I feel I may have been harsh in my previous reply as I was writing what I thought was correct without actually working on this subject myself. It is easy to criticize someone without walking a mile in their shoes. Billys_boots did eventually share his work with me and I did work on it also and ran into the same roadblocks that he faced, although over time, I was able to succeed after trying new things. So although it wasn't easy, it was something worthwhile in doing as it will help me in future definitions I'm hoping to do for my own definitions, when the time comes.
billys_boots wrote: Sat Aug 03, 2019 10:14 pm You mention the carrying over of international cup teams from one season to the next. I read through the documentation and it states that national cup files are cleared at the beginning of a season, so week 0 (zero) whereas international cup files are cleared at the end of a season. I didn't bother to pursue this, maybe I will in the future, so to get around the issue of the winners of both the Champions League and the Europa League getting automatic entry in to the following seasons Champions League Group Stage, instead I increase the number of teams of the 5th and 6th nations in the UEFA rankings from 3 to 4 and adjusted the allocations of those nations accordingly for the Europa League.

I do have a plan B which works and that is to merge both the champions path and the league path and run the Champions League as one definition from start to finish. I have no plan B for the Europa League as yet.
One reason I am replying to this post is to leave a note for future definition developers with regards to this issue. From the above quote, with regards to having the previous seasons' winners of the Champions League and Europa League earn berths in the Champions League group stage, whether it is possible or not, the coding would be murder. And when I think of the requirements of it, I personally think that it would be impossible to code to have the winners earn berths in the group stage for a variety of factors, some of which are currently listed as bugs that I posted about. :) The main one that comes to mind is the "<add_week> = -1" bug. But besides that, just having random teams selected for the berths of the previous seasons' winners would be satisfactory enough I think.

An additional note to the above point is that depending on which country the player was playing from, even if the player won either the Champions League OR the Europa League and they finished first in their league, it might create an issue in that as the winners for the Champions League and Europa League are selected in the Group Stage, there is the chance that as the winner of their league, they could be selected first from a lower round and enter there. When it comes to the Group Stage for the Champions League, the team selected in the place of the winner for the Champions League AND the Europa League would have to be selected from the previous season's rankings for the respective cups. It might be hard to determine whether or not any of the top 4 teams, for example, in the respective cups were already selected in other places in the competition, which if they were, then the program would return a negative value that would cause an error and crash the program. As that is a great unknown, how many places would you go down to select the "winners" of the Champions League and the Europa League? So as there are too many things that COULD go wrong, just having the winners of the previous season's Champions League and Europa League would be best left to a random selection.

As for billys_boots' plan B, to have the Champions League as one definition file from start to finish, that's the wrong way as I already tried that and I discovered an error that I didn't get to see in my initial testing but showed up in my extended testing. I should add that when using one definition file for the Champions League, it will fail when also using one file for the Europa League as the requirements for transferring teams from the Champions League to the Europa League are much different from what they used to be, when compared to the old Champions League and UEFA Cup definitions. Now if you were just using the Champions League file by itself, and not transferring any teams from it, then it would work as a single file.

As billys_boots shared with me definitions to update the UEFA cups from what they are to the planned 3 cup system (Champions League, Europa League, and Europa Conference) in 2021-2022, with each cup having 3 or 4 separate files as part of it, it was ambitious to say the least. I did eventually code the files to the way they would work, if they worked, but in the end, it failed. And from this realization, I could say that the way the planned 2021-2022 Europa league and Europa Conference are laid out, they both can not be coded to properly work.

The original problem that billys_boots ran into, I'm guessing, is that when he encoded the Champions League files originally, all 3 or 4 files would be loaded at week 0 and teams would be loaded in each stage as required. As the group stage file would begin in round 1 of the file, there would be teams that would have to be loaded from week 0 as well as have teams transferred from previous cup rounds played in previous cup files. So as 26 new teams were loaded in the group stage and 6 teams would be advancing from the previous cup files, only those 26 teams that were loaded from week 0 were showing up.

The clear problem here is that when dealing with the first round of a cup file, you can either add teams from a previous cup file or have teams created from the beginning of the season, but not both. Additionally, if you were going to have teams created from the beginning of the season in a cup file, you could ONLY do it from starting in the first round. If you were adding teams from a previous cup file, you could not have later rounds with teams that were supposed to be created from the beginning of the season. But, you could add teams from another cup to a cup file that has teams that were created from the beginning of the season if that round that the teams are being added to are after the first round, so the second round or higher.

This was the problem that both billys_boots and myself were facing, but likely didn't know existed until we ran into it, and then even making that connection was not easy. And because of this problem, that's the reason why the future implementation of the Europa League won't work. From the allocation table that was available for the future Europa League, the scenario of teams that would be joining the competition for the first time and also teams that would be transferring from the Champions League would be meeting in the first round of the Europa League and as previously mentioned, it couldn't be coded correctly. So unless bygfoot itself is updated to allow this functionality, the update to the current format for the Champions League and Europa League tournaments would be the last one possible I'm thinking.

As with the new UEFA cups, the biggest difference between the old cup files and the new cup files was that in the old Champions League, teams transferred to the UEFA Cup only at two opportunities. With the new Champions League, teams transferred to the Europa League at five separate opportunities...a much greater frequency over the old way. Things had to be done differently to get the files coded correctly so that the proper teams were transferred, instead of the wrong teams, for the respective countries that participated.

So as I spent much time figuring out how to get the UEFA cups to work properly, and succeeding, I'm posting them here for all to see how I did it and to learn from it. So to note, you're getting the master files that I created for the Champions League (uefa_cl.xml and uefa_cl_cp.xml) and Europa League (uefa_el.xml and uefa_el_cp.xml), and their respective finals cup definitions for the semi-finals and final matches. It relates to UEFA regulations that no player shall be banned from the final because of yellow card accumulation, unless they are banned outright in the semis. Additionally, you're getting the updated Supercup file too, which uses the respective finals cup files. In addition to those files, you're also getting some text files with notes and all in them, which should hopefully help you understand how the things work and all. :)

So if you decide to look at these files, hopefully you can make heads or tails of them, but for now, they are just being posted for your reference and potential learning material. These will hopefully be used to update the UEFA competitions for the UEFA countries, within time. So on that note, I will say good bye for now and happy gaming.

Will aka will_the_canuck
Attachments
new_uefa_cup_files_master_files_second_attempt.zip
new UEFA cup files based on 2020-2021 specs -- master files plus some help files for understanding
(15.27 KiB) Downloaded 247 times
tstellar
Posts: 52
Joined: Mon Aug 31, 2020 5:46 pm

Re: UEFA club definitions 2020/21

Post by tstellar »

Why is there a '*' character at the end of the cup names? e.g.

<choose_team_sid>europe_champ_league*</choose_team_sid>
will_the_canuck
Posts: 141
Joined: Tue Jan 16, 2018 5:54 am
Location: Canada

Re: UEFA club definitions 2020/21

Post by will_the_canuck »

tstellar wrote: Mon Feb 01, 2021 11:18 am Why is there a '*' character at the end of the cup names? e.g.

<choose_team_sid>europe_champ_league*</choose_team_sid>
Ah. The asterisk, or "*", is used at the end of the cup names as a wildcard character. From your example of <choose_team_sid>europe_champ_league*</choose_team_sid>, the use of the asterisk is basically a wildcard search parameter so that any filename matching that search parameter that is in use in the country_sid.xml file, will be used or accessed. To further explain, I'll demonstrate below from what I believe you are looking at.

With that example line, it can come from either the cup_supercup_europe_uefa.xml file or the cup_supercup_europe_intercontinental.xml file, which are the Supercup and Intercontinental Cup files for the European definitions. As there are 8 different cup_europe_champ_league*.xml files shown in the directory, each being different and each having a slightly different filename but still all beginning with cup_europe_champ_league, the use of the asterisk here allows you to have one file call upon multiple files that could be used, but only one file at a time would be used. So as the eight files all begin with cup_europe_champ_, they all have different endings: league; league1a; league1b; league2; league2a; league2s; league3; and league4.

So now as you know there are 8 cup_europe_champ_league files, only one would be used at a time with a particular country definition. Whichever file the definition would use, having the asterisk in the related supercup file would allow that supercup file to also be used for multiple country definitions too, or else you might need 8 different supercup files, one for each cup_europe_champ_league file that is out there. And assuming this supercup file was the European Supercup, which would require the winner of the UEFA Cup, if the asterisk wasn't used, you might need even more supercup files for each of the UEFA Cup cup files, and even more for the UEFA Cup cup files that didn't align with the champ_league files. So as you can see, instead of having untold multiple files here, by using the asterisk, you can have one file that would fit all the definitions within its range. Of note, there are actually 12 different UEFA Cup cup files, so you can get an idea of how much space having the one file apply to all files does help.

Hopefully this helped explain the use of the asterisk?

Will aka will_the_canuck
Post Reply