Re: TUTORIAL: How to create .DIY tournament with groups and schedule as you want

More
14 years 3 months ago - 14 years 3 months ago #77528 by Mozg
All numbers in this article are presented in hexadecimal system.
This tutorial looks quite long and complicated, but after understanding it and get some practice, making a tournament shouldn t take more than five minutes.
SWOS++ patch is a comfotable tool that will allow you to play your tournament when you want to play it again and manage another team without requirement of creating if from the beginning.


0. Technical introduction
If you dont care about details and just want to know how to create tournaments, you can skip this section.

Some time ago I ve started to study the .DIY file structure by using some hex editor, because I tried to discover some way how to make tournaments in which squads of each group will be as I want it to be. So first thing that I ve noticed was that all teams data is stored in .DIY file (this data begins at offset #1447). So the natural next step was to find, in what way the rest of file is related with that data. After some trials of change the hex code it turned out that the following three groups of bytes are connected with the informations about which team plays in which group.

1. from #0059 to #0098
2. from #048C to #050B
3. from #050C to #054B

This sets contains something like pointers to respective teams. First set always contains 64 bytes with randomly ordered values from 00 to 3F, the same as third set. However, second set of bytes contains 128 bytes which are 64 pair of bytes, each pair of byte represents one number, and the numbers are always from 00-00 to 6E-04 with jump 12-00 (6E-04 is a representation of the number 46E, because in SWOS hex code all numbers which are represented in more than one byte, are represented is sometning like reverse notation , for example the hex number 1234 will be presented as 34-12, ABCD as CD-AB, etc.) Despite the fact that I knew this, I couldn t find the relations betweent this groups of pointers . All my trials of edit it had strange effects. The only thing that I did without any crashes was to sort these groups. So in place of first and third set I typed sequence of numbers from 00 to 3F, and in place of second set I wrote the sequence 00-00 12-00 24-00 36-00... and so on, to 6E-04. Then it turned out that squads of groups were connected with the order of the teams in .DIY file: for example in the 4 grous of 4 tournament, after sorting sets of bytes I ve mentioned before, in group A played first four teams from the .DIY file, in group B played next four teams, and so on. After some time, I ve noticed thing that was key: teams in .DIY file are stored in the same order as you had chosen it while created tournament in SWOS! So it s necessary only to select teams to tounament in SWOS with proper order (teams that you want to be in group A at the beginning, teams from last group at the end), sort the groups of bytes, and that s it! And it works :)

1. Instruction

0. At the beginning of course you should have some hex editor, because you will have to edit .DIY file hexadecimally (some editors are freeware and available to download from web, I m personally using Translhextion.)

1. Run SWOS and create your tournament by DIY COMPETITIONS. The most important thing in this step is the order of choosing teams. You have to choose teams that you want to play in group A at the beginning, then teams from group B, then C (if there are more than two groups of course), etc... In the case that first round is knockout, you have simply to choose the first pair at the beginning, next the second pair, etc. (It works olny when you are creating TOURNAMENT, not CUP) Next save the tournament and close SWOS.

2. Run your hex editor and load .DIY file with your tournaments. Now, only thing you have to do in this step is to paste (overwrite, not insert!) some sequences in respective places.

First sequence of bytes is:

00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F 20 21 22 23 24 25 26 27 28 29 2A 2B 2C 2D 2E 2F 30 31 32 33 34 35 36 37 38 39 3A 3B 3C 3D 3E 3F

This sequence have to be pasted in two places: from #0059 to #0098 and from #050C to #054B.

Second sequence is:

00 00 12 00 24 00 36 00 48 00 5A 00 6C 00 7E 00 90 00 A2 00 B4 00 C6 00 D8 00 EA 00 FC 00 0E 01 20 01 32 01 44 01 56 01 68 01 7A 01 8C 01 9E 01 B0 01 C2 01 D4 01 E6 01 F8 01 0A 02 1C 02 2E 02 40 02 52 02 64 02 76 02 88 02 9A 02 AC 02 BE 02 D0 02 E2 02 F4 02 06 03 18 03 2A 03 3C 03 4E 03 60 03 72 03 84 03 96 03 A8 03 BA 03 CC 03 DE 03 F0 03 02 04 14 04 26 04 38 04 4A 04 5C 04 6E 04

You have to type it from #048C to #050B. Next save changes.

3. Your tournament is ready to play :)

2. Schedule setting

In some cases, there is possible also to create schedule of matches as you want it to be, because teams always plays matches in the same order, and that order also depends on the order that you have chosen teams while creating tournament in SWOS.
I ll give an example: you created tournament and put Italy, Germany, England and Brazil in group A, and you have selected that teams in that order. Schedule in group A will be following:

Germany v Italy
Brazil v England

England v Italy
Brazil v Germany

Italy v Brazil
Germany v England

In general, it is:

A2 v A1, A4 v A3; A3 v A1, A4 v A2, A1 v A4, A2 v A3

where A1 is the team that you have chosen first, A2 is second chosen team, etc.

When there is play each team x more than 1 in your tournament, then the second round are replay of the first round, only home teams are changed.

If you are creating tournament with number of teams in group different from four, it is also possible to set the schedule, you have just first to create tournament as you want to be, sort groups of bytes, and study by your own how SWOS is making schedule in your case.

2.1. Seeded option

If the second round in your tournament is knockout and you checked seeded while creating tournament, you know also the schedule of second round, because SWOS has it s own way of create seeded knockout stages that are not random (if second round are group stage, random elements appears). For example, let s consider tournament 4 groups of 4 with quarterfinals after that, and let A1 be the notation of winnes of group A. After first round, SWOS created something like sequence of teams that will be played in second group, which in our case is: A1 B1 C1 D1 A2 B2 C2 D2 (first group winners, next runner ups, next third places if exists, etc.). And the first pair of the knockout is the first and last team of the sequence, second pair is second and next to last team, etc. So the quarterfinals will be as following:

A1-D2
B1-C2
C1-B2
D1-A2

If you will understand this exapmle, I think it should be clear how it works in another cases.

If the first stage was knockout, then the first team in the sequence is simply winner of first pair, etc.

Please Log in or Create an account to join the conversation.

More
14 years 3 months ago #77878 by Playaveli
Best technical post for a long time! Thanks. Especially usefull for tournaments.
Someone can program a tool to make this work automatic with a graphical and userfriendly interface.

Please Log in or Create an account to join the conversation.

More
14 years 1 month ago #79999 by MIJB#19

Please Log in or Create an account to join the conversation.

More
14 years 1 month ago #80420 by Marin Parushev
Great article. Some of the things in it I didn t know. It was really helpful to me. Thank you!

Please Log in or Create an account to join the conversation.

More
14 years 1 month ago #80547 by Schulle

[...]
Someone can program a tool to make this work automatic with a graphical and userfriendly interface.


Anything happend in this direction?

Please Log in or Create an account to join the conversation.

More
14 years 1 month ago #80563 by Playaveli
I think Marin was onto something here!

Please Log in or Create an account to join the conversation.

More
14 years 1 month ago #80665 by Marin Parushev
I wrote a program using Visual Studio 2005 that would open a .DIY file and would edit those bytes so that you can order the teams. I sent it to Playaveli and Bomb. Bomb wrote me that it s working fine.
So far the program consists of one executable and can be ran only on Windows systems and only if you have the Microsoft .NET framework installed. I am not an expert on Visual Studio but a friend of mine told me that the .NET framework comes with the recent Windows updates.
I am looking now for ways in which I can expand the program and add some more functionalities to it.
Attachments:

Please Log in or Create an account to join the conversation.

More
14 years 1 month ago #80666 by Schulle

Please Log in or Create an account to join the conversation.

More
14 years 1 month ago #80675 by Mozg
That s nice that somebody s continuing my work :) So if you are working on a program, i have an idea for you: The program could also allow us to set a group squad, not only to sort byte. It can be realized by sorting bytes firstly, and then sorting team informations at the end of the byte respectively. Additionaly bytes from #0099 should be sorted, because there are stored informations about team numbers and team countries. I don t know yet where are stored information about number of groups and teams per group, but if it will be helpful to somebody, I can try to find it out, if I ll have some time :)

Please Log in or Create an account to join the conversation.

More
14 years 1 month ago #80683 by Marin Parushev
Yes, that s the same thing I was thinking about. I know how team information is saved in the .DIY file. I just have to think of some good user interface.

Please Log in or Create an account to join the conversation.

Time to create page: 0.269 seconds
Powered by Kunena Forum