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
No-unlocks support for rebel AI equipping #2305
No-unlocks support for rebel AI equipping #2305
Conversation
- Generates weighted arrays on server every 10mins, transmits to clients as required. - Based on arsenal contents. Typically 10 items min chance, 50 max. - Item usage is also capped by available magazines/bullets. - Refund value halved to reduce effectiveness of exploits. General improvements to rebel AI equipping: - Improved use of NV, grenades, explosives and launchers. - Optics are now weapon-appropriate. - Magazines are now added by weight instead of count. General improvements to automatic item categorisation: - equipmentClassToCategories now caches for fast subsequent use. - Disposable launcher support added. - Optic categorisation added. - Explosive charge detection added. - Moved smoke grenade, flashlight and thermal detection to equipmentClassToCategories. - Simplified and fixed missile launcher support. - Fixed some broken CUP stuff in categoryOverrides. Misc: - Fixed incorrect CUP template dependency.
A3A/addons/core/functions/Ammunition/fn_equipmentClassToCategories.sqf
Outdated
Show resolved
Hide resolved
- Cleared up some "weapons" that weren't fireable with categoryOverrides. - Expanded OpticsMid detection to 6.25x. - Belt-and-braces error detection for weapons with no default magazine. - Fixed precedence syntax error in randomRifle fallback. - Added safety check for zero-mass secondary weapon mags.
Fixed everything else that turned up but didn't change the CivilianVests/UnarmoredVests naming yet. I guess "CivilianVests" is kinda weird given that we block undercover for them. A lot of the VN categoryOverrides look wrong so I'll check that later. |
…zoom level. Change UnarmoredVests -> CivilianVests to match the category name.
|
…rver. - Fix some typos added in the last commit.
Turns out there was a second way to cause the petros vest problem. arsenal_addItem (as used by unlockEquipment) updated every machine with a remoteExecCall, so it was possible for generateRebelGear to run before all the equipment had actually been added to the arsenal. I fixed arsenal_addItem so that it updates the server immediately when run locally. Also checked the categories with CUP. Optics & launchers seem fine at least, so I think that's all the modsets tested. |
private _rangeCat = "OpticsClose"; | ||
{ | ||
// Assume it's a sniper/marksman optic if it has ranging and zoom. Zoom level alone isn't enough because RHS MDO > PSO-1 & DMS/SOS | ||
if (getNumber (_x >> "opticsZoomMin") < 0.2) exitWith { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this causes way more Issue than the Previous version:
RHS (It's all 4 RHSDev variants as i wanted to look at new stuff, should not affect most config Values)
And the Funny RPG Sights, only on Russian Equipment with Dovetail mounts annyoing and funny.
RHS Scope lists
Scopes.txt
Vanilla with Ace and Zen
ScopesVanilla.txt
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh lol, the ACE compats actually remove the value I was using to identify ranging (discreteDistance), I guess because that was the only way to disable vanilla ranging. I'll have to add a check for the ACE ranging value as well.
Curious about the Russian optics (1P29 and some PSO-1s) that still have discreteDistance. I guess they use vanilla ranging even with ACE?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh yeah, apparently all the PGO_7V variants are compatible with various AKs. Not sure if we want to fight that. Stat-wise they're a valid mid-range optic and they seem to use the standard Russian scope attachment. I'm guessing that the ak/pkp/asval versions are even marked for those weapons. AIs won't care about the markings anyway.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a bit better with:
3b27e89
But annyoingly still weird in some Cases for RHS:
Scopes.txt
Like the Common RHS ACOGs end up in Long.
I would say fuck it,
It's as good as we can get it so that should be fine now.
["rhsusf_acc_ELCAN",
"rhsusf_acc_ELCAN_ard",
"rhsusf_acc_ACOG",
"rhsusf_acc_ACOG_wd",
"rhsusf_acc_ACOG_d",
"rhsusf_acc_ACOG2",
"rhsusf_acc_ACOG3",
"rhsusf_acc_ACOG_USMC",
"rhsusf_acc_ACOG2_USMC",
"rhsusf_acc_ACOG3_USMC",
"rhsusf_acc_ACOG_RMR"];
CUP With Ace looks pretty OK
ScopesCUP.txt
And Vanilla looks pretty fine
ScopesVanilla.txt
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah yeah, RHS ACOG defines all the ACE scope ranging params with zeros for some reason. Can workaround that easily enough, hopefully without breaking anything else. ELCAN just looks like a busted config (scope zoom is wrong, ACE ranging on marked scope) so I'm not bothered if that slips through.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Double-checked ACE code. If force turrets is disabled and the vertical adjustment value doesn't exist then the default is 0, or no ranging. So checking >0 for vertical adjustment should be correct.
Had a look how AI Picks Equipment with No Unlocks, that seems to work pretty nice. The only funny thing i saw while looking at it, is that the "ADR DLC" P90s are "Rifles" "SMG_03_TR_black",
"SMG_03_TR_camo",
"SMG_03_TR_khaki",
"SMG_03_TR_hex",
"SMG_03C_TR_black",
"SMG_03C_TR_camo",
"SMG_03C_TR_khaki",
"SMG_03C_TR_hex",
"SMG_03_black",
"SMG_03_camo",
"SMG_03_khaki",
"SMG_03_hex",
"SMG_03C_black",
"SMG_03C_camo",
"SMG_03C_khaki",
"SMG_03C_hex", And as it seems we kinda forget to stay up to date when Arma Updated for Contact etc. "arifle_MSBS65_Mark_F",
"arifle_MSBS65_Mark_black_F",
"arifle_MSBS65_Mark_sand_F",
"arifle_MSBS65_Mark_camo_F", Probably not worth to change but these are Underbarrel Shotgun variants Classed as Just Rifles "arifle_MSBS65_UBS_F",
"arifle_MSBS65_UBS_black_F",
"arifle_MSBS65_UBS_sand_F",
"arifle_MSBS65_UBS_camo_F" RPKs are Classed as Rifles but could be Machineguns "arifle_RPK12_F",
"arifle_RPK12_lush_F",
"arifle_RPK12_arid_F", |
Odd thing about the P90 is that the ammo performance is pretty close to the vanilla 5.45 rounds, and possibly better than the RHS M855 and some RHS 5.45s, so it might not be the worst weapon for a rifleman to carry around. On the other hand it is a light weapon, so good for medics. I'm not a fan of adding rifles to the sniper list just because they have a long barrel, but apparently in ACE compats these 6.5mm weapons get different cartridges. However, it's barely better than the stock 6.5mm (1.1 caliber vs 1.0, both have 10 hit), so still miserable as marksman ammo. Think I'll keep those in rifles. The GL code could give ammunition to the underbarrel shotguns (and that 50cal specops underbarrel from Apex), but we wouldn't want them used instead of real grenade launchers, so it'd need an extra keyword. Probably not worth it because AIs likely wouldn't know what to do with them. RPKs should be MachineGuns, yeah. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be fine now
## What type of PR is this. 1. [X] Bug fix 2. [ ] Change 3. [ ] Enhancement ### What have you changed and why? Forgot to test #2305 on DS+client. Apparently the only broken bit was that categoryOverrides is only created on the server, but now needs to be created everywhere because equipmentClassToCategories is used for general equipment identification. Also tagged it with A3A_. ### Please specify which Issue this PR Resolves. closes #2327 ### Please verify the following and ensure all checks are completed. 1. [X] Have you loaded the mission in LAN host? 2. [X] Have you loaded the mission on a dedicated server? ### Is further testing or are further changes required? 1. [X] No 2. [ ] Yes (Please provide further detail below.) Notes: Fix categoryOverrides not being created on clients, and tag with A3A
What type of PR is this.
What have you changed and why?
We need a new method of picking rebel AI equipment after removing unlocks. I've decided that the best method is to base AI equipment on the arsenal contents but generate new items. This is relatively simple (actually taking items from the arsenal is complex and expensive, especially with garrisons) and should have low exploit potential and no significant player count balance problems.
Processing the arsenal for each unit recruited is still too expensive, so this PR rewrites the rebel AI equipping code to use server-generated weighted lists. Some details:
General improvements to rebel AI equipping:
General improvements to automatic item categorisation:
Misc:
The only regression at the moment is that missile launchers will no longer be used even if the unlocks are enabled. The plan is to add AT/AA missile launcher rebel infantry types which should be much more expensive to buy, but this requires additional entries added to each rebel template, and some UI work.
Please verify the following and ensure all checks are completed.
Is further testing or are further changes required?
This is insufficiently tested. I've run the categorization code on RHS and CUP, but not VN or BAF yet. The rebel equipping code should be somewhat solid if the categorization works, although if weapons exist without a default magazine then that may trip up some config calls.
How can the changes be tested?
A3A_rebelGear is the hashmap containing all the gear lists, so that's worth looking at before spamming soldiers.