Companion death ends combat

What do you think about the game? Share your experiences. You can ask other players for advice about quests, or report bugs here as well. POSSIBLE SPOILERS!

Moderators: Ratman, Seto, Saruman, feťák8, valcik, NovaRain

Post Reply
User avatar
Muttie
Idolized
Posts: 145
Joined: Tue Dec 26, 2017 10:42 pm

Companion death ends combat

Post by Muttie »

I did find a slightly disturbing bug, while testing Tribe Friend. Normally the fact that combat ends when a companion is killed is only annoying but during the hospital fight I had repeatedly the issue that it would wipe the XP.
During the hospital fight in Dead Quarter I should get about 3000 XP (the fight, not the 3000 XP for the quest). However I managed to skip those 3000 XP. What happened was that Mutt got killed “accidentally” by an Imperial Soldier, which ended combat. I restarted combat (by clicking on the active slot) as three doctors where still alive. I killed the doctor in sight, presumed it to be the last and ended combat on my own. I was then granted 100 XP, and at that point I noticed that I didn't get any XP for the main bulk of the fight. I then moved north, killed the remaining two (got another 200 XP), the screen faded, map cleared and that was it. I have a save before the fight (41.398 XP) (Slot245_HospitalBefore) and one after the fight (41.698 XP) (Slot245_HospitalAfter). At first I thought the death of several tribals (5) may deduct XP, but in another attempt I've lost 4 plus Gurgan and still got 3125 XP for the fight.
Then I assumed it's the Fallout engine (combat is always a bit messy), but I had another fight and it happened again. This time a donor-hunter killed Mutt, combat ended, restarted on it's own, and wiped all XP. I only got 575 XP for killing the rest after the combat-restart. Again I have saves before (Slot247_HospitalBefore2) (41.286 XP) and after the fight (Slot248_HospitalAfter2) (41.861 XP).
This may be tricky to reproduce as killing Mutt oneself doesn't work, it ends combat and assigns XP as it should.
However the bug is consistent (I triggered it four times by now). I have one save that is in combat (Slot249_HospitalFight) and from which I was able to create the bug. I've added a screenshot (a proper one) of that scenario. You can see in the text window that Mutt died (which should end and restart combat). But there is no XP gain listed. It should be possible to reproduce this from (Slot249_HospitalFight). This save is in combat, and after pressing space, a donor-hunter should take a shot at Mutt. You only have to hope he hits Mutt with a critical. (As you may guess, getting that critical may take some time).
Consequently, I've created another save (Slot250_HospitalFight2) in which I've weakened Mutt before starting the attack, aka talking to Gurgan. (I've shot him a couple of times, don't tell anyone). He is down to 34 HP. This is still no guarantee for Mut getting killed, but during the second attempt I elected to do nothing but just press space repeatedly. This resulted in me drawing less fire onto myself (and more on others, like Mutt) and Mutt would go left, rather than right which helps to get him burst down by Paul (which happened, and again, combat ended, restarted, no XP). I ended the fight without firing a single shot, the screen faded, map cleared etc, go the XP for opponents killed after the restart and that was it.

This is the folder with all saves mentioned above (it's 6,31 MB zipped, and contains 6 saves and a screenshot): http://www.filedropper.com/hospitalfight
The most interesting of those is probably Slot250, the rest is just documentation.

P.S. Normally this combat restart is more a nuisance then a problem (and death of a companion is for many a reload anyway, but when it wipes 3000 XP it starts to become concerning, especially for those few players who want to play “realistically” and accept the death of a companion).

I have not tested this with the death of a human companion. But it may work to weaken Keri, take all range weapons of her and set her on charge. (The folder has two saves before the fight.)

I'm not even sure if this is a Resurrection or a Fallout problem. If you would ask me if the death of a companion ended combat in the RP Mod. I couldn't even say. And I played that only a few months ago.
Consequently I don't even know if anything can be done about it.

P.S.S. When I tried to reproduce this and ended combat by killing Mutt myself I got 1750 XP. I then saved, loaded and continued the fight. First thing I did was to use an ultra stimpak. I did not get hit again, and got 3005 XP for ending the fight “without taking a scratch” (i.e. it appears a combat restart also resets that counter). However, this is not as big a deal as wiping XP. It's just one of those weird behaviours which “combat restarts caused by the death of a companion” creates.
Others are the possibility to cancel the combat restart by staying out of sight when combat ends, like standing behind a wall etc. This worked during the battle for Imperial City and allowed the use of First Aid and other time consuming activities “in combat situations” like reading Waiting for love etc.. Or that a restart seems to give the last opponent his/er last turn back (i.e. used AP). They often seem to fire once more than they normally should. However, all this is “bought” with the death of a companion, which either takes the edge out of it, or causes a reload anyway, still, it's inconvenient.
User avatar
Daemon
Resurrection team member
Posts: 1179
Joined: Fri Dec 14, 2007 9:49 pm
Contact:

Re: Companion death ends combat

Post by Daemon »

Death of a companion ending combat is only Resurrection thing. Resurrection works with companions differently than it was in the original Fallout 2 and that caused problems with their death. It can cause a crash to desktop and save file corruption. Ending the combat is a work-around that prevents these serious errors from occurring. It's mentioned in Resurrection in "Known Issues" part.

But you shouldn't lose the XP because of it. That's a bug.
User avatar
NovaRain
Liked
Posts: 73
Joined: Fri Jul 15, 2016 5:40 pm

Re: Companion death ends combat

Post by NovaRain »

It seems the problem is in Mutt's script. If he died, the script will terminate the combat prematurely.
decompiled vorech.int wrote:procedure destroy_p_proc
begin
set_global_var(1042, self_obj);
terminate_combat;
add_timer_event(dude_obj, 0, 4);
end
User avatar
Daemon
Resurrection team member
Posts: 1179
Joined: Fri Dec 14, 2007 9:49 pm
Contact:

Re: Companion death ends combat

Post by Daemon »

Yes, ending combat is intentional. But it seems that terminating combat is causing the player losing XP from killed enemies.
User avatar
NovaRain
Liked
Posts: 73
Joined: Fri Jul 15, 2016 5:40 pm

Re: Companion death ends combat

Post by NovaRain »

Because terminate_combat simply ends the combat without calling other functions (e.g. calculating player's gain xp) like how player ends the combat normally.
The script manual does mention it should be used with caution.

EDIT: IMO if the goal is to prevent "saving in combat when a companion died" file corruption, it's probably easier to just set SaveInCombatFix=2 to disable saving in combat completely.
User avatar
Daemon
Resurrection team member
Posts: 1179
Joined: Fri Dec 14, 2007 9:49 pm
Contact:

Re: Companion death ends combat

Post by Daemon »

NovaRain wrote:IMO if the goal is to prevent "saving in combat when a companion died" file corruption, it's probably easier to just set SaveInCombatFix=2 to disable saving in combat completely.
That would be too much hardcore, too much annoying. Even not be able to save in middle of your turn upsets some people. And since they can easily change it by editing ini (which is what most of the players would do), it isn't very effective fix.

It's a long time but if I remember correctly, the problem was occuring even if you saved the game after the combat ended. Just the presence of dead body of a companion in the map was causing it. That's why a companion prototype is swapped with non-companion copy. But it can't be done during the combat, therefore the combat is terminated.
User avatar
Muttie
Idolized
Posts: 145
Joined: Tue Dec 26, 2017 10:42 pm

Re: Companion death ends combat

Post by Muttie »

I can't really help at this point, but:
If Mutt's script is the problem, it may be interesting that it only occurs when an enemy or ally kills Mutt. If I kill him myself, the XP is not wiped.

Because that was the first thing I've tried to reproduce the bug.

I assume that ending combat "during my turn" and ending combat "outside of my turn" works differently. But perhaps it can be emulated and shoehorned in somehow.
User avatar
NovaRain
Liked
Posts: 73
Joined: Fri Jul 15, 2016 5:40 pm

Re: Companion death ends combat

Post by NovaRain »

Maybe only terminating the combat when it's player's turn, e.g. Mutt killed by a raider, but the combat still goes on until player's turn.
sfall 4.0 added HOOK_COMBATTURN that runs before and after each turn in combat for both PC and NPC, combining with HOOK_ONDEATH it might be possible to pack all "terminate the combat when a companion dies" code in only one global script.
Post Reply