Skip to content

AI uses better rally point placement#21475

Merged
PunkPun merged 1 commit intoOpenRA:bleedfrom
RoosterDragon:ai-rally-perf
Aug 3, 2024
Merged

AI uses better rally point placement#21475
PunkPun merged 1 commit intoOpenRA:bleedfrom
RoosterDragon:ai-rally-perf

Conversation

@RoosterDragon
Copy link
Copy Markdown
Member

@RoosterDragon RoosterDragon commented Jul 6, 2024

  • AI places rally points at pathable locations. This replaces the previous logic which required the location to be buildable. This doesn't make much sense, as soon as the first unit arrives at the rally point, the location became unbuildable and the AI would move the rally point! A pathable location isn't strictly required, but avoids the AI setting rally points at seemingly dumb locations.

  • AI places rally points at pathable locations. A pathable location isn't strictly required, but avoids the AI setting rally points at seemingly dumb locations. This is an addtional check on top of the existing buildability check.

  • AI now evaluates rally points every AssignRallyPointsInterval (default 100 ticks). Invalid rally points aren't that harmful, so no need to check them every tick. Additionally we do a rolling update so rally points for multiple locations are spread across multiple ticks to reduce any potential lag spikes.

Fixes #11938 Fixes #13289

@dnqbob
Copy link
Copy Markdown
Contributor

dnqbob commented Jul 16, 2024

Actually I don't think set rally point is useful for AI:

  1. Harvester problem. AI's rally point make Harvesters goes a long road before get to work, make AI's economy always behind player at early game.

  2. I don't think placing unit everywhere is beneficial to defence. That makes AI units be taken down one by one by player while AI doesn't retreat those unit to make them a bigger horde to encounter the threat.

@RoosterDragon
Copy link
Copy Markdown
Member Author

  1. Indeed, that is captured in AI should have different rally point priorities when constructing a harvester #21045
  2. My original plan was just to remove it, but that could be a worse issue. But it's also been argued that rally points are helpful so it doesn't gum up the exits, and I didn't want to cause a regression by doing that.

I think this PR is a sensible patch that keeps the existing rally point behaviour, but other PRs to investigate different behaviours entirly for the AI rally points could be a good idea - however those could be tackled independantly of this work.

@dnqbob
Copy link
Copy Markdown
Contributor

dnqbob commented Jul 19, 2024

My original plan was just to remove it, but that could be a worse issue. But it's also been argued that rally points are helpful so it doesn't gum up the exits, and I didn't want to cause a regression by doing that.

My thought is: we put the rally operation to SquadManager in protection team logic.

  1. Assign all new idle units to protection squad.
  2. when there is no enemy target, protection team in idle state will rally the unit and even fix the damaged unit.
  3. Attack squad forms from team members of protection squad.

Copy link
Copy Markdown
Member

@PunkPun PunkPun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I recon AI should change rally points once in a while. The previous behaviour although buggy, did that. The current only changes if the rally is hard blocked

- AI places rally points at pathable locations. A pathable location isn't strictly required, but avoids the AI setting rally points at seemingly dumb locations. This is an addtional check on top of the existing buildability check.
- AI now evaluates rally points every AssignRallyPointsInterval (default 100 ticks). Invalid rally points aren't that harmful, so no need to check them every tick. Additionally we do a rolling update so rally points for multiple locations are spread across multiple ticks to reduce any potential lag spikes.
@RoosterDragon
Copy link
Copy Markdown
Member Author

RoosterDragon commented Jul 29, 2024

Ok, I have kept the previous check. Once a unit enters the rally point location, the AI will now move the rally point. Same as it was doing before.

I kept the other changes the PR has added. That means it won't choose an unreachable location. And since it doesn't check as often, it won't spam new rally points constantly, instead it changes them at a reasonable pace now.

@PunkPun PunkPun merged commit d05b07a into OpenRA:bleed Aug 3, 2024
@PunkPun
Copy link
Copy Markdown
Member

PunkPun commented Aug 3, 2024

changelog

@RoosterDragon RoosterDragon deleted the ai-rally-perf branch August 3, 2024 18:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

AI computes new rallypoints multiple times AI can place Rally points to unavailable places

3 participants