beyond-all-reason / beyond-all-reason/RecoilEngine
BuggerOff doesn't work for moving or constructing units
- Dominant language
- C++
- Stars
- 679
- Forks
- 290
- Avg merge
- 3d 2h
- Merged PRs (30d)
- 40
Description
https://github.com/user-attachments/assets/4a3fbf75-2c52-451f-8216-a66c8a1b9780
BuggerOff is currently broken in two cases.
Case 1: Unit moving through construction site
When a unit is moving through a construction site, BuggerOff won't be issued to it.
Case 2: Busy builder standing in construction site
When a builder is assisting some other task while standing in the construction site, it won't BuggerOff.
This happens because today, `CMobileCAI::BuggerOff` doesn't actually cause any movement. It just sets some flags on the unit. The actual function that does the moving is `CMobileCAI::NonMoving`. Since `NonMoving` doesn't get called while a unit is building or moving, the unit doesn't bugger off.
Justification:
When the user places a building, their intent is for the building to be built. They would expect that their own units would avoid the construction site unless directly ordered into it.
Some possible solutions:
1. When the builder extends its build tool, tell all units in the area to get out of the way. Downside: units may still make it into the area after order is issued but before movement finishes
2. Mark the construction site as non-pathable with some timing. Downside: units may get stuck inside the non-pathable area
3. Increase the pathing cost through the construction site. Downside: Units may still path through the area if there's no other way/it's too far
4. Mark the construction site as exit-only. Downside: units may exit the area into a dead end and get stuck
Contributor guide
Research direction
Start by tracing CMobileCAI::BuggerOff and CMobileCAI::NonMoving, then reproduce both cases: a unit passing through a construction site and a busy builder standing there. Compare the proposed construction-site behaviors and verify that the chosen approach makes units leave in both cases while preserving directly ordered movement into the site.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- game-dev
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100