[Freeciv-Dev] Re: Calendars (Re: Re: A bunch of patches)
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
On Tue, Jan 08, 2002 at 04:02:08PM -0600, Tony Stuckey wrote:
> On Tue, Jan 08, 2002 at 02:15:19AM +0000, andi payn wrote:
> > I went ahead and implemented the calendar code as we discussed, and it
> > works, but it's ugly in a few places.
> >
> > The basic problem is that each age can have a different number of
> > months per year, different days per month, etc. Calendar math becomes
> > very complicated. Fortunately, we don't do much math other than
> > incrementing by one turn and comparing two dates. The few places where
> > we do anything more complicated (e.g., the spacerace) I found ways to
> > fake it that work.
> >
> > But I have an alternate solution that I think might be better: Create a
> > base
> > calendar, with months and days and leapyear rules that are
> > constant throughout the game (therefore, date math becomes possible). Then
> > create ages that all use the same calendar. I've included a couple of
> > sample
> > ruleset fragments at the end of this message, but I'll try to explain the
> > system:
> >
> > Each [month_*] has a "name" and a number of "days." Each [leap_*] has
> > an "every" that specifies how many years between each (which can be
> > decimal; for two leapyears every 9 years, use 4.5), an optional
> > "offset" that specifies where the counting starts (defaults to 0), a
> > "month" that specifies the name of the affected month, and a number of
> > "days" (positive or negative) to add to the month.
> >
> > This leapyear system is pretty simple, and takes care of everything
> > you'd want. You can even create entire leapmonths (I've made a lunar
> > calendar, with 13 28-day months, plus 28-day leapmonths that pop up
> > every so often to keep the year accurate to within one day in 13,200
> > years) by adding a month with no days, and giving it extra days during
> > leapyear. See the second fragment.
>
> The mind boggles.
> I fully understand how nuts people have been in human history, but
> what kind of masochist would want to include this level of complexity into
> a game?
> Clearly, we need to start working on a Calvinball scenario. "On
> Tuesdays in March, you need to juggle 4 knives for two minutes and touch
> thirteeth base, including the secret eighth base, as well as kick a soccer
> ball onto the house roof, close your eyes, spin four times
> counterclockwise, and count to thirty before you can build Riflemen..."
>
yes, yes, yes. anything chosen needs to be _simple_. No leapyears. No
leapseconds. No weirdness about september in the 1600's. No moon. No chinese
calender. etc.
Jason's suggestion on granularity I think is fairly good. I would
suggest:
current system (however that works to maintain compatibility),
certain year intervals (1 turn every X years, 1 <= X <= N),
quarter years (by season, obviously),
by month,
by day (where Feb 29 _does_not_exist_),
nothing else.
I would only add the by day because they'd be nice to have for WWII scenarios,
or some such.
how one goes about switching between the granularity, by epoch, event,
technology, etc. is another matter.
-mike
|
|