Make QRFs and singleAttacks behave semi-reasonably with maxUnits #2113
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What type of PR is this.
What have you changed and why?
Support QRFs and singleAttack (marker recapture counterattack) were using a maxUnits check (through chooseAttackType) that didn't account for unit locality. In Antistasi, maxUnits applies per machine rather than globally, so the permitted unit count scales up with the number of headless clients. As a result, QRFs and singleAttacks will have been much rarer or smaller than intended when headless clients were used.
This PR fixes the maxUnits checks so that they ignore units on other machines. A buffer is left for QRFs so that wavedCA doesn't get completely crippled by running on the same machine.
Please specify which Issue this PR Resolves.
closes #2098
Please verify the following and ensure all checks are completed.
Is further testing or are further changes required?
maxUnits behaviour is generally terrible but that's a bigger problem to be addressed later.
More problematic is that singleAttacks and QRFs likely didn't spawn at all on the community servers, so that would invalidate any balance data. Might need to buff up economicsAI again, for example, and the upper-end vehicle counts in singleAttacks and QRFs are likely far too high, as that end hasn't been tested in an appropriate case.
How can the changes be tested?
WIP