Commit Graph

1622 Commits

Author SHA1 Message Date
Tom Stellard 761a0862bf CMake: Generate a WinMain entrypoint on Windows 2020-12-05 21:03:53 -08:00
Tom Stellard d880736545 cmake: Use find_package instead of pkg-config
There was a change in the GitHub action Windows environment that caused
CMake to stop finding pkg-config.  So, using find_package instead of
pkg-config fixes the builds in that environment.  It also makes the
CMake configuration more consistent since we are already using
find_package for other libraries.
2020-12-05 21:02:17 -08:00
Tom Stellard 1ad0d534ca Update ChangeLog 2020-11-29 08:36:54 -08:00
Tom Stellard 8afdd22a97 Add action for building Windows package 2020-11-15 16:19:09 -08:00
Tom Stellard acaf8d38fb package-linux.sh: Package bygfoot the same way as previous versions 2020-11-08 20:45:30 -08:00
Tom Stellard c96dc1bb9c CMake: Generate the translatons 2020-11-08 20:44:52 -08:00
Tom Stellard 0e95508498 Initial support for building binaires on push to github 2020-10-19 13:13:25 -07:00
Tom Stellard 7cb15b645c Fix build with glib < 2.62 2020-10-19 13:13:25 -07:00
Tom Stellard f6eada0ed4 Make VERS macro overrideable on the command line
This will allow custom version strings when building.
2020-10-18 20:03:04 -07:00
Tom Stellard 07b8981115 Update Faroe Islands schedule to match the real schedule 2020-10-18 19:27:18 -07:00
Tom Stellard 6129c016b7 Update Faroe Islands definitions to include 3 divisions in 3. Delid
This is implemented using two sets of cups, one for the first half
of the year and one for the second half.

Also, fix a few mistakes in the team list.
2020-10-08 16:24:48 -07:00
Tom Stellard 2eb36b3fca Fix reserve team promotion rules when using promotion games 2020-10-08 16:24:48 -07:00
Tom Stellard 4f94d77b16 Allow using rank_start and rank_end tags for prom_games
This adds the same functionality already supported by the prom_rel
tags to support reserve team promotion rules for promotion games.
This allows you to specify a larger range of teams to promte than
the number of teams defined with the number_of_teams tag, so that
if a team is ineligible for promotion than other teams can be
substituted.  For example, if you wanted to promote at most 2
of the top 3 teams, you could do:

<prom_games>
  <prom_games_number_of_advance>2</prom_games_number_of_advance>
  <rank_start>1</rank_start>
  <rank_end>3</rank_end>
</prom_games>

Note that the rank_start and rank_end tags are not supported when using
the prom_games_loser_sid tag.
2020-10-08 15:21:10 -07:00
Tom Stellard fd841983df league_argentina4b.xml: Fix xml tag 2020-10-08 15:20:03 -07:00
Tom Stellard 10be13daf8 Update faroe islands with new tags for reserve teams
Also, fixup the cups and number of rounds for some leagues.
2020-10-04 15:19:46 -07:00
Tom Stellard c02ed078b5 cups: Fix a bug in cups with only 2 teams playing in the first round
A cup in wich all teams get byes except for two in the first round
would not have any additional rounds added, because the teams with
byes were not being counted in the total number of teams remaining.
2020-10-04 15:19:46 -07:00
Tom Stellard 1ce850b0c7 Exclude reserve teams from cups by default
If you need to define a cup that includes reserve teams, you can add the
include_reserve_teams property to the cup definition.
2020-10-04 15:19:46 -07:00
Tom Stellard e3785995a5 Simplify some duplicated code in cup_load_choose_team_from_league() 2020-10-04 15:19:46 -07:00
Tom Stellard 4d5886da4b Implement promotion and relegation rules for reserve teams
This adds some new rules for promoting and relegating reserve
teams:

+ Reserve teams will not be promoted into a league that contains its
  first team or a higher-level reserve team.
+ If a first team or higher-level reserve team is relegated to a league
  with a lower reserve team, then that reserve team will also be relegated.

In order to enable these rules, you must add the
<reserve_promotion_rules>default</reserve_promotion_rules> tag to your
contry xml file, and also define reserve teams in your league/team_defs
file using the <first_team> and <reserve_level> tags.
2020-10-04 15:18:13 -07:00
Tom Stellard c05e968f32 Add first_team and reserve_level tags to team element
The first_team tag can be used to indicate that a team is a 'reserve
team'.  The value for this new tag is the name of the first team
for this reserve team.  The reserve_level is used to indicate if this
is the 2nd, 3rd, 4th, etc. team for the first team. For example:

<team>
  <team_name>Blue</team_name>
</team>
<team>
  <team_name>Blue 2</team_name>
  <first_team>Blue</first_team>
  <reserve_level>2</reserve_level>
</team>
<team>
  <team_name>Blue 3</team_name>
  <first_team>Blue</first_team>
  <reserve_level>3</reserve_level>
</team>
2020-10-02 10:58:50 -07:00
Tom Stellard b23f046340 Add number_of_teams tag to prom_rel_element
This tag is intended to be used for leagues that may have some teams in
the league that are ineligible for promotions (e.g. reserve teams).
Often these leagues will promote 2 of the top 3 teams or something
similar, so if one team is ineligible, the league would still be able
to promote 2 teams.  Below is an example of how to model this scenario
with the new tag:

<prom_rel_element>
  <rank_start>1</rank_start>
  <rank_end>3</rank_end>
  <number_of_teams>2</number_of_teams>
</prom_rel_element>
2020-10-01 10:48:03 -07:00
Tom Stellard fb42210899 Import 2019/2020 faroe island definitions from forum
https://bygfoot.sourceforge.io/forum/viewtopic.php?f=12&t=1119

Official team names have been removed.
2020-09-30 07:37:27 -07:00
Tom Stellard 6377c8ba36 Cache some commonly used constants
All constants were stored in a g_datalist structure, which has very slow
lookups.  This was not ideally for constansts used during game play
which are accessed thousands of times.  Caching these values makes the
game simulations about 2 times faster.
2020-09-14 20:33:17 -07:00
Tom Stellard 58a77906b7 Remove use of deprecated glib type 2020-09-13 20:27:04 -07:00
Tom Stellard 22ec7046b8 cmake: Silence warnings in gtk headers 2020-09-13 20:27:04 -07:00
Tom Stellard 2a560b8454 Fix unused variable from d195a59c80 2020-09-13 20:27:04 -07:00
Tom Stellard 4696053c95 Optimize team_get_fixture()
When searching for a team's next fixture, only search in leagues that the team
is actually in.  This improves performance a lot in countries with many leagues.
I see about a 7x speed up simulating the first 6 weeks of English leagues using
billys_boots 2019/2020 definitions from the forums.
2020-09-13 20:27:04 -07:00
Tom Stellard 49236a28ac Simplify team_get_fixture() with an early continue 2020-09-13 20:27:04 -07:00
Tom Stellard 15ba7a7c45 Simplify code in team_get_fixture() to make it more readable 2020-09-13 20:27:04 -07:00
Tom Stellard 6e9fe763da Make team_get_fixture() return const pointer 2020-09-13 20:27:04 -07:00
Tom Stellard df651177e0 Make fixture_get() return const pointer 2020-09-13 20:27:04 -07:00
Tom Stellard 0a1e3c22b6 Add --random-seed option
This flag can be used to set the seed for the random number generator.  This
is mainly meant for testing.
2020-09-13 20:27:04 -07:00
Tom Stellard ef27c38c68 Validate country definitions on startup
Try to load all the country definitions on startup to ensure that they
are all valid.  Invalid XML can cause bygfoot to abort when simulating
matches and make users lose any unsaved progress.
2020-09-02 20:00:08 -07:00
Tom Stellard 8bdeffc4d8 Remove references to some cups that have no definitions 2020-09-02 20:00:08 -07:00
Tom Stellard 12becea290 Fix invalid xml in algeria and angola league definitions 2020-09-02 20:00:08 -07:00
Tom Stellard a14046e21f Remove Byte Order Mark and No-Break Space characters from xml files
The xml parser does not know how to parse these.
2020-09-02 20:00:08 -07:00
Tom Stellard 086334ba16 Fix African cup names 2020-09-02 19:27:33 -07:00
Tom Stellard d195a59c80 Speed up game simulations by using g_datalist_id_get_data()
g_datalist_id_get_data() performs much better than g_datalist_get_data()
because it uses a hash based lookup instead of string compare.
I tested this by starting a game with an English Premier league team
and then simulating to week 6.  According to perf's cycle counts, this
patch makes this test case about 10 times faster.

There is still room for improvement.  We currently re-compute the GQuark
value for every lookup, but we could pre-compute the GQuark once for each
option key and then use that value when looking up the data.
2020-09-01 20:24:30 -07:00
Tom Stellard 5a87b99e17 cmake: Add some fixes to get a minimal build/install working 2020-08-28 20:27:36 -07:00
Tom Stellard c536e8cc85 zip: Remove usage of OF macros
These are only needed to support very old K&R C compilers[1].  gentoo has also
renamed these macros in its zlib package[2] which means this code was failing
to compile there.

[1] https://trac.osgeo.org/gdal/ticket/6220
[2] https://bugs.gentoo.org/383179
2020-08-28 20:27:36 -07:00
gunnar_g c5fca3d502 add CmakeList files 2020-08-28 20:27:35 -07:00
Tom Stellard b17d84a053 Add rules files that were used to convert SVN repo to git 2020-08-28 20:27:32 -07:00
gunnar_g 0514e23c80 Updated README file 2014-04-30 07:10:33 +00:00
gunnar_g 83a9539d9f Updated Serbian definiton to 2013 2013-08-22 11:17:35 +00:00
gunnar_g d89c98b1b4 Fix the changelog 2012-02-14 13:24:29 +00:00
gunnar_g 1fcb60007a Fix the changelog 2012-02-14 12:32:27 +00:00
gunnar_g 5bab007a7d Remove the old links to _short leagues. These do not exist anymore 2012-02-14 12:17:57 +00:00
gunnar_g 7cfc8e4ba8 Fixed bug request 3257236, always show news after a match 2012-02-07 11:56:55 +00:00
gunnar_g e32729e901 update changelog 2012-02-02 15:43:10 +00:00
gunnar_g 0a42744e2e Add the boost and style to the default team (ticket 2778645 ) 2012-02-02 15:40:22 +00:00