[Bug] Player takes extra damage when cockpit is off

Any issues with the XWAU or X-Wing Alliance? Please let us know here!
Post Reply

[Bug] Player takes extra damage when cockpit is off

Random Starfighter
Cadet 3rd Class
Posts: 34
Joined: Tue Oct 13, 2020 12:14 am

Post by Random Starfighter » Mon Jul 05, 2021 2:33 am

When the player turns the cockpit view off (via the "." key) the player will receive more damage when hit by laser projectiles, for as long as the cockpit is off. It appears to cause multiple impacts, stacking up extra damage beyond what would normally be applied. The damage will return to normal when the cockpit is visible.

Here's a video demonstrating the bug.
https://drive.google.com/file/d/1Nsn-7a ... sp=sharing

Details:

I've narrowed down the offending hook: Hook_Weapon_Color.dll
Removing or renaming the hook (with a leading underscore "_") to disable the hook will "solve" the bug.

To replicate the bug, install any version of XWAU Mega 2020. The bug is present in XWAU Mega (original release), Update 4, and persists in TFTC as well. No other modifications or alterations applied, it works after a clean install. At the time of posting, the XwaHooksSetup tool does not resolve the issue.

To observe the bug, launch XWA. Create a skirmish mission (in my case I was flying an Assault Gunboat) with a single enemy mine, distance 1km. Note the percent damage that the laser does with the cockpit on, then switch the cockpit off ("." key) and note the damage again.

Without the hook, the mine will do about 4/4% damage, per shot, to balanced shields of a gunboat.
With the hook, it will do about 8/8% or 12/12%, or perhaps even more.

It doesn't matter whether Blue Max effects are enabled or not. Dynamic cockpit doesn't matter. TFTC doesn't matter.

To ensure it's that single hook, I used Babu Frik's Configurator to disable all special effects. Then removed all hooks except Hook_32bpp.dll, which was necessary to launch the game. After testing all hooks, it was apparent that the Weapon Color hook was the problem.

User avatar
Forceflow
Fleet Admiral (Administrator)
Posts: 7203
Joined: Wed Oct 20, 1999 11:01 pm
Contact:

Post by Forceflow » Mon Jul 05, 2021 6:44 am

I'll try and see if I can reproduce the issue later. If that is the case @JeremyaFr will have to look at that I think. Though he has very little time these days, so I am afraid it might be a while until we can offer a fix.
Murphy was an optimist! I am a pessimist!
And always remember that a smile is cheaper than a bullet! (District 9)
Webmaster of the X-Wing Alliance Upgrade Project

User avatar
Forceflow
Fleet Admiral (Administrator)
Posts: 7203
Joined: Wed Oct 20, 1999 11:01 pm
Contact:

Post by Forceflow » Mon Jul 05, 2021 7:08 am

Yes I can confirm that behavior. As for now I am afraid either you fly with the cockpit on or your remove the Hook_Weapon_Color.dll, we'll take a look at it but it's unclear when we'll be able to fix it.
Murphy was an optimist! I am a pessimist!
And always remember that a smile is cheaper than a bullet! (District 9)
Webmaster of the X-Wing Alliance Upgrade Project

User avatar
JeremyaFr
XWAU Member
Posts: 3922
Joined: Mon Jan 18, 2010 5:52 pm
Contact:

Post by JeremyaFr » Sun Aug 01, 2021 1:27 pm

WIP

Hello,
Here is a WIP version of the weapon color hook.
Please test it to see if the damage issue is still there.

xwa_hook_weapon_color_WIP_2108011524.zip
You do not have the required permissions to view the files attached to this post.

User avatar
Forceflow
Fleet Admiral (Administrator)
Posts: 7203
Joined: Wed Oct 20, 1999 11:01 pm
Contact:

Post by Forceflow » Sun Aug 01, 2021 3:06 pm

JeremyaFr wrote:
Sun Aug 01, 2021 1:27 pm
WIP

Hello,
Here is a WIP version of the weapon color hook.
Please test it to see if the damage issue is still there.


xwa_hook_weapon_color_WIP_2108011524.zip
I gave it a quick spin and it seems to be working
Murphy was an optimist! I am a pessimist!
And always remember that a smile is cheaper than a bullet! (District 9)
Webmaster of the X-Wing Alliance Upgrade Project

User avatar
JeremyaFr
XWAU Member
Posts: 3922
Joined: Mon Jan 18, 2010 5:52 pm
Contact:

Post by JeremyaFr » Sun Aug 01, 2021 7:36 pm

UPDATE

Hello,
I've updated xwa_hook_weapon_color.

I've merged the changes from the WIP version into the stable version.

Post Reply