Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Why does Dogmeat talk like a Hubologist? #154

Closed
Anarcho-Bolshevik opened this issue Aug 17, 2022 · 12 comments
Closed

Why does Dogmeat talk like a Hubologist? #154

Anarcho-Bolshevik opened this issue Aug 17, 2022 · 12 comments
Assignees

Comments

@Anarcho-Bolshevik
Copy link

What happened

Usually when I pick up Dogmeat, his monologues in combat are based on the Khans’. I’ve noticed this since patch 1.02(!) but I’m assuming that this obvious peculiarity must have been intentional (for some reason) seeing as how it’s gone untouched for so long. However, I’ve noticed that sometime after I wiped out the Hubologist HQ, he now talks like a Hubologist in combat.

What you expected to happen

I expected him to continue talking like a Khan (though I don’t think that he should be speaking at all).

Screenshot

imagen_2022-08-16_233154947

Savegame

oh god somebody please end my suffering already.zip

@burner1024
Copy link
Member

Whaaaat. What trickery is this.
I've never seen Dogmeat do that, presumably because I very rarely take him, but I can reproduce this.
And he doesn't even have any combat floats scripted...

@Anarcho-Bolshevik
Copy link
Author

After you pick him up, you may have to progress through the story like normal for a bit before his monologues appear, but otherwise this peculiarity should be easy to trigger. Out of curiosity, I did a couple of searches to see if anybody else brought this up, but I found no relevant results. Nor could I find anything on the Fallout wiki mentioning this.

Honestly, for such an old and obvious glitch, it’s pretty hard to believe that nobody thought to report or even comment on it until now. That’s why I started wondering if it was intentional. I know that Dogmeat is one of the least accessible NPCs in Fallout 2, but twenty‐three years should be more than enough time for somebody to mention this online.

I’ll understand if you think that I must be playing some sort of prank on you; that sounds more probable to me than what I just described, too.

@NovaRain
Copy link

NovaRain commented Aug 18, 2022

In your save, for some reason Dogmeat is using Elron(Hubologist) AI packet instead of his original one. If I start a new game and go get Dogmeat right away, he's using the correct AI packet. I have no idea how that happens since there's no AI packet reassignment in game scripts, and the setting in all his protos is correct.

@Anarcho-Bolshevik
Copy link
Author

Try taking Dogmeat to Vault 15 and clear out the Khans starting with Darion. I can do that myself, but it’ll take me longer.

@NovaRain
Copy link

NovaRain commented Aug 18, 2022

The fastest way to check the AI packet in your game:

  1. Put this script: gl_testkey.zip in your data\scripts\ folder.
  2. Set StartingMap=rndcafe.map in ddraw.ini, start a new game to get Dogmeat right away.
  3. Press V key with Dogmeat in your party to see the printed message. The correct value should be "167".

@Anarcho-Bolshevik
Copy link
Author

Gentlepeople, I have located the trigger. Here are your steps:

  1. Recruit Dogmeat any way and any time you like
  2. When conversing with him, click on COMBAT CONTROL
  3. Set Dogmeat’s Disposition to either Berserk or Aggressive

That’s it.

@NovaRain
Copy link

NovaRain commented Aug 18, 2022

Switching between his disposition settings causes his AI packet value to keep decreasing, other dog type companions or other party members don't have such issue, weird.
EDIT: something is wrong with his Berserk setting, if it's just switching between Aggressive and Custom, the AI packet is correct. But after clicking Berserk everything goes haywire.

EDIT 2: OK, the order of AI packet numbers for Dogmeat is wrong in ai.txt, so after selecting Berserk, switching his disposition setting will cause his AI packet number to be lower than his supposed range (e.g. Khan, Hubologist, or even others with lower values). The catch is the real fix will cause crash on loading existing saves.

@burner1024
Copy link
Member

burner1024 commented Aug 25, 2022

Why does order even matter? Is it something hardcoded? I don't see AI_PARTY_DOGMEAT constants used anywhere.
And I don't quite understand what specifically causes the crash. Is is packet_num shuffling?

@NovaRain
Copy link

NovaRain commented Aug 25, 2022

The disposition presets for party members are defined with constants.
When the player selects a new preset, the engine calls ai_set_disposition(party_member_obj, disp), which has a calculation for new AI packet number like this:
new_ai_packet = curr_packet_num - (disp - curr_disposition)

So for Dogmeat's case, when you select "Berserk" (he's in Custom by default), it will be:
new_ai_packet = 167 - (4 - 0) = 163 (Tough Khan)
And further selection is just getting worse, if you switch to Aggressive, it's:
new_ai_packet = 163 - (3 - (-1, because packet 163 has disposition=none)) = 162 (Ron Cruz, which you get Hubologist lines)

@burner1024
Copy link
Member

burner1024 commented Aug 25, 2022

Hmm but still not clear why crash.
I'm thinking about maybe 2-phasing the fix: first switch and lock Dogmeat to a single working AI packet, and next version release fixed files and re-enable packet selection.
But it seems that any changes to ai.txt cause crashes, even in saves that don't have Dogmeat for some reason.

@NovaRain
Copy link

NovaRain commented Aug 25, 2022

Hmm but still not clear why crash.

Not exactly sure, probably data block mismatch, because you can see "Missing AI Packet" in debug log if you use the "fixed" ai.txt to load existing saves.

I'm thinking about maybe 2-phasing the fix: first switch and lock Dogmeat to a single working AI packet, and next version release fixed files and re-enable packet selection.
But it seems that any changes to ai.txt cause crashes, even in saves that don't have Dogmeat for some reason.

All party member protos are saved in the savegame, no matter one is in your party or not.
Maybe with a global script fix which always (on game/map load) corrects Dogmeat's AI packet if it's out of range when he's in the party, and disable the "berserk" in party.txt (the relative position/difference between aggressive/coward/custom packet numbers is correct, so switching between them is OK, but one might argue having "coward" packet doesn't suit Dogmeat). Just call it a day if you want to keep compatibility of existing saves.

Click to expand gl_dogmeatfix.ssl
procedure start begin
   if game_loaded then begin
      call map_enter_p_proc;
   end
end

procedure map_enter_p_proc begin
   if Dogmeat_Ptr then begin
      variable aiPacket := get_ai(Dogmeat_Ptr);
      if (aiPacket != AI_PARTY_DOGMEAT_AGRESSIVE and aiPacket != AI_PARTY_DOGMEAT_CUSTOM) then begin
         set_ai(Dogmeat_Ptr, AI_PARTY_DOGMEAT_CUSTOM); // reset
      end
   end
end

burner1024 added a commit that referenced this issue Aug 25, 2022
@burner1024
Copy link
Member

burner1024 commented Aug 25, 2022

Let's do that for the time being, and keep the full fix for when we break backwards compatibility anyway:

Same goes the pariah dog (unused). The defines in aipacket.h:

#define AI_PARTY_DOGMEAT_AGRESSIVE              (164)
#define AI_PARTY_DOGMEAT_BERSERK                (165)
#define AI_PARTY_DOGMEAT_COWARD                 (166)
#define AI_PARTY_DOGMEAT_CUSTOM                 (167)
#define AI_PARTY_DOGMEAT_DEFENSIVE              (168)
#define AI_PARTY_PARIADOG_AGRESSIVE             (169)
#define AI_PARTY_PARIADOG_BERSERK               (170)
#define AI_PARTY_PARIADOG_COWARD                (171)
#define AI_PARTY_PARIADOG_CUSTOM                (172)
#define AI_PARTY_PARIADOG_DEFENSIVE             (173)

The correct order:

#define AI_PARTY_DOGMEAT_BERSERK                (164)
#define AI_PARTY_DOGMEAT_AGRESSIVE              (165)
#define AI_PARTY_DOGMEAT_DEFENSIVE              (166)
#define AI_PARTY_DOGMEAT_COWARD                 (167)
#define AI_PARTY_DOGMEAT_CUSTOM                 (168)
#define AI_PARTY_PARIADOG_BERSERK               (169)
#define AI_PARTY_PARIADOG_AGRESSIVE             (170)
#define AI_PARTY_PARIADOG_DEFENSIVE             (171)
#define AI_PARTY_PARIADOG_COWARD                (172)
#define AI_PARTY_PARIADOG_CUSTOM                (173)

Here are the corrected ai.txt, aipacket.h, and protos, but ai.txt will cause old saves broken.

Dogmeat_AI_fix.zip

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants