Informal How-To: Using the <two_match_week/_start/_end> tags

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
will_the_canuck
Posts: 141
Joined: Tue Jan 16, 2018 5:54 am
Location: Canada

Informal How-To: Using the <two_match_week/_start/_end> tags

Post by will_the_canuck »

Hello there. Welcome to this informal information session on how to use the tags of <two_match_week> and <two_match_week_start> and <two_match_week_end>. These tags are relatively undocumented but do appear in various league definitions within bygfoot. So what I wish to do here is basically explain how these different tags are used and how they work, so that anyone who will consider developing their own definitions for bygfoot can use them, if they so wish.

To begin with, the tags of <two_match_week_start> and <two_match_week_end> are used together in league files to basically allow two league match games for the same team to be played in one week. This is useful if your league had a lot of teams and you need to or want to have the league start and finish between certain week numbers but if they were to play one game a week, it would extend beyond the start and finish week numbers that you have planned for them. When I saw these tags in action, I thought that the numbers used were based on their week number that the developer would want to have the two_match_week setting to start and then finish. I was wrong. :) As I have re-written the original Mexico definitions to work better and actually work more properly, I'll use them as an example here explaining these tags, in addition to the <two_match_week> tag which is used in cup file definitions.

I am using the relevant code from the second tier league file in the Mexico definitions to explain the <two_match_week_start> and <two_match_week_end> tags.

Code: Select all

<league>
	<sid>mexico2</sid>
	<name>Primera "a" Division</name>
	<layer>2</layer>
	<first_week>3</first_week>
	<week_gap>1</week_gap>
	<round_robins>2</round_robins>
	<new_table name="Torneo Apertura">1</new_table>
	<new_table name="Torneo Clausura">22</new_table>
	<break>7</break>

	<two_match_week_start>1</two_match_week_start>
	<two_match_week_end>4</two_match_week_end>
	<two_match_week_start>10</two_match_week_start>
	<two_match_week_end>11</two_match_week_end>
	<two_match_week_start>19</two_match_week_start>
	<two_match_week_end>22</two_match_week_end>

	<two_match_week_start>26</two_match_week_start>
	<two_match_week_end>27</two_match_week_end>
	<two_match_week_start>31</two_match_week_start>
	<two_match_week_end>32</two_match_week_end>
	<two_match_week_start>36</two_match_week_start>
	<two_match_week_end>45</two_match_week_end>

	<prom_rel>
	</prom_rel>

	<teams>
From the relevant information above, you see that this league starts in week 3 and that there is a week gap of 1 (one), so they basically play every week. Also, there is a break between the rounds of 7 weeks. In addition, this definition also shows that there are 2 (two) tables added, which have a relevance for the cup files. Of note, this league has 24 teams in it, so therefore 46 games are played by each team. The way this league plays out is that the first round plays from week 3 to week 20, of which there is then a play-off from week 22 to week 25. The second round plays from week 27 to week 42, with another play-off from week 44 to week 47. If the team that wins the first play-off is different from the team that wins the second play-off, then a final play-off takes place between those two teams from weeks 49 and 50. If the same team wins both the first and second play-offs, then the final play-off isn't played.

So going forward, the first part of the season or first round would consist of 18 weeks and the second round of the season would consist of 16 weeks. And within these 18 and 16 week rounds respectively, 23 games each would have to be played, thus, the use of the <two_match_week_start> and <two_match_week_end> tags becomes important. The key is that the number used with the tags is the game number of the league and NOT a week number.

So in my above definitions for the first round of games from games 1 to 23, the start and end numbers are 1 to 4, 10 to 11, and 19 to 22. If it helps, you can use a spreadsheet or piece of paper to write down the numbers so you don't get confused. So in my example, starting from week 3, games 1 to 4 will take place in weeks 3 and 4, games 10 to 11 will take place in week 10, and games 19 to 22 will take place in weeks 18 and 19. The last game of the round, game 23, will take place in week 20, before the play-offs start. As for the second round, which starts in week 27 and consists of games 24 to 46 in the league, the start and end numbers are 26 to 27, 31 to 32, and 36 to 45. So in this example, games 26 to 27 will take place in week 29, games 31 to 32 will take place in week 33, and games 36 to 45 will take place in weeks 37 to 41. Game 46 will take place in week 42, just before the second play-offs start. And that's basically how the <two_match_week_start> and <two_match_week_end> tags work.

Now as for the <two_match_week> tag that is used in the cup files, here is the relevant code from the first play-off cup from the above mentioned example:

Code: Select all

<cup>
	<name>Liguilla - Primera "a" Apertura</name>
	<sid>mexico2_apertura</sid>
	<add_week>21</add_week>
	<week_gap>1</week_gap>
	<last_week>25</last_week>
	<property>national</property>
	<property>highlight3</property>

	<cup_rounds>
		<cup_round>
			<choose_teams>
				<choose_team>
					<choose_team_sid>mexico2</choose_team_sid>
					<number_of_teams>8</number_of_teams>
					<start_idx>1</start_idx>
					<end_idx>8</end_idx>
					<from_table>1</from_table>
				</choose_team>
			</choose_teams>
		</cup_round>

		<cup_round>
			<two_match_week>1</two_match_week>
		</cup_round>

		<cup_round>
			<two_match_week>1</two_match_week>
		</cup_round>
	</cup_rounds>
</cup>
As you can see from above, the cup file is added in week 21 and ends in week 25. 8 (eight) teams are added in round 1 (one) and they play two matches per round, until a winner is determined after round 3 (three). Normally, this would take 6 matches over a period of 6 weeks, but with the <two_match_week> tag with a value of "1", two matches can be played in the same week, just different rounds of that week (i.e. week 24, round 1, and week 24, round 2, for the second round matches). As the first round will not start until week 22, the first round will play two weeks from week 22 to week 23, and the second and third rounds will be played over weeks 24 (second round) and 25 (third round). I am not using the <two_match_week> tag in the first round because there is either a bug that is produced when using this tag in the first week, or it is programmed to work like that. I'm guessing bug. :) Basically when you use the <two_match_week> tag in the first round of a cup file, it will play both matches in the same round of the week (i.e. week 22, round 1 for game one and week 22, round 1 for game two), and you can't quite control it very well if you're playing the live game. Basically it isn't very playable that way and I wouldn't want to use this tag in the first round for this very reason. You can read more about this bug here under the "Bug reports" section in relation to this topic if you're more interested.

So with the above information in mind, if you are developing your own definitions and want to "speed up" game play by having a few more games within a certain time frame, these tags might help you with that. I guess with having a team play multiple games in a week, yes, you can finish the games sooner but also you will deplete your players' energy quicker too, depending on how much you play them. So that is something to also consider when designing your definitions. But also, it adds to the excitement I guess and makes a player either rotate their players or use a training session to give their players "recreation", which will in turn rest and refresh their players to fuller energy levels. :)

So hopefully this was helpful and informative for you. For now, I'll let you go and hope you take care and have fun.

will_the_canuck
Post Reply