OpenRA / OpenRA/OpenRA

Attack activities should repath when projectiles are blocked from the target.

Open
#12,635 4 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Feature Pathfinding
Dominant language
C#
Stars
17.4k
Forks
3k
Avg merge
1d 12h
Merged PRs (30d)
14

Description

This combines the older tickets about actors moving to a new location if their projectiles are blocked from reaching their target by walls or terrain.

Checking if a projectile will be able to hit before it fires each time wouldn't be great on performance, so we should start hy implementing new plumbing to notify AttackBase (and maybe other traits) after a projectile is blocked by actors or terrain. The attack traits can then check for this case and trigger a repath.

Finding a cell to move too should be relatively easy: follow the approach of FindResources.ClosestHarvestablePos, replacing the "can harvest cell" check with a "can fire from" check:

  • Use BlocksProjectiles.AnyBlockingActorsBetween for walls or other blocking actors.
  • Terrain (on heightmap enabled mods) is slightly trickier, but could be split into phases (are there any height changes? → does the line intercept with a bounding box defiend by map.Height[cell]? → check points on path across cell).

See the comment below for a simpler approach

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading the issue's follow-up comment and the older tickets it combines. Trace AttackBase, attack activities, and the projectile-blocking behavior, including BlocksProjectiles.AnyBlockingActorsBetween and FindResources.ClosestHarvestablePos. Done means blocked projectiles cause the relevant attack activity to repath toward a valid firing position without introducing unnecessary per-shot performance costs.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
game-dev
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.