There are two possible ways (up to now) to customise Bygfoot: writing team definitions and writing country files. Both ways involve editing text files but the non technically minded user can, nevertheless do it without much hassle, as we are going to see.
Bygfoot currently uses two main text files to store definitions: the teams
file (where team data are stored) and the country_XXX
files (where data about
the leagues are stored).
By editing the teams
file you can create or modify the available teams.
By editing the or creating country_XXX
files you can modify the existing leagues
or add new ones.
Bygfoot text files are UTF-8-encoded. The reason for this is to make it possible to show the names of teams and players from most countries using all international characters needed. UTF-8 currently supports all alphabetical scripts and a large deal of CJK (When is someone going to send us Russian, Egyptian, Indian or Georgian country files so that we demonstrate this better? ;-).
Using UTF-8 is, however, quite a nuisance because it is not easy to type in it without a suitable text editor. If your editor doesn't support UTF-8 you may either load the file with lots of empty boxes in the places of non-ASCII characters or have it automatically converted to your locale encoding. So, if you edit a Bygfoot text file by hand you must take care that your editor doesn't mess up the encoding.
The easiest way to overcome any encoding mess is to use the ubiquitious iconv
command (available everywhere a glibc
is fully installed, i.e. all Linux, Unix and
BSD flavours).
To decode a UTF-8 file to your locale encoding (for instance Western European), use this:
iconv -f utf-8 -t iso8859-15 [file]
To convert back into unicode, use this:
iconv -f iso8859-15 -t utf-8 [file]
You can also use recode
(not so usually available):
recode UTF-8..ISO-8859-1 country_eng
But the best way to prevent this from happening is to use a text editor that understands UTF-8. A text editor that doesn't mix up the UTF-encoding is yudit. We strongly recommend it, although it is not a programmer's tool.
You can start the Team Editor from the team selection window at startup or by calling Bygfoot with one of the "-e" or "--editor" command-line switches.
At startup, the game looks only for teams with names that are in the list of the league teams (i.e. among the first 114 in the country file, in other words those you can choose from at the beginning) in the definitions file. Because of this it doesn't make sense to specify a team with a name that's not in one of the country files.
If you'd like to edit the definitions file directly, see the comments in the file. And take care that you don't mix up the encoding.
Upon starting the Team Editor you will see a window containing the following elements, from the top to the bottom:
Attention: Bygfoot looks at startup only for
team definitions in $HOME/.bygfoot/text_files/teams
,
so it doesn't really make sense to change the name of
the definitions file if you want to use it normally with Bygfoot.
Attention: Before choosing another team, you have to save the changes
you've made with the Save
button. Otherwise they are lost.
"Structure" is the way the players get distributed while playing. You must be used to hearing commentators mention the most widely-adopted ones: 4-4-2, 3-5-2, 4-3-3 and 4-5-1. Those of you not much acquainted with football (I mean, Americans, Aussies, New Zealanders, Canadians and Indians), please notice that these numbers mean the amount of defenders, midfielders and forwards. Notice also that the goal-keepers (a.k.a. "goalies") are not counted in the structure.
Those not much acquainted with football should read the "Overview" section of the documentation before playing or editing.
The first structure value specifies the distribution of the players that will take part in the game, the second specifies the positions of the other players in your team. In short: by choosing these numbers you are saying how much players of each position your team will have.
Players #1 and #12 are always goalies.
To change the position of a player, you either have to swap him with another player using the "Swap" button or change the team structure.
The average skill spinbutton shows you the average skill of all players (except the "nobodies"). If you'd like to increase or decrease the skills of all players simultaneously, you can use this button.
This button is the one to be used to determine the level of the team you are editing, so that your "Real Madrid" won't be a lot weaker than your "Rayo Vallecano".
Notice that Bygfoot uses four Skill values:
This is quite straightforward. After selecting a player by clicking on his row, you can edit his name, skill, talent and birth date. You can also move him up or down in the list and swap him with another player.
To avoid problems with this (e.g. if you edit Zidane, who's already 33 or so, which is rather old for Bygfoot, you won't have much fun with him because he probably gets worse immediately), user-edited players get worse no earlier than 1 or 2 years after you begin to play with them. Of course this could lead to quite absurd player development, so i might change this in some later version.
WARNING: You have to click the "Update player information" button for the changes to take effect before you edit another player, otherwise they are lost.
From inside the Team Editor you can import or export team definitions into standalone text files. This feature is intended to allow users to exchange team definitions, which is a quicker way to extend the game than expecting someone to write all team definitions.
However, the Team Editor was not intended to be THE tool to manage the
teams file (although it is the easiest one). You can also use UTF-8
enabled text editors to do so because the teams
file is only a plain
text file encoded in UTF-8.
The default team definitions file is $HOME.bygfoot/text_files/teams
.
If you don't want to touch it, you can specify another one or create a new one;
you have to keep in mind, though, that Bygfoot only reads team definitions
from the $HOME/.bygfoot/text_files/teams
or the
$PREFIX/support_files/text_files/teams
files.
Writing all teams to a definitions file with a different name can be useful if you'd like to exchange definitions files with someone else, but it is a better idea to export individual teams to files.
You can't edit a team that's not in a country file because all team names in the game get read from it. But of course you can change a team name to anything you like with the editor.
Additionally, if you'd like to add all teams in an existing definitions file to you definitions file, you can use the "Import" feature. Importing a file basically means that all team definitions found in the specified file are appended to your definitions file.
If you'd like to export the currently edited team to a file, click on the "Export" button and choose a filename.
Exchanging team definitions with others is really simple. If you've edited a
team you're proud of, and you'd like to share it with other Bygfoot users,
export the team to a new file, say ManchesterUnited.John
. All your friend Paul
has to do now is start the Editor, click on "Import", select the file he
received from you, and John's Manchester United is added to Paul's definitions file.
NOTE: If there's a team with the same name (in this case, Manchester United) in Paul's definitions file, importing John's file kind of overrides Paul's definition of ManU, because the last definition in the file counts.
An even simpler possibility (for the technically-minded) to import a file
would be to cat
it to the definitions file:
cat ManchesterUnited.John >> /home/paul/.bygfoot/text_files/teams
This can also be done using the less
command:
less a_team >> teams
There will be a collection of standalone teams here that you will be able to play with.
As all team definitions are stored to a single text file, it can happen that this file will someday become too big. The Team Editor does not currently include any facility to manage this. So, if it happens, you will have to open the teams file in a text editor and remove those teams you don't want any more.
It can happen also that a same team will be defined there two or more times. In this case Bygfoot will always used the one that appears last in the teams file but the garbage data will inflate the file unnecessarily. If you accidentally import a team that you don't like, open the teams file and delete it before importing another one. However, there is no harm in "Importing" teams from files if you don't save them. So, you can browse a collection of teams and choose those you want and those you don't want.
It is a good idea to keep backup copies of the teams you like most somewhere
safe. Whenever something goes wrong -- or if you need to delete your ~/.bygfoot
dir --
you will be able to recover them.
When exporting teams to standalone files, be careful to use a sensible naming convention so that, when you exchange them with others, people will be able to keep track of what is the content of the files. We, from the Bygfoot development team, would like you all to use this scheme:
XXX_Y_teamname_year_contributor_version.btd.gz
Which means:
bra_1_atleticomineiro_2004_jggouvea_b.btd.gz
Which means a bra(zilian) team named "atleticomineiro", in the first brazilian league, as it was in 2004, as written by one "jggouvea". This is the second revision he made that year.
Country files contain team names, league names and cup names. Each time you select another flag when you're asked to choose a team at the beginning of the game, a new country file is loaded.
The simplest way to make a new country file would be to copy one of the existing ones and edit it.
The default country files contain a lot of comments, so you don't really have to read the description below.
IMPORTANT: If you want to submit a country file to us, don't remove all those comments: they're useful for the newbies. You are even encouraged to translate them to country's language.
A country file is divided into the following sections
The Preamble must have all lines commented (if you don't understand this, don't touch it!). It contains some generic info supposed to be helpful to teach newbies how to edit a country file.
The Team list MUST be ended by a line reading "1000".
If you write a country file, please be gentle enough to translate the comments in the file to that country's language -- if you can. You are even encouraged to translate country files you have not written: if you come across a country file whose comments are not yet translated to the country's language, please do the translation and send the file back to us.
When writing country files, be careful to use a sensible naming convention. This naming convention is supposed to help us keep track of who wrote what and when. We, the Bygfoot development team, would like you all to use this scheme:
country_XXX_year_contributor_version.gz
Which means:
country_ita_2004_vicenzototti_a.gz
Which means that this file is for Italy, was written in 2004 by someone who wishes us to call him "vicenzototti" and is the second version (a) of the Italian file he wrote.