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
Unhardcode some AI squad scan radii and misc AI improvements #14466
Conversation
// If there are any own buildings within the DangerRadius, don't flee | ||
// PERF: Avoid LINQ | ||
foreach (var u in units) | ||
{ |
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.
Braces around single line statements.
This looks like the solution of the issues I have with the AI since the isometric-range-rescale PR, so yes, pretty please fix the code issue. |
3caab76
to
3fe15de
Compare
Updated. |
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.
👍 then.
|
||
for (var i = 0; i < x; i += DangerRadius * 2) | ||
for (var i = 0; i < x; i += dangerRadius * 2) |
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.
Manually chunking the map like this is really awful 😢
In the future we could win a lot of simplicity and perf by maintaining spatially partitioned maps of targetability and danger for each squad class.
Increased configurability, improved disabled-trait-awareness and minor (though likely negligible) performance optimization.
Note: Intentionally didn't touch AirStates here, I'll wait for #14387 to be merged first.