Charon Posted April 7, 2023 Posted April 7, 2023 (edited) I was discussing AI and clouds with some folks last night, which prompted me to run some tests, and I was surprised by the results I got. My tests revealed that the AI respects clouds when spotting. Whether looking up/down across layers or looking laterally through thick soup, AI with an Attack Area won't seek out an enemy it cannot see. However, it will pursue an enemy through clouds once it has spotted them, and doesn't seem to lose tally. It immediately responds to turns even after chasing through heavy clouds for minutes. This was a surprising result to us, who've long assumed the AI ignored clouds completely. I think the problem is how well it retains tally: it's possible for the AI to spot through broken clouds, then seemingly swoop down from above with the aid of a magic all-seeing eye. To me, this seems like you've already done the hard work: you've got the ability to test for occlusion, and you've already accepted the computational cost of repeating this test frequently. Could the AI be modified so that, when chasing an enemy, it continues to check visibility and simply reverts to its last action 45/60/90s (novice/regular/vet+ace) after losing tally (the numbers might need tweaking but seem fine in principle)? That would be long enough for AI to bounce an enemy through broken clouds and long enough that they don't immediately give up a dogfight, but short enough that players could seek refuge in them in heavier weather. You could also add a check: before opening fire, if range > 250m and the target is occluded, hold fire instead. Certainly we could imagine more elaborate heuristics, but the advantage of my proposal is that it seems like it could be done very easily. (I wouldn't propose it if I didn't think you'd already done all the hard work). And it would make the work you've already done on clouds much more obvious to players, who are always happy to feel the AI is on a level playing field. Edited April 7, 2023 by I./JG3_Charon 1
[CPT]Crunch Posted April 7, 2023 Posted April 7, 2023 Are you sure it's occlusion based and not altitude layer based? Altitude layer based programming would explain why they can see you when within the same set band, but not from outside those same cloud set altitudes. Much simpler load and easier to calculate.
Charon Posted April 8, 2023 Author Posted April 8, 2023 @[CPT]Crunch I considered that possibility because that would indeed be easier, but two tests ruled it out: In one test, the AI did not seek out another co-altitude plane while flying through a thick cloud bank. In the control version of the test, with no clouds, the AI turned to engage immediately. I also ran a test with broken clouds. It's obvious when the AI spots the target because they increase engine power and turn towards it. In the first screenshot, the AI can't see the C-47 through the clouds; the second screenshot is taken just after the C-47 comes into clear view, and just at the moment the AI spots it. So I conclude the existing cloud occlusion logic works both in the vertical and horizontal, and takes into account the position of individual clouds. It seems to already be implemented very well. All that's needed is for it to be applied to tracking and shooting. Spoiler
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now