Attack activities should repath when projectiles are blocked from the target.
Nobody has claimed this yet.
- 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:
UseBlocksProjectiles.AnyBlockingActorsBetweenfor 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 bymap.Height[cell]? → check points on path across cell).
See the comment below for a simpler approach
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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