Reinforcements arrived.

Discuss coding questions, pull requests, and implementation details.
User avatar
Galactic Chimp
Posts: 16
Joined: Wed Apr 29, 2020 10:25 pm

Re: Reinforcements arrived.

Post by Galactic Chimp »

Ok, created pull request with changes: https://github.com/Interkarma/daggerfal ... /pull/1821

also you can now only interract with Bulletin Boards if you are in Info mode + set max interaction distance.
Bulletin Read Distance.png
Bulletin Read Distance.png (576.83 KiB) Viewed 1794 times
deermore.PNG
deermore.PNG (269.86 KiB) Viewed 1794 times

User avatar
pango
Posts: 3357
Joined: Wed Jul 18, 2018 6:14 pm
Location: France
Contact:

Re: Reinforcements arrived.

Post by pango »

Nice!
Mastodon: @pango@fosstodon.org
When a measure becomes a target, it ceases to be a good measure.
-- Charles Goodhart

User avatar
Interkarma
Posts: 7242
Joined: Sun Mar 22, 2015 1:51 am

Re: Reinforcements arrived.

Post by Interkarma »

This is lovely to see working in the game for real. Thank you for your hard work on this. :) Will review PR when I can and merge ahead of next builds.

User avatar
Ferital
Posts: 282
Joined: Thu Apr 05, 2018 8:01 am

Re: Reinforcements arrived.

Post by Ferital »

Yes, this is great! From what I saw while reverse engineering classic, this matches the original game behavior. As I said to Galactic Chimp through PM, I will only need to figure out why in classic some towns are displaying all regional rumors when there is more than one, while others are showing only the first one. I'm not sure if it was even intended to get several "sign rumors" per region.
Galactic Chimp wrote: Wed May 13, 2020 6:58 pm
deermore.PNG
deermore.PNG (269.86 KiB) Viewed 1741 times
Seeing Daggerfall's Royal Guard allied to Shalgora does not really make sense :o I may need to add the first faction to the list of exclusions from the rumor mill, alongside "Random Ruler" and "Generic Knightly Order" :D

User avatar
Ferital
Posts: 282
Joined: Thu Apr 05, 2018 8:01 am

Re: Reinforcements arrived.

Post by Ferital »

Here is the decompiled loop from the classic function which adds regional rumors to the bulletin board popup, after the region name:

Code: Select all

// Iterating over rumors
for ( rumor = (rumor_info *)g_memory_buffer;
      rumor < last_rumor_offset;
      rumor = (rumor_info *)((char *)rumor + rumor->text_length + offsetof(rumor_info, rumor_text)) )
{
  if ( is_rumor_valid(rumor, 0, 1, 0) ) // Third argument set to 1 means we want only regional rumors
  {
    memcpy(bulletin_board_text, &rumor->rumor_text, rumor->text_length);
    text_pos = &bulletin_board_text[rumor->text_length - 1];
    text_pos[1] = 0xFC;              // Add a line break followed by justified text
    *text_pos = text_pos[1];         // Replace the rumor text line break (always 0xFD) by 0xFC (see above)
    bulletin_board_text = text_pos + 2;
  }
}
We can see there that all local rumors are supposed to be displayed on a given region's bulletin boards, no matter the city. When classic displays only the first one, this probably comes from a text parsing issue. So, Galactic Chimp implementation definitely matches the original game.

Post Reply