Team disappears after changing seasons after pro/rel contest

Here you can... report bugs. Open a new thread for each bug, please.
Post Reply
will_the_canuck
Posts: 141
Joined: Tue Jan 16, 2018 5:54 am
Location: Canada

Team disappears after changing seasons after pro/rel contest

Post by will_the_canuck »

Hello all.

Well, I've got a doozie this time I'll say. It seems that a definition file I'm working on creating has an issue that is likely producing a bug that causes one team in a particular league/division to disappear from existence after a promotion/relegation cycle, after the season is advanced from the current season to the next. To begin with, I'm using bygfoot version 2.3.2 for ubuntu which I downloaded via the ubuntu repositories that I have installed currently on lubuntu 16.04. I'll eventually be upgrading to 18.04 sometime in the future. I've reproduced this error twice, although with slightly different definition files in relation to the cup files in how the <delay> tag is being used, as I'm still working on how best to incorporate it, if at all, to get the play-offs spaced out how I want them to be spaced out.

I've got three tiers of leagues: tier 1 - MLS (2 conferences); tier 2 - USL (2 conferences; and tier 3 - PDL (4 conferences) and NPSL (4 conferences). I did resolve the promotion and relegation issue I had with the third tier by melding the 11 divisions of the PDL and 13 divisions of the NPSL together and having 4 conferences each for the PDL and NPSL. Although it does resolve the issue I had in dealing with 24 divisions for the third tier and working with the two divisions of the second tier, it is only a workaround since I'm changing my original intent for the revised leagues and all.

As for the issue I'm having I've got the promotion and relegation cups working well enough that for the first season, they appear to be playing out fine, except for the spacing and when the games are played. I'm still working on the best way to do that. But from my definitions, I've divided the tiers into east and west regions, in that for relation to promotion and relegation, the east teams will only play the east teams and the west teams will only play the west teams.

When you start the game, there are 228 teams to choose from. The teams are divided as such: MLS East - 11 teams; MLS West - 12 teams; USL East - 16 teams; USL West - 17 teams; PDL combined - 74 teams in 4 conferences; and NPSL combined - 98 teams in 4 conferences. I have the promotion and relegation set up as such: (1) the bottom 2 teams from the MLS East league play will face the top two teams from the USL East play-offs; (2) the 10th and 11th placed teams from the MLS West league play will face off in an elimination game and the loser will join the 12th placed team to face the top two teams from the USL West play-offs; (3) the bottom 4 teams from the USL East league play will face the team that wins the play-offs from each of the 4 eastern regions of the PDL and NPSL; and (4) the 13th and 14th placed teams from the USL West league play will face off in an elimination game and the loser will join the 15th to 17th placed teams to face off against the winner of the play-offs of each of the 4 western regions of the PDL and NPSL. As I said, I found a workaround that works nicely for the promotions and relegations for the respective events.

My problem is when the season is over and I switch to a new season, the MLS East seems to go from 11 teams to 10 teams and the team that won the MLS East - USL East promotion and relegation tourney, just seems to vanish. And when looking at the "Browse Teams" option, in season one you can see 227 teams, which doesn't include your team as you'll be team number 228. After the season turns over and you're into season two, if you go to the "Browse Teams" option again, you'll now see 226 teams listed. So, what the heck is going on here??? Could it be because the MLS East has an odd number of teams in it as it is the only one affected? Or could it be because i'm running parallel leagues but really shouldn't be an issue in the first place?? I'm very confused at this issue and if it can not be resolved, then a promotion and relegation system in North America may not work, unless I maybe join the two leagues together to just create one league, but then what fun would that really be? I will try adding a 12th team to the MLS East (future expansion team Miami) but at least in the interim, it wouldn't really be correct.

So hopefully you can help me make out what the real problem is and if you try out the definitions yourself, see if you can reproduce the problem too. Or is it just on my system that the problem exists? Please find included the definitions I'm using as well as a saved game with this problem.

will_the_canuck

PS - I look forward to seeing any comments or feedback on this issue :)
Attachments
united_states-test_season_one_with_promotion_eleven_teams_down_to_ten_in_mls_east-example_2.zip
saved game showing problem, in week 50, just before season cycles
(683.08 KiB) Downloaded 157 times
bygfoot definition files - usa_ver1.zip
definition files used that gave this problem
(25.98 KiB) Downloaded 169 times
will_the_canuck
Posts: 141
Joined: Tue Jan 16, 2018 5:54 am
Location: Canada

Re: Team disappears after changing seasons after pro/rel con

Post by will_the_canuck »

An update to this issue...

Well, as for adding a 12th team to the MLS East for the purposes of promotion and relegation, that also failed. And as this issue only affected the promotion and relegation for the MLS East and USL East, as the MLS East division is the first league in the country files, why it is affecting it is still unknown. But as I have tried a few other combinations, I wanted to list them here for diagnostic purposes.

As the original post was having the bottom 2 of tier one face off against the top 2 of the play-offs for tier two's conferences (east and west separately), that was a bust. Basically the 4 teams would play each other once and the top two would get promoted.

I did try I believe having the bottom 2 of tier one face off against the top 2 of tier 2, but I believe that was unsuccessful. And I recently had the botom 2 of tier one play off against the top 2 of tier two, but separately. By that I mean have bottom 1 play top 1 in a two game match and have bottom 2 play top 2 in a two game match. That too, failed.

The only thing that seemed to work for me so far was having bottom 1 and top 1 switch places and have bottom 2 play top 2 in a two game match. And just having bottom 2 switch places with top 2 also worked, in a normal promotion and relegation style.

So if you ever can figure out why this error is even occurring, that would be something great to know. Good luck in resolving this issue and if you ever do, I'd love to hear about it.

will_the_canuck
will_the_canuck
Posts: 141
Joined: Tue Jan 16, 2018 5:54 am
Location: Canada

I understand it now but it still does not make sense

Post by will_the_canuck »

Hello again. Here's another update on this issue and most likely the last one needed as I ran some tests and have a better understanding of the problem but I don't understand why the problem behaves in this manner.

So to begin with, I took the definition files from the previous post for this issue and I downloaded them and modified them to have two league files per tier and have 2 tiers, as well as some cup files for promotional cups. I ran 9+ tests and found some success but also some questions. I'll describe the tests and give my responses at the end. But I should also add that I had success with this when I had the last place team in tier one switch places with the top team in tier two, in each of the respective conferences in the tiers as there were two league files in each tier. This would be achieved with the following code for tier one: (this represents one upper tier and one lower tier league only...the MLS East and USL East...there would be a different <dest_sid> for the other upper tier and other lower tier league files in my example...the MLS West and USL West)

Code: Select all

	<prom_rel>
		<prom_rel_element>
			<rank_start>8</rank_start>
			<rank_end>8</rank_end>
			<dest_sid>usa_ver1_2a</dest_sid>
			<prom_rel_type>relegation</prom_rel_type>
		</prom_rel_element>
	</prom_rel>
and the following code for tier two:

Code: Select all

	<prom_rel>
		<prom_rel_element>
			<rank_start>1</rank_start>
			<rank_end>1</rank_end>
			<dest_sid>usa_ver1_1a</dest_sid>
			<prom_rel_type>promotion</prom_rel_type>
		</prom_rel_element>
	</prom_rel>
Test 1:
Although I know it failed already, I ran it anyways. I took the bottom 2 teams from tier one and played them against the top 2 teams of tier two in a cup file, for their respective regions (East and West). The top two winners would go up, the two losers would go down. The result was that the winner of the cup would disappear and only 1 of the 2 winners would advance and the 2 losers would be relegated. So basically the upper tier was missing a team. Additionally, I put the promotion and relegation definition tags in the tier one league files.

Test 2:
Same parameters as test one except that I put the promotion and relegation definition tags into the tier two league files. The result was the same...a failure.

Test 3:
As I thought this issue only affected the first league listing, I skipped the first league listed (MLS East) and only did the promotion and relegation for the West region (MLS West and USL West), via the promotional cup route, as similar to test 1. The result was the same as in the first test and a team disappeared in the upper tier after a promotion and relegation cycle.

Test 4:
Same parameters as test 3 but instead of using the bottom 2 from tier one and the top 2 from tier two, I used 1 team from each, again, just from the West region. Again, the result was a team in the upper tier disappeared as the result was a failure.

Test 5:
As the previous tests have failed, I tried adding a promotion and relegation based on league standing for the East Region (MLS East and USL East) and retried doing the promotion and relegation based on the promotion cup for the West Region (MLS West and USL West), as was in test 4. As the East Region leagues came first in the country file, in comparison to the West Region leagues, I was maybe a little surprised that this worked. There was success here in that the respective teams were promoted and relegated properly, without issue.

I did try two other tests here by having the <prom_rel_element> defined but blank of information, to see if maybe it might fool the system, while still having the promotional cup information still defined for the West Region. All that did was give me a segmentation fault (core dump).

Test 6:
As I was working on the first 2 tiers, I decided to see if having a promotion and relegation between tiers 2 and 3 might make a difference, as being the first instance of a promotion and relegation between tiers instead of first being between tiers 1 and 2. As I used the same parameters in test 1, that being the promotional cups, the results were the same as in the first test and one team disappeared in the second tier this time around, as happened in the first tier in the first test. So it was a failure.

Test 7:
As I tried all I could think of at the time for two leagues per tier, I tried a single league in tier 1 and two leagues in tier 2. I had the bottom team of tier one get relegated based on league standing and the top teams in each league in tier 2 go to a promotional cup and the winner got promoted to tier 1. The promotional definitions were in the same league file, in tier 1, and I did not list a loser_sid for the promotional cup definition in the league file. It was a success and the team to get relegated from tier 1 took the place of the team in tier 2 that got promoted.

Test 8:
As test 7 was a success with one upper tier and two lower tier leagues, I tried having one upper tier and one lower tier here, but instead of having the upper tier team be relegated and the lower tier team have a promotional cup play-off, I decided to flip it around and have the bottom two teams from tier 1 play a promotional cup of which the loser would be relegated, and have the top team from tier 2 be promoted. As the second tier team would be listed in the <prom_rel_element> tag, I had the promotion and relegation definition information in the second tier league file. This actually resulted in a failure and for the following season, a team from the upper tier disappeared, just like the result from test 1.

Test 9:
As test 8 was a failure, I decided to rerun the test but with the opposite factors, that being the upper tier would have the relegation based on league standing and the lower tier would have a promotion based on the promotional cup for the top two teams in the league, of which the winner would get promoted. Additionally, I had both promotional definitions in the upper tier league file. This was also a successful test as the promotion and relegation were handled perfectly.

So, after having run these 9+ tests, what did I learn? I guess I would ask you first, the reader, if you have learned anything from what I reported here? I know I did, and still, it doesn't make complete sense to me in a way.

So although you may have one opinion or two on what you learned, here's what I learned. When you want to implement a promotion and relegation system in your league/country definition files, wherever you start your promotion and relegation process, it doesn't matter. You could have promotion and relegation start between the first and second tier, the second and third tier, or third and fourth tier if you wanted. When you start, it doesn't matter. The ONLY thing that matters though is that the first league file that you have that will be affected by promotion and relegation MUST HAVE the <prom_rel_element> code in it and the <prom_rel_type> MUST BE "relegation". You can include as many positions for relegation as you wish, but you MUST HAVE at least one team to be relegated. Beyond that, there is no more need to have the <prom_rel_element> in the subsequent league files unless you want teams to be promoted or relegated based on league standings. AGAIN, you only need to have the <prom_rel_type> as "relegation" for the first league file that will have promotion and relegation. After that, it doesn't matter. And this is why I'm confused.

Of note, I ran these tests using bygfoot-2.3.2 under lubuntu version 18.04 lts. The results confused me as to have promotion and relegation work, the first code for promotion and relegation HAD TO BE within the <prom_rel_element> tag and have the value of "relegation" for the <prom_rel_type> tag. After that, you could use anything. Now why this requirement is even here or why does it even require this tag to work is beyond me, but if I didn't include it and used promotional cups to determine the team to promote, it would always cut a team and make them disappear, which isn't very good. To the developers, if this was set up this way, why? If this just happens to be the way it works out, could it be a bug? Can this ever be changed so that the current requirement only becomes an option and the promotional cup challenge could also become an option too, if the makers of the definitions so wished it?

Oh well. So although I find the end result confusing as to why it is a requirement for promotion and relegation to even work in bygfoot, at least I now know what my initial problem was and how to correct it in the future. If this "bug" is ever resolved in the future, that will be something good to see. So with all of this test evidence, hopefully you too can get promotion and relegation working in your definitions, if you so want them.

Thanks for reading,

will_the_canuck

PS - I did a 10th test with promotion and relegation based on a relegation cup for the first tier bottom two teams and a promotion cup for the second tier top two teams and it failed, just like test 1's result, of a team disappearing in the first tier. Oh well.
Post Reply