Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vehicle autofire #4959

Merged
merged 22 commits into from
Dec 6, 2023
Merged

Vehicle autofire #4959

merged 22 commits into from
Dec 6, 2023

Conversation

Doubleumc
Copy link
Contributor

@Doubleumc Doubleumc commented Nov 19, 2023

About the pull request

Convert vehicle hardpoints from using their bespoke firing system to one structured closely on handheld guns and deployables such as the M2C. Now using the autofire component. Much like handheld weapons it is capable of different firemodes (semi/burst/auto) and changing targets during fire.

Hardpoints were converted to match their old effectiveness as closely as possible; this is intended as a quality of life improvement, not a rebalance. Damage, AP, range, ammo, etc were not touched.

Fire rates were copied over directly. Single-fire weapons with long delays were made semi-auto (e.g. LTB), and those with short delays were made full-auto (e.g. autocannon). Burst-fire weapons with significant extra delays after the burst remained burst-fire (cupola, smokescreen), and the rest were converted to full-auto (e.g. dual cannon). While changing firemodes is easily implemented, no weapon seemed a good candidate for more than one firemode and so that is omitted for now.

Scatter was approximated. The existing accuracy functioned as a percent chance the shot would stray one tile from the target. Gun-style scatter is instead a cone of fire in degrees. No direct conversion is possible, so scatter values are roughly set such that firing at a tile at the edge of the screen should "feel" about as accurate. Closer ranges would experience less spread than before, longer ranges more.

The buffing weapon sensor module was adjusted to work with the new firing system, and effects hardpoint scatter angle and firing rate. Vehicle buffs still use multipliers instead of adding/subtracting as handheld guns do, as a flat +/- adjustment to fire delay would have a significantly different effect on slow firing weapons (e.g. LTB) vs fast firing (e.g. autocannon). One major difference is that burstfire delays are effected and buffs increases the burst density. Before, there was a single cooldown initiated at the start of the burst, and only that cooldown was modified by the buff. Now, since the inter-burst delay is needed by the autofire component both the inter-burst delay and the after-burst delay are modified by buffs.

Activating non-selected hardpoints was removed as not compatible. The issue is that tracking a single click's modifiers is no longer sufficient, it has to track through the whole mousedown-to-mouseup period and the user can change multiple click modifiers in that time. I could not find a method that was satisfactory without a much bigger overhaul of vehicle controls than I'd like to take on in a PR not meant for it. I'm sure it can be done, but that brings up the question of if that's even the control scheme we'd want, in a PR that was never meant to ask that question let alone answer it.

Explain why it's good for the game

Vehicle weapons using gun-like code makes them easier and more familiar to use, and more code commonality makes maintenance just a little bit easier.

Testing Photographs and Procedure

Screenshots & Videos

Put screenshots and videos here with an empty line between the screenshots and the <details> tags.

Changelog

🆑
refactor: vehicle weapons can fire full-auto
del: no more controls for firing vehicle non-selected weapons
/:cl:

@github-actions github-actions bot added Refactor Make the code harder to read Removal snap labels Nov 19, 2023
@cm13-github
Copy link
Contributor

This pull request has conflicts, please resolve those before we can evaluate the pull request.

@cm13-github cm13-github added the Merge Conflict PR can't be merged because it touched too much code label Nov 25, 2023
@cm13-github
Copy link
Contributor

Conflicts have been resolved. A maintainer will review the pull request shortly.

@cm13-github cm13-github removed the Merge Conflict PR can't be merged because it touched too much code label Nov 25, 2023
@harryob harryob added this pull request to the merge queue Dec 6, 2023
Merged via the queue into cmss13-devs:master with commit f4f334d Dec 6, 2023
26 checks passed
cm13-github added a commit that referenced this pull request Dec 6, 2023
@Doubleumc Doubleumc deleted the vehicle-autofire branch December 8, 2023 01:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Refactor Make the code harder to read Removal snap
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants