X2CommunityCore / X2WOTCCommunityHighlander

https://steamcommunity.com/workshop/filedetails/?id=1134256495
MIT License
60 stars 69 forks source link

Grappling sometimes crashes the game #1201

Closed Iridar closed 2 months ago

Iridar commented 1 year ago

Allegedly this bug is caused by Highlander itself.

I've experienced this crash myself, and I think it might be caused by a relatively recent addition.

The first order of business is doing some extensive testing with the grapple with and without Highlander to confirm the problem, and ideally find reproduction steps.

If we can at least confirm the problem is caused by highlander, the next step is to keep rolling back through versions until we can identify the version that causes the crash.

Then we can roll back issue commits one by one until we find the exact cause.

nqminhuit commented 1 year ago

@Iridar I remember playing with the highlander a few years back did not have this grappling crash Is there anyway I can help to binary search for the commit causing this? I know about 'git bisect' but not familiar with building highlander, just following this guide? https://github.com/X2CommunityCore/X2WOTCCommunityHighlander#building

Iridar commented 1 year ago

Got a relevant steam comment on this issue:

When running a templar on your squad upon reaching tier 3 weapons and equipement, any skill involving grapples from any unit on the map and status procs (Venom and Acid) will cause the game to crash often.

I've lost Several Campaigns trying to track this issue to no avail, changing and removing mods and starting fresh, but that was because the real problem was highlander (Not sure if is the normal one or the Alien hunters the one that causes it). i remember a couple of years ago finishing a full campaign with only the regular highlander so could be one of the updates it got.

Tedster59 commented 1 year ago

I'm betting there's a visualization hang somewhere. I've been trying to hunt down a similar issue where overwatch shots taken by units with both weapon shot particle effects and custom ammo particle effects would cause inconsistent crashing, I wonder if these are related.

Iridar commented 1 year ago

I'm betting there's a visualization hang somewhere. I've been trying to hunt down a similar issue where overwatch shots taken by units with both weapon shot particle effects and custom ammo particle effects would cause inconsistent crashing, I wonder if these are related.

Someone said that's related to XSkin, is it not then?

Tedster59 commented 1 year ago

It might be some bugged particle effects or visualizer jank still. XSkin might just be caught in the middle as it lets you swap in the weapon skins that have additional particle effects, such as Frost Legion's Shrike rifle skin/effect, or the Star Wars weapon reskins. My theory is that gun projectile particle effect + ammo projectile particle conflict causes the visualizer to choke somewhere, but I don't know exactly where.

nqminhuit commented 1 year ago

Someone said that's related to XSkin, is it not then?

I don't think it related to XSkin, I don't have XSkin on my mod list when this issue happened

When running a templar on your squad upon reaching tier 3 weapons and equipement

Not sure about the Templar, but I'm quite sure the crash started to happen on tier 3 weapons and armors

Iridar commented 1 year ago

Someone said that's related to XSkin, is it not then?

I don't think it related to XSkin, I don't have XSkin on my mod list when this issue happened

When running a templar on your squad upon reaching tier 3 weapons and equipement

Not sure about the Templar, but I'm quite sure the crash started to happen on tier 3 weapons and armors

Sorry for the confusion, the XSkin bit was regarding crashing with special ammo and reaction shots, not regarding grappling and templars.

BlackDog86 commented 1 year ago

I've basically been unable to reproduce this in Skirmish mode, tried for quite some time with a templar, tier 3 armour and weapons, grappling into fire / poison clouds & all sorts, tried skirmisher, spider & powered grapple - couldn't make it crash.

I'm inclined towards thinking it may be an issue with specific types of maps / plots or something & I just haven't found a particularly buggy one yet.

skarsatai commented 1 year ago

I have an interesting CTD report for the grapple topic. An advent purge cyborg tried to grapple an unknown raider. no xcom grapple was involved. the hook reached the raider, missed and returned back to the purge cyborg. and at this point the game freezed and later ctd.

Iridar commented 1 year ago

SUP! Got an update on the templar bug i mentioned before, learned how to trigger it and avoid it completely, was part luck and part trial and error (Tested every plasma upgrade one at at a time).

Crash happens with a Templar on squad after reaching Plasma tier weapons and ONLY AFTER UNLOCKING THE ABILITY CHANNEL(the one that drops focus on kill) and will happen randomly during the mission.

Grapples, Whiplash and several Status Procs from any unit will cause the game to crash randomly(Acid, Elerium, Poison, AP rounds so far and most of the time when a unit is killed). Kept playing without channel ability and can play for hours with no crashes, Tested with a back up save and only upgraded my templar before going inside mission, thats how i tracked it down.

Cleared a campaign with no highlander and channel active and no crashes so it only happens after installing it.

Thats it so hope it helps.

Iridar commented 1 year ago

Interestingly, the latest comment seems to indicate this issue might have the same cause as #1229

nqminhuit commented 1 year ago

Thank you for the update, that information is very much appreciated. I'm on the middle of a campaign, (tier 2 tech) haven't got any crashes yet and not upgrade Channel ability yet, will try to test this theory out. Never like that Channel ability anyway.

BlackDog86 commented 1 year ago

I'll take a look at reproducing this over the weekend & see if I can make it happen as predictably as in the example provided & if it crashes look into the code for channel & see what it's interfering with. Can't promise Ill be able to do anything about it but maybe can narrow down some target areas.

nqminhuit commented 1 year ago

I've been playing with tier 3 tech for a while now (not finish campaign yet) without "Channel" and there is no crash so far. Tested with X2WOTCCommunityHighlander v1.26.3

edit: I just finished the campaign with 92 missions won without Channel ability of the Templar, no grappling crash at all.

Tedster59 commented 3 months ago

Large breakthrough from Robojumper debugging crash dumps:

image

image

Checking for uses of this in CHL code, the changes from Issue #720 are potentially related.

some other speculation from Robojumper: image

Tedster59 commented 3 months ago

potential likely culprit:

image

Sets the ParticleEffectComponent to none but doesn't set bConstantComplete to true. Proposed solution from Robojumper

if (Projectiles[i].ProjectileElement.UseProjectileType == eProjectileType_RangedConstant) { Projectiles[i].bConstantComplete = true; }