0% found this document useful (0 votes)
14 views

RFS Tutorial Database Editing

The document provides a detailed guide on editing the database for the Real Football Simulator (RFS), including instructions for creating a new league, specifically the Canadian Premier League. It outlines the necessary tables to modify, the structure of the database, and the specific data entries required for competition setup, match scheduling, and team standings. Additionally, it emphasizes the importance of adhering to maximum string lengths and the proper sequence for opening database files.

Uploaded by

janny.g870
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views

RFS Tutorial Database Editing

The document provides a detailed guide on editing the database for the Real Football Simulator (RFS), including instructions for creating a new league, specifically the Canadian Premier League. It outlines the necessary tables to modify, the structure of the database, and the specific data entries required for competition setup, match scheduling, and team standings. Additionally, it emphasizes the importance of adhering to maximum string lengths and the proper sequence for opening database files.

Uploaded by

janny.g870
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

Real Football Simulator

Database Editing

Publication date: 9 Jul 2023

please refer to “RFS Database Reference” for a detailed explanation of all table and fields
TFM Editor
TFM Editor is a simple database editor for TFM.
TFM Database is designed in order to have an optimal compromise between speed and
size.
The most important thing to know is that strings may not exceed a maximum length
specific for each field. Each field has a predefined maximum string length. To exceed this
length will cause the DB failure.
The database structure is described in an xml file, this description includes the maximum
string length.
TFM Allows to open a DB in two steps, first open the XML file, then open the DB file itself.
Any table can be exported in a .txt file with a CSV format that can be edited with Excel or
Open Office Calc and then imported back.
The save operation writes only the DB file while the xml remains unchanged.
There is another visible menu for modifying the database structure “Change XML”. It is
recommended that you do not use this feature at all.
Change XML works this way, first modify an xml file. With menu Change XML load the
modified xml file, the DB tables and fields are modified to respect the new structure. The
DB file must be saved to make changes effective.
RFS engine uses three types of databases:
the main database: RFS-meta.xml and RFS.DB files
the preference database: RFS_PREF-meta.xml and RFS_PREF.DB files
language database: RFS_LANG-meta.xml and RFS_xx.DB files where xx can be replaced
by a two letter ISO code of the language for example RFS_en.DB for English or
RFS_it.DB for Italian

If you have downloaded the game you can find the files in the following paths:
xml files: in C:\ProgramData\RFS\DB folder. (You need to choose “Show hidden files" in
your File Explorer in order to see ProgramData folder.)
main DB file: <MyDocuments>\RFS\DB
language DB files: <MyDocuments>\RFS\Languages
preference DB file: C:\Users\<YourName>\AppData\Roaming\RFS (You need to choose
“Show hidden files" in your File Explorer in order to see AppData folder.)
How to create a League
In order to create a new league you have to modify several tables:
• competition
• competformat
• competaccess
• previousseason
• gamecalendar
• competneutral (optionally)

In this example we will create the Canadian Premier League, it has 8 teams that play a
regular season of 28 matches, the first 4 progress to a playoff with two legs semifinals and
one-leg final in a neutral location. We assume there are no promotion and relegations.
Let's start adding a line in competitions table as follows

competitionid 339 a unique id for the competition


name Canadian Premier League competition name max 48 chars
competitiontype 1 1 = League
level 1 1 because it is the 1st tier in Canada
confederation 7 7 = CONCACAF
countryid 70 70 = Canada
assetid 339 same as competitionid
isvanishingsprayenabled False True or false as you like
isgoallinetechcompenabled False True or false as you like
firstyear 0 0 because it starts since the 1st year of career
period 0 0 because it is played every year
duration 0 0 because period was 0
rank 9 9 = low prestige
salary 76614 The average salary for a player in this competition
ismainleague True It is the main league where a team can play
sponsorperc 25 Between 0% and 50%
Then we create the format of the competition editing the competformat table, we need one
record for each stage, in our case 3, the regular season, semifinals and final.

competitionid 339 339 339 Same competitionid


stage 1 102 101 1=League, 102=semifinal, 101=final
directaccess 8 0 0 Number of teams accessing this stage directly
accessgroup 1 0 0 Access group id (see competaccess)
nteams 8 4 2 Total number of teams
drawpots 1 0 0 Number of pots for draw (0 means no draw)
avoidsamecountry False False False No need to avoid teams of the same Country
ngroups 1 2 1 number of groups for this stage
nmatches 4 2 1 number of matches played against each opponent
qualifiedteams 4 2 0 number of teams qualified for the next stage
qualifytostage 102 101 0 The next stage
advance is used for sending teams to a different
advance 0 0 0 conmpetition, this is not the case
advancecompid 0 0 0
advancestage 0 0 0
tierule 1 8 4 Tie resolution rules (see DB reference)
isinvisible False False False The competition can be played by user
colorgood1 4 0 0 number ot teams colored in standing, from top
colorgood2 0 0 0 same as above
colorgood3 0 0 0 same as above
colorgood4 0 0 0 same as above
colorbad1 0 0 0 same as below
colorbad2 0 0 0 number ot teams colored in standing, from bottom
keeppoints 0 0 0 no points carried on from a previous competition
fromcompid 0 0 0
isneutral False False True True if played in a neutral field
prize 2145 100 250 Prize in k€ shared among the teams
Then we create the access groups, that is the rules that establish which teams have the
right to play this competition, based on the results of the previous season. We just need
one access group because we do not have promotions and relegations. So we just have to
declare that the 8 teams are the first 8 teams of Canadian Premier League of the previous
season.

competitionid 339 competitionid


accessgroup 1 the id of the access group (as referred by competformat)
nteams 8 the number of teams in this access group
the competition from which the teams are coming. It is just the
fromcompetitionid 339 same in our case.
minpos 1 the best position in the standing in the from competition
maxpos 8 the wort position in the standing in the from competition
countrylimit 0 no limitation on teams of the same Country

Now we also need to set the standings of the previous season so, the first year, RFS will
know which teams to use. Let's go to the previousseason table and add one line for each
position in the standings. We do not need to specify points or other but just the position.

competitionid teamid position


339 130233 1 Forge
339 116275 2 Cavalry
339 130235 3 Pacific FC
339 130237 4 York United
339 130236 5 Valour
339 130234 6 HFX Wanderers
339 112600 7 Edmonton
339 114862 8 Atlético Ottawa
Now we have to define when every single match will be played. We will use table
gamecalendar for that. The full year calendar is split in 102 slots 51 week-end slots Friday-
Monday and 51 mid-week slots Tuesday-Thursday. The exact date is calculated by RFS
and can change of a few days year over year. The choice of the slots must be consistent
with the international calendar because some slots are reserved for international
competitions. One option is to see which slots are used by other competitions and reuse
the same.
In addition the exact day and time is assigned choosing a “pattern” from the
calendarpattern table
Every stage must have one entry for the definition of the stage and one entry for each leg.
Let's see our example.

competitionid stage leg year calendarslot patternid


339 0 0 0 15 4 20 feb Mon Evening Draw league
339 0 1 0 29 27 10 apr Sat-Sun Aft-Ev Leg 1
339 0 2 0 31 27 17 apr Sat-Sun Aft-Ev Leg 2
339 0 3 0 32 23 21 apr Tue-Wed Even Leg 3
339 0 4 0 33 27 24 apr Sat-Sun Aft-Ev Leg 4
339 0 5 0 35 27 01 mag Sat-Sun Aft-Ev Leg 5
339 0 6 0 37 27 08 mag Sat-Sun Aft-Ev Leg 6
339 0 7 0 39 27 15 mag Sat-Sun Aft-Ev Leg 7
339 0 8 0 41 27 22 mag Sat-Sun Aft-Ev Leg 8
339 0 9 0 57 27 17 lug Sat-Sun Aft-Ev Leg 9
339 0 10 0 59 27 24 lug Sat-Sun Aft-Ev Leg 10
339 0 11 0 60 23 28 lug Tue-Wed Even Leg 11
339 0 12 0 61 27 31 lug Sat-Sun Aft-Ev Leg 12
339 0 13 0 63 27 07 ago Sat-Sun Aft-Ev Leg 13
339 0 14 0 64 23 11 ago Tue-Wed Even Leg 14
339 0 15 0 65 27 14 ago Sat-Sun Aft-Ev Leg 15
339 0 16 0 67 27 21 ago Sat-Sun Aft-Ev Leg 16
339 0 17 0 69 27 28 ago Sat-Sun Aft-Ev Leg 17
339 0 18 0 73 27 11 set Sat-Sun Aft-Ev Leg 18
339 0 19 0 75 27 18 set Sat-Sun Aft-Ev Leg 19
339 0 20 0 76 23 22 set Tue-Wed Even Leg 20
339 0 21 0 77 27 25 set Sat-Sun Aft-Ev Leg 21
339 0 22 0 79 27 02 ott Sat-Sun Aft-Ev Leg 22
339 0 23 0 83 27 16 ott Sat-Sun Aft-Ev Leg 23
339 0 24 0 84 23 20 ott Tue-Wed Even Leg 24
339 0 25 0 85 27 23 ott Sat-Sun Aft-Ev Leg 25
339 0 26 0 87 27 30 ott Sat-Sun Aft-Ev Leg 26
339 0 27 0 89 27 06 nov Sat-Sun Aft-Ev Leg 27
339 0 28 0 93 27 20 nov Sat-Sun Aft-Ev Leg 28
339 102 0 0 93 11 20 nov Mon Afternoon Draw semifinal
339 102 1 0 95 9 27 nov Sat Afternoon Semifinal Leg 1
339 102 2 0 97 9 04 dic Sat Afternoon Semifinal Leg 2
339 101 0 0 97 11 04 dic Mon Afternoon Draw final
339 101 1 0 99 9 11 dic Sat Afternoon Final
Last but not least let's go to define the neutral location when the final will be played, and
let's take the Montreal BMO Field stadium that is associated, in the table
teamstadiumlinks, to the Canada National Team. Because we want every year the final to
be played in that stadium we just need one line in the competneutral table

competitionid 339 competitionid


stage 101 stageid
year 0 0 = every year
teamid 111455 Canada National Team, therefore BMO Field

You might also like