OpenTESArena icon indicating copy to clipboard operation
OpenTESArena copied to clipboard

Holidays

Open Allofich opened this issue 5 years ago • 6 comments

I found the list of holiday dates used by Arena. The offset for aExeStrings.txt is 3EAA9.

It looks like

00 00 // New Life Festival - 1st of Morning Star (Jan)
0E 00 // South Wind's Prayer - 15th of Morning Star (Jan)
2D 00 // Hearts Day - 16th of Sun's Dawn (Feb) ("Heart's Day" in the Arena strategy guide "Codex Scientia")
42 00 // First Planting - 7th of First Seed (Mar)
75 00 // Jester's Day - 28th of Rain's Hand (Apr)
7E 00 // Second Planting - 7th of Second Seed (May)
A5 00 // Mid-Year Celebration - 16th of Mid Year (June) ("Mid Year Celebration" in Codex Scientia)
BD 00 // Merchants Festival - 10th of Sun's Height (July) ("Merchant's Festival" in Codex Scientia)
C7 00 // Sun's Rest - 20th of Sun's Height (July)
EC 00 // Harvest End - 27th of Last Seed (Aug) ("Harvest's End" in Codex Scientia)
F2 00 // Tales and Tallow - 3rd of Hearthfire (Sep) ("Tales and Tallows" and month is "Heart Fire" in Codex Scientia)
1A 01 // Witches Festival - 13th of Frostfall (Oct) ("Witches' Festival" in Codex Scientia)
2B 01 // Emperor's Day - 30th of Frostfall (Oct) ("Emperor's Birthday" in Codex Scientia)
3F 01 // Warriors Festival - 20th of Sun's Dusk (Nov) ("Warrior's Festival" in Codex Scientia)
58 01 // North Wind's Prayer - 15th of Evening Star (Dec)

There is also one unused holiday, in the Codex Scientia but for which an entry in the above data is missing: Old Life Festival - 30th of Evening Star (Dec) It's also unused in Daggerfall, BTW.

The dates in the data are 0-based, so the first day of the year is 00, the 15th is 0E, etc. Each month is 30 days, so there are 360 days in the year. You should be able to get whether the current day is a holiday with something like:

int GetHolidayID()
{
   int day = gameMinutes % 518400 / 1440; // 518400 minutes in a 360-day year, 1440 minutes per day
   int index = 0;
   while ( index < 15 )
   {
      if ( holidayDates[index] == day )
      {
        return index;
      }
      ++index;
    }
    return -1; // Not a holiday
}

Then we'd still need to handle displaying the holiday descriptions from TEMPLATE.DAT, of course.

Allofich avatar Sep 15 '18 12:09 Allofich

I'll attach a few videos:

The order of display when arriving from fast travel on a holiday (video1) is:

  1. Fast travel map
  2. Fade out
  3. Horse-riding animation
  4. Fade out
  5. Holiday text, on black background (compass showing, no menu bar)
  6. City intro text, on black background (compass showing, no menu bar)
  7. Fade out (menu bar appears before fade out)
  8. 3d world, intro fanfare plays

You may not want the compass or menu bar showing while the background is black, those seem kind of like mistakes, unless you want to completely recreate the original game's look.

The holiday text display doesn't happen while you're in a building or outside the city walls. If you exit a building and it has become a holiday (video2):

  1. Fade out interior 3d world
  2. Show exterior 3d world
  3. After half a second or so, text displays, and intro fanfare plays.

Same with entering a city from outside the city walls on a holiday, although there doesn't seem to be a fade out in that case. (video3)

I think the holiday text is only done once per day.

If you are in the city exterior when midnight comes and it becomes a holiday, the text is displayed at soon as it becomes midnight (video4, a little hard to see as it becomes midnight as soon as I exit from the status popup). Videos.zip

Allofich avatar Sep 15 '18 14:09 Allofich

The fade out stuff is of course, a separate issue. I just wanted to describe the display order in the original game.

Allofich avatar Sep 15 '18 14:09 Allofich

Thanks @Allofich! The holiday names and dates are being read into memory now in commit 3618ea6ddd7ca54fd266c6cb49b81609fce46f1d.

I'm not sure if I'll get to implementing holiday pop-ups for 0.8.0 since I wanted to get the release out this weekend or next weekend, and the last big thing on the list was to fix the door rendering issue. In theory the pop-ups should be easy to do since it's very similar to the city arrival message. I also need to refactor the TEMPLATE.DAT reader a bit so it uses integers instead of strings for mapping to text.

afritz1 avatar Sep 15 '18 17:09 afritz1

That's fine.

I found out a bit more. As you probably know, on the holidays various services are half-off, free, etc.

This data seems to be found at offset 0x3EA4F. There are 6 bytes for each holiday (except for the unused Old Life Festival), in the order that the holidays come in a year. I believe the first byte of each record refers to the service type that is affected by that holiday.

4 = Tavern services 5 = Temple services 6 = Equip services 7 = Mages Guild services

The remaining bytes are probably the details on how the service prices are affected that holiday. This is just FYI for now, I only opened this issue for the text popup. You could go ahead and read in the data if you want, though.

Edit: I think I've largely figured it out, comparing the values to the holiday descriptions of what services are discounted or free.

For the 5 bytes after the service type, I think they map something like this:

1                       2               3               4               5
Open/Closed		Drinks 		Room		-		-            // Tavern
Open/Closed		Heal		Cure		-		Bless        // Temple
Open/Closed		Weapons		Armor?		Repair?		-            // Equip
Open/Closed		Spells		Detect		Items?		Potions?     // Mages Guild

Armor and Repair might be reversed, as might Items and Potions. Open/Closed is 1 for open, 0 for closed. Others are 4 for for full price, 2 for half, and 1 is (I guess) 1/4.

The data looks like below:

04 01 00 04 01 01 // New Life Festival - Tavern, Open, Drink: Free
05 01 00 04 01 04 // South Wind's Prayer - Temple, Open, Heal: Free
04 01 04 00 01 01 // Hearts Day - Tavern, Open, Room: Free
05 01 04 00 01 04 // First Planting - Temple, Open, Cure: Free
06 01 04 04 04 01 // Jester's Day - Equip, Open (no effect, all full price)
05 01 04 00 01 04 // Second Planting - Temple, Open, Cure: Free
05 01 04 04 01 02 // Mid-Year Celebration - Temple, Open, Bless: Half
06 01 02 02 02 01 // Merchants Festival - Equip, Open, Weapon: Half, Armor: Half, Repair: Half
06 00 04 04 04 01 // Sun's Rest - Equip, Closed.
04 01 00 04 01 01 // Harvest End - Tavern, Open, Drink: Free
07 01 04 04 02 02 // Tales and Tallow - Mages Guild, Open, Items: Half, Potions: Half
07 01 02 00 04 04 // Witches Festival - Mages Guild, Open, Spells: Half, Detect: Free
06 01 04 04 04 01 // Emperor's Day - Equip, Open (no effect, all full price)
06 01 02 04 04 04 // Warriors Festival - Equip, Open, Weapon: Half
05 01 02 04 01 04 // North Wind's Prayer - Temple, Open, Heal: Half (Note: Doesn't match description, which says heal, cure and bless are all half-off)

BTW, the description for Old Life Festival gives a clue why it may have been dropped.

it is rumored that priests will as the last act of the year perform resurrections on beloved friends and family members free of the usual charge.

Looks like a leftover from when the game was party-based. This also might be why there is a gap (3rd slot) in the temple services mapping.

Allofich avatar Sep 16 '18 06:09 Allofich

https://github.com/afritz1/OpenTESArena/wiki/Time-and-Calendar#holidays :)

Carmina16 avatar Sep 16 '18 22:09 Carmina16

I thought it was odd that you hadn't reversed something this simple yet. I searched for "holiday" in the search bar at the top of the screen, but that seems to only check the repository. I also searched "holiday" on the wiki tab, but looks like that only searches the page titles. Seems there is no way to search the wiki page contents, unless I am missing it. I also did a quick manual skim over the wiki pages, but missed the holiday part somehow. Oh well, at least you have confirmation from another person :). I was also interested finding the potential reason why Old Life Festival was cut - possibly because the service event would have been free resurrections, something no longer in the game after the 4-person party was removed.

Allofich avatar Sep 17 '18 05:09 Allofich