-
Notifications
You must be signed in to change notification settings - Fork 40
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
Improve anti-vehicle responses #369
Conversation
Add new function to find units with vehicle-capable launchers
Only units with appropriate launchers should engage specific vehicles, e.g AA launchers aren't considered against ground vehicles Also ensure that the target command is issued on the vehicle, not a crew member of the vehicle
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.
Some config lookup optimizations, will save up more the bigger the squad.
Forgot to change these back to arrays after experimenting a bit, oops
Interesting stuff. We'll be looking more closer at this. |
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.
the aiAmmoUsageFlags and caching are from my pov here the biggest issue we should reuse the system that I implemented in #365. i also expect that that is the reason why you don't get RHS Disposable lauchers to work because aiAmmoUsageFlags is not a string but a number
Not going to comment on the aiAmmoUsageFlags datatype, already mentioned in the conversation above. The RHS disposable launchers might or might not work with this PR. What I meant in the original post was that RHS disposable launchers do not work with vanilla AI, they will not use them at all. Probably because they are technically empty until equipped, so the AI probably doesn't understand that it can be used. I thought about making a cache for this, but config lookups here are so fast that it is a micro-optimization at best. This takes
Simply calling something with parameters already takes up
It is possible that the config lookups are only fast due to some config caching built into the engine that makes it fast in a benchmark like this where the same config gets accessed rapidly, but I still believe that the config lookups are not what is slowing this function down. I didn't look into your caching system while the PR was still open, but now I did and I believe that it is currently bugged. Check the following input to your function:
This will return |
This is not a topic of Performance but one of working correctly where we need always first to make sure that it does work correctly. and because aiAmmoUsageFlags is not a always a string or maybe a differently defined string we should always go for correctness. and for the report that lambs_main_fnc_checkMagazineAiUsageFlags does not work. it needs to magazine not the ammo and |
I suspect you are talking around one-another. Nothing serious in the big picture-- though using the new function would put it more in line with the direction we are going now. Regardless. I'm having some trouble getting lambs_main_fnc_getLauncherUnits to correctly identify the TitanAA weapon carried by the humble "B_soldier_AA_F" (NATO AA trooper). It is quite late here, and I did test with ACE3. Perhaps I'm doing something wrong? |
Good catch #382 should fix that. but the reason why you don't have the function in this PR is because you need to merge master 😄 |
I'll test that PR when I get done with school stuff for the day, but from a quick inspection it should work. I didn't test on this branch, just downloaded the dev version from steam and tested with that active, but steam had some trouble (as always) and apparently didn't update the mod so I was actually on 2.6.0 ... And the change to |
Requires nk3nny#382 to work properly
This is currently mergeable with master branch but will be bugged until #382 is merged. Verified that the Titan AA launcher is properly detected when this is used alongside #382. |
When merged this pull request will: Add new function to find units with vehicle-capable launchers
Adds a new function that finds units that have vehicle-capable launchers (light AT, anti-air or heavy AT), and implements it into various anti-armor routines that previously only checked if units have secondary weapons. This is an important distinction, because various mods and CDLC's add secondary weapons that are not intended for AT usage. E.g, RHS's RshG-2 or the flare launchers in Prairie Fire.
The function can also account for submunitions, but this behaviour isn't used in this PR because I don't know if AI cares about the submunitions when deciding whether to engage. Disposable launchers from RHS for example are also completely ignored, but I don't consider this a huge flaw because in my testing AI refuses to use them anyway.
Also minor improvements in
fnc_tacticsHide
, such as making units target the vehicles themselves instead of crewmembers, and adding logic to ensure that AT units don't engage air vehicles and AA units don't engage ground vehicles.Closes #362
lambs_main_fnc_getLauncherUnits
getLauncherUnits
intofnc_tacticsAssess
getLauncherUnits
intofnc_tacticsHide
fnc_tacticsHide
getLauncherUnits
intofnc_taskRush