-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Added bridge repair capabilities to the bots #18817
Conversation
Hi dude, does this module conflict the capture module? |
Yes, I think so, but #17831 has so many worry-bearers I doubt it will get merged anytime soon. |
On a 2nd thought: they might interact well already. If a path is blocked then the bridge repair will be the only purpose for an engineer. If there is an opportunity to capture a tech building or an unguarded enemy one, then that can be a priority with a roughly 50:50 chance if the scan delays are identical. |
I think it may be better to make a Engineering Module to include all bot module that control engineers behaviors. But we should do it later. |
Yes, once we know how they behave in combination, that would be a good followup. |
.Where(tp => tp.Trait != null) | ||
.ToArray(); | ||
|
||
var targetOptions = world.ActorsWithTrait<LegacyBridgeHut>().Where( |
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.
There are three issues here:
- This won't work for TS, which uses
BridgeHut
rather thanLegacyBridgeHut
(which is now years overdue for being removed). - Bridges / huts are fixed at map start, so querying this every scan adds unnecessary overheads. The list of huts can be cached once on game start.
- Having multiple bots all rushing to repair the same bridge, even if its on part of the map where they have never been, doesn't make sense. It would be much more logical if the repair request could be triggered by a squad encountering (or at least being within some proximity of, even if they don't want to use it) a broken bridge.
var newUnits = world.ActorsHavingTrait<IPositionable>() | ||
.Where(a => a.Owner == player && !activeRepairers.Contains(a)); | ||
|
||
var repairers = newUnits |
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.
These are heavy queries that will almost never be needed (many maps don't have bridges, and those that do are almost never broken) - move it after the if (!targetOptions.Any())
check.
This has been superseded by my third point above.
I've noted this PR in #19247 to track this for the future, but for now are closing this to help address the unsustainable state of the PR queue. |
Include BridgeRepairBotModule from Mailaender (old PR) OpenRA#18817
Closes #3771.