Skip to content
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

Closed
wants to merge 1 commit into from

Conversation

Mailaender
Copy link
Member

Closes #3771.

@dnqbob
Copy link
Contributor

dnqbob commented Nov 14, 2020

Hi dude, does this module conflict the capture module?

@Mailaender
Copy link
Member Author

Yes, I think so, but #17831 has so many worry-bearers I doubt it will get merged anytime soon.

@Mailaender
Copy link
Member Author

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.

@dnqbob
Copy link
Contributor

dnqbob commented Nov 15, 2020

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.

@Mailaender
Copy link
Member Author

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(
Copy link
Member

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 than LegacyBridgeHut (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
Copy link
Member

@pchote pchote Nov 16, 2020

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.

@pchote
Copy link
Member

pchote commented Mar 14, 2021

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.

@pchote pchote closed this Mar 14, 2021
ottelo9 added a commit to ottelo9/OpenRA that referenced this pull request Oct 22, 2024
Include BridgeRepairBotModule from Mailaender (old PR) OpenRA#18817
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

AI bridge repair
4 participants