View Issue Details

IDProjectCategoryView StatusLast Update
0002715FSSCPgameplaypublic2020-04-13 20:36
ReporterMatthTheGeek Assigned ToGoober5000  
PrioritynormalSeveritymajorReproducibilityalways
Status resolvedResolutionfixed 
OSWindows 7 
Product Version3.6.13 
Target Version3.8 
Summary0002715: Weapons are always loaded on top banks when some banks are empty
DescriptionIf some banks are left empty on the loadout screen, whatever weapons were selected in the other banks will be shifted toward the top banks.
For example if on the loadout screen you have :
Bank 1: empty
Bank 2: weapon 1
Bank 3: weapon 2

In mission you will have
Bank 1: weapon 1
Bank 2: weapon 2
Bank 3: empty

This is potentially heavily balance-breaking as it can alow a player to entirely bypass per-bank weapon restrictions, like for example loading an Archer on the hexa bank of an Uriel instead of the single underslung bank.

Confirmed with both primary and secondary banks.
Steps To ReproduceLoad a mission with ships that have at least two banks.

Put weapons only in bottom bank(s).

Load mission.

Watch in external mode what bank is actually firing when you fire.
TagsNo tags attached.

Relationships

parent of 0002355 closed Primary and secondary banks with no default weapons cannot be set 

Activities

MatthTheGeek

2012-09-22 19:55

reporter   ~0013969

Also confirmed with both 2-bank and 3-bank configurations. Tested on latest trunk, but it very much sounds like it is a retail-era bug.

niffiwan

2012-11-16 08:38

developer   ~0014042

Last edited: 2012-11-16 08:47

This is going to be... interesting. The observed behaviour is "as designed". i.e. the loadout code removes any missing weapon entries & moves the weapons in the banks 2+ towards bank 1. This is done because there's an assumption in many places (e.g. firing primaries, switching secondaries, drawing the HUD, probably other places as well) that the ship weapon array starts at zero, there are no gaps/empty banks, and the number of full banks is the number of banks on the ship.

Since this will need a fair bit of refactoring to fix, I think it should be deferred until 3.7.2. It might be an opportunity to refactor all the loadout code at the same time.

edit: also discussed on the IRC whether a possible fix could be preventing the loadout screen from exiting if there were any gaps in the banks. However, this would prevent FREDers from deliberately leaving banks empty if they wished to in their missions.

MjnMixael

2012-11-16 14:03

manager   ~0014043

Perhaps a decent work around until then is to create a 'dummy' weapon called Empty and doesn't fire?

Of course the player would have to know to specifically choose to place it where needed...

FUBAR-BDHR

2012-12-12 19:45

developer   ~0014429

I was thinking about this last night for some strange reason. What about adding a int primary_bank_flags[MAX_SHIP_PRIMARY_BANKS] and secondary_bank_flags[MAX_SHIP_SECONDARY_BANKS] to the ship_weapon struct. Then a flag such as "unloaded" could be added and checked to leave that weapon there but make it not usable. Additional flags could be added such as "no-rearm" that would prevent reloading of a particular weapon by support and "no-hud" that would work with "unloaded" to not display the weapon on the hud.

These could be set in ships table and altered in FRED. This would also provide a way to fix 0002355 as well as allow for other future features.

MjnMixael

2012-12-12 19:52

manager   ~0014430

I could see myself even using a system like that. It's basically a feature request then, though.. so perhaps this (already is) and 2355 should be re-targeted for 3.7.2.

niffiwan

2012-12-12 21:17

developer   ~0014431

Thanks for the suggestion, that's more flexible than what I had been thinking of which would have only dealt with the equivalent of the "unloaded" flag.

MageKing17

2016-03-23 10:02

developer   ~0016814

Bumping target.

Goober5000

2020-04-13 02:38

administrator   ~0016963

I took a look at this recently while dealing with one of the Weapon_info vectorization issues. Yes, the behavior is as-designed. I think the best fix will be to prevent the player from exiting the loadout screen with incomplete banks. Scramble missions can bypass this check because presumably FREDders will know what they are doing.

Goober5000

2020-04-13 03:17

administrator   ~0016964

PR opened:
https://github.com/scp-fs2open/fs2open.github.com/pull/2325

Goober5000

2020-04-13 20:36

administrator   ~0016974

PR merged.

Issue History

Date Modified Username Field Change
2012-09-22 19:35 MatthTheGeek New Issue
2012-09-22 19:55 MatthTheGeek Note Added: 0013969
2012-10-25 08:54 niffiwan Assigned To => niffiwan
2012-10-25 08:54 niffiwan Status new => assigned
2012-11-16 08:38 niffiwan Note Added: 0014042
2012-11-16 08:39 niffiwan Target Version => 3.7.2
2012-11-16 08:47 niffiwan Note Edited: 0014042
2012-11-16 14:03 MjnMixael Note Added: 0014043
2012-12-12 19:45 FUBAR-BDHR Note Added: 0014429
2012-12-12 19:52 MjnMixael Note Added: 0014430
2012-12-12 21:17 niffiwan Note Added: 0014431
2012-12-13 03:19 Goober5000 Relationship added parent of 0002355
2014-08-20 10:04 niffiwan Target Version 3.7.2 => 3.7.4
2016-03-23 10:02 MageKing17 Note Added: 0016814
2016-03-23 10:02 MageKing17 Target Version 3.7.4 => 3.8
2020-04-13 02:37 Goober5000 Assigned To niffiwan => Goober5000
2020-04-13 02:38 Goober5000 Note Added: 0016963
2020-04-13 03:17 Goober5000 Note Added: 0016964
2020-04-13 20:36 Goober5000 Status assigned => resolved
2020-04-13 20:36 Goober5000 Resolution open => fixed
2020-04-13 20:36 Goober5000 Note Added: 0016974