[Mystara Database] Time

Home of Thorf's myriad Secret Projects.

Moderators: Havard, agathokles, Thorf

Post Reply
User avatar
Thorf
Cartomancer
Posts: 2482
Joined: Fri May 23, 2008 2:41 am
Gender: male
Location: Akita, Japan
Contact:

[Mystara Database] Time

Post by Thorf » Tue Jul 15, 2008 5:19 am

The Time table brings together various definition tables to present a certain year, month, weekday, day, and/or time - all variables are optional, so it could be just a year, just a month, just a day, or a mixture.

mdb_time
id
mdb_time_year_id
mdb_time_month_id
mdb_time_weekday_id
day
time

What records we attach this too is another matter which we will discuss after the definitions.

The reference tables act as follows:

mdb_time_year
id
year_thyatian
year_alphatian
year_rockhome

The year table holds one record for each year, with the main entry being Thyatian year, although equivalent years will all be listed in the same record. (We may be able to work out a formula to generate the other years automatically from the Thyatian or Alphatian year; the Alphatian year is handy for calculations because it is a regular integer, including minus figures.

Are there any other cultural years I need to add here? If any culture starts its year in a different month, that could cause us some problems and we'll have to make things a bit more complicated.

mdb_time_season
id
season_north
season_south

The season table has only four entries, and includes the northern and southern hemisphere seasons together.

mdb_time_month
id
month_thyatian
month_alphatian
month_rockhome
mdb_time_season_id

The months table is where things start to get a bit more complicated, because a few cultures have months out of synch with the rest.

Also, the months table maps each month to a season, although which season depends on the hemisphere.

mdb_time_month_shadow_elf
id
month_shadow_elf

Shadow Elf months are irregular compared to Thyatian months, and we need to define this in the table. Quite how to go about doing this, I have yet to figure out. It may require us to define a table of days and then establish some linkage tables - or we could just put all the equivalent days in the same table, like I have done with the years.

In any case, the point is to establish a reference defining each day of the year that can be used easily in the main Time table.

mdb_time_weekday
id
day_thyatian
day_alphatian
day_rockhome
day_shadow_elf

On reflection, another way to do this would be simply to have a single table tying together the sub-tables for seasons, months, weekdays and days:

mdb_time_definition
id
mdb_time_thyatian_year_id
mdb_time_thyatian_month_id
mdb_time_thyatian_weekday_id
mdb_time_thyatian_day
mdb_time_alphatian_year_id
mdb_time_alphatian_month_id
mdb_time_alphatian_weekday_id
mdb_time_alphatian_day
mdb_time_rockhome_year_id
mdb_time_rockhome_month_id
mdb_time_rockhome_weekday_id
mdb_time_rockhome_day
mdb_time_shadow_elf_year_id
mdb_time_shadow_elf_month_id
mdb_time_shadow_elf_weekday_id
mdb_time_shadow_elf_day
mdb_time_season_id

Such a table would have a record for every day of the year, defining the day, weekday, month and season for that day in all the different calendars. Then it would be a reasonably simple matter to have another table combining this info with years, times, and timezones.

mdb_time
id
mdb_time_definition_id
mdb_time_year_id
time
mdb_time_zone_id

But does this prevent us from referencing individual months or seasons?

Post Reply

Return to “Thorf's Projects”