[Freeciv-Dev] New game.ruleset to support custom calendars, etc. (PR#45)
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
Full_Name: Bobby D. Bryant
Version: CVS (for 1.8.2?)
OS: Linux
Submission from: (NULL) (129.116.78.130)
This is a new file, game.ruleset. I believe it will need to go into both
freeciv/default and freeciv/civ1. For now it only includes [calendar], but I
anticipate slowly adding other rule modifiers such as found in Civ2's Rules.txt.
(I thought rules.ruleset sounded dumb, so I changed it to game.ruleset.)
The [calendar] section allows specification of up to 10 "epochs", with the
number of years per turn specified independently in each epoch. This file
reproduces the behavior that is hard coded in 1.8.0, but you can modify a copy
in another directory and load the modifications into the server just as you do
for the other rulesets ("set game <subdir>"). The values used to specify the
epochs are bounded only by the range of (int), so you can set your games in the
prehistoric era or the distant future if you wish.
Unfortunately, I felt like I needed to remove the ability to set the end turn in
the server. Since the server shows the defaults before loading the rulesets,
there is no clean way to set a default for the end turn for proper display in
the server. Also, it didn't make much sense to allow setting an end turn
without some way to see what the [calendar] defines.
Notice that the new mechanism lets you set the starting date as well as the
ending date.
The supporting patches will follow in a reply to this post.
The code had more entanglements than I expected when I started, so we'll want to
do some thorough testing before integrating this into a release.
Unfortunately, all this must wait until we're ready for a compatibility break,
though I'd like to suggest that we make that break as soon as feasible, in order
to provide improved support for modpacks. (I did this patch because it is
needed for the 'ancients' modpack.) My code assumes that the version string
will be 1.8.2, so we may have to tweak that if things don't work out that way.
---8<-------
; game.ruleset
;
; Modifying this file:
; You shouldn't modify this file except to make bugfixes or
; for other "maintenance". If you want to make custom changes,
; you should create a new datadir subdirectory and copy this file
; into that directory, and then modify that copy. Then use the
; command "set game <mysubdir>" in the server to have freeciv
; use your new customized file.
;==============================================================================
[datafile]
description="General game rules for FreeCiv."
options="1.8.2"
;==============================================================================
[calendar]
; The epochs are the different time periods in which the game clock runs at
; different speeds. List them in chronological order. Use negative numbers
; for BCE dates and natural numbers for CE dates. All must fall within the
; range of (int). Each turn_increment must be positive, or the game will never
; finish!
;
; There must be at least one epoch, and there is a hardcoded limit of 10.
;
; There is no real need to force the epochs to last an integral number of turn
; increments, because the check is vs. whether the current date is >= the
; beginning date of an epoch, not vs. = the beginning date.
;
; If a year turns out to be 0 during play, it will be reset to 1; there is no
; year 0. However, you can use 0 in the table because of the >= test
; described above.
;
; The values in the table may be overridden if spaceship components have been
; built. See game_next_year in game.c for the logic. (I don't know why it
; works that way.)
;
; The game begins at the beginning of the first epoch. See below for game end.
epoch={ "start_date", "turn_increment"
-4000, 50
-1000, 25
0, 20
1000, 10
1500, 5
1750, 2
1900, 1
}
; Each epoch ends when a new epoch begins, but since there is no epoch after
; the last one, you have to specify the end of the game.
end_date=2000
;==============================================================================
; add lots more sections here...
- [Freeciv-Dev] New game.ruleset to support custom calendars, etc. (PR#45),
bdbryant <=
|
|