Menu

#1892 SI: sacrificed Dupre back in party

Release Block
closed-fixed
None
9
2016-05-03
2014-11-19
No

In the Shrine of balance, after you are declared champion of balance by the Great Earth Serpent and received the eye of order you are teleported back and reunited with your party. Sacrificed Dupre is back in the fold and will complain off screen about the cold.

In the savegame, step on the teleport, go north, place serpent staff, armor and crown on altar.
Curiosly, when you save after this and reload Dupre is gone again...

1 Attachments

Discussion

1 2 > >> (Page 1 of 2)
  • Dominik Reichardt

    Savegame 178 is right before the sacrifice.

     
  • Dominik Reichardt

    • Priority: 5 --> 9
     
  • Dominik Reichardt

    The probnlem predates my backed up Exult builts, so it is older than 10-4-27

     
  • Dominik Reichardt

    • Group: Cosmetic --> Release Block
     
  • Dominik Reichardt

    It also happens when you cast serpent bond and when the spell fades out the party is reunited.

     
  • Dominik Reichardt

    I found the culprit: The SilverSeed maze, when usecode removes all of your companions.

    Steps to reproduce with a new game:
    1. Start a new game
    2. set flag 96 (0x60) (->Avatar knows he must sacrifice himself)
    3. teleport to 2591/2746
    4. talk to the witch
    5. go through the tunnel to the west towards the maze
    6. the companions will leave
    7. also leave to the east, do not actually enter maze
    8. retrieve spellbook from hollow tree
    9. rejoin the companions
    10. teleport to the crematorium (807/2597)
    11. sacrifice
    12. cast serpent bond (archwizard mode)

    once serpentbond fades the companions, including Dupre will rejoin. If you sacrifice and cast serpent bond before step 5, everything is fine.

     
    • Phillip T. George

      Thanks for the detailed steps. I was able to recreate it. I'll try to work on this. Might take me a while as I haven't looked at the Exult code in quite some time.

       
  • Malignant Manor

    Malignant Manor - 2016-02-08

    You can stop it by adding
    || npc->is_dead()
    to line 61 in party.cc
    I don't have a good case to check resurrection of dead party members when the Avatar dies in SI, because each save I try doesn't resurrect party members even without changes. BG death worked fine,

    Edited out alternative that doesn't work

     

    Last edit: Malignant Manor 2016-02-08
  • Malignant Manor

    Malignant Manor - 2016-02-08

    This bug does not occur in the original game engine.

     
  • Marzo Sette Torres Junior

    I think that the issue may be that we remove the NPC from the dead party list when he is added to party.

     
  • Malignant Manor

    Malignant Manor - 2016-02-08

    Commenting out the two remove_from_dead_party calls didn't fix anything.

     
  • Phillip T. George

    So if you remove dupre from the party (via flags manipulation) after talking to the witch but before your other companions leave, then the issue doesn't happen. I have all of the companions join back and he doesn't come back to life. There's definitely some odd condition being set there, but I don't know what yet. I don't think we want to use the is_dead on line 61 for party.cc as that could cause other issues potentially and does not get to the root of the problem.

     
  • Phillip T. George

    Found another workaround. I noticed in the NPC flags of the cheat menu that something called "ID" was getting set to 31 after heading west and my party leaves. After they join, it does not get reset. However, if I go to the NPC flags and set it back to "00", then dupre does not come back to life after casting serpent bond and waiting for it to wear off. I'm assuming this id field is something of a "previous state or last activity" for that NPC, as 31 corresponds to "following avatar". If I understand this correctly, I think the fix might be to reset the ID to 0 if its set to 31 when a NPC joins the party. Or, in other words, the previous state or last activity should likely never match the current state or current activity. I'll have to dig in more to validate that's what this really means.

     
  • Phillip T. George

    Think I found what/where might have introduced this.

    actors.h

    534 //++++++Is_dead() test messes up training.
    535 //      unsigned char get_ident() { return is_dead() ? 0 : ident; }
    536         unsigned char get_ident() {
    537                 return ident;
    538         }
    

    get_ident is what returns the ID. As found in cheat_screen.cc

    1544                 snprintf(buf, 512, "[V] ID#:%02i", actor->get_ident());
    1545                 font->paint_text_fixedwidth(ibuf, buf, 208, maxy - 72, 8);
    
     
  • Phillip T. George

    • assigned_to: Phillip T. George
     
  • Marzo Sette Torres Junior

    ID is a field SI uses to store some state. For Serpent Bond, it is used to track which party members ought to come back when the spell ends. Maybe the issue here is that ID is being set when it should not have been; I think a git bisect may help find when things started going wrong, but the save is probably tainted and will cause issues.

     
  • Phillip T. George

    Thanks for the info. I am trying to track when its set but tracking set_ident is oddly not showing everytime ident is changing... that is putting cout in the beginning of the function really only shows set_ident is getting called after loading a game. After you go west and your party leavies...their ident is set to 31. Any idea what I might be missing? I'll keep looking and try using some debug tools.

     
  • Phillip T. George

    Seems to be getting set by set_npc_id within usecode/intrinsics.cc ... which shows as UI_set_npc_id when debugging. For some reason cout is not working within there....

     
  • Dominik Reichardt

    Marzo, with the easy steps outlined above it is easy to reproduce the issue with a new game. Git bisect wil likely not reveal the issue as it predates my snapshots and further back you have to fix several things to make EXULT even compile on modern compilers.

     
  • Phillip T. George

    Uhg disregard about cout not working for set_npc_id function. Had to 'make clean' in the usecode dir, then make again.

     
  • Phillip T. George

    Recreated in the save game as well. Also, if I clear Dupre's ID flag (set it to 0, where it was set to 31 before) then he does not come back to life. It seems that we need to clear that flag whenever he is sacrificed. I wonder if it be appropriate to set it to 0 on death or not?

     
  • Dominik Reichardt

    maybe not on death (because he could die "normally") but on the sacrified flag. no idea which lag that is but it's probably in the autonotes list.

     
  • Phillip T. George

    I did some deeper debugging on usecode/intrinsics.cc ... looks like "remove_npc" is getting called when Dupre sacrifices himself. I did a fix by setting ident to 0 if ident is set to the follow_avatar flag. Its possible ident should always be cleared whenever a NPC is removed, but I don't think I can safely make that assumption. This fix obviously will not resolve any save games past where Dupre sacrificed, but it will prevent it from happening in any new games. Not sure that we want to add a dirty hack / fix for already saved games.

     
  • Phillip T. George

    • status: open --> pending-fixed
     
  • Phillip T. George

    Setting "pending-fixed" until someone else reviews and verifies the fix is good.

     
1 2 > >> (Page 1 of 2)