Barotrauma icon indicating copy to clipboard operation
Barotrauma copied to clipboard

buying weapons to scaled hardpoints has bad placement

Open Tsunder opened this issue 2 years ago • 4 comments

Disclaimers

  • [X] I have searched the issue tracker to check if the issue has already been reported.
  • [ ] My issue happened while using mods.

What happened?

Scaled weapon purchase seems to be offset incorrectly.

90 degrees rotated, 0.3 scale hardpoint

image

railgun aftter purchase: image

default scaled hardpoint resulted in non-buggy behaviour, although the it's a bit too big to fit, hence trying to scale the hardpoint down image

Reproduction steps

  1. 90 degrees rotated, 0.3 scale hardpoint
  2. purchase a weapon. I chose railgun because it's big.
  3. go to new level to apply changes

Bug prevalence

Happens every time I play

Version

0.18.12.0

-

No response

Which operating system did you encounter this bug on?

Windows

Relevant error messages and crash reports

No response

Tsunder avatar Jul 18 '22 03:07 Tsunder

Fixed in https://github.com/Regalis11/Barotrauma-development/commit/e9f7ccf8895075fdffa5e2e33b4d9203ad488a65

Regalis11 avatar Jul 18 '22 16:07 Regalis11

Tested on 0.19.0.0, not sure if this is working as intended or if there are substantial differences between weapon types:

Before switching weapons (using one micro, one standard size and one supersized weapon): image

After swapping all three: image

Barsuk turret scale test.zip

NilanthAnimosus avatar Jul 21 '22 03:07 NilanthAnimosus

Reverted the commit for now https://github.com/Regalis11/Barotrauma-development/commit/968c3ac777a9148c294703382d32b64fae8bfad8, need to rethink the calculations in a way that works when the new item has different dimensions than the old one.

Regalis11 avatar Jul 22 '22 11:07 Regalis11

Reverted the commit for now Regalis11/Barotrauma-development@968c3ac, need to rethink the calculations in a way that works when the new item has different dimensions than the old one.

Perhaps use hardpoint position origin as the frame of reference instead of the sprite sourcerect & origins?

Ek-Videogames avatar Jul 26 '22 19:07 Ek-Videogames

Perhaps use hardpoint position origin as the frame of reference instead of the sprite sourcerect & origins?

We don't use the sprite sourcerect or origin to calculate it, but the position of the hardpoint origin. The issue is in the way the position of the origin is calculated on scaled and rotated items.

Regalis11 avatar Oct 09 '22 16:10 Regalis11