beyond-all-reason / beyond-all-reason/RecoilEngine
Decouple water unpathability from damage
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 683
- Forks
- 293
- Avg merge
- 3d 2h
- Merged PRs (30d)
- 40
Description
Units won't path into water if its damage per tick is above 1000 (kbot/veh) or 10000 (hover).
https://github.com/beyond-all-reason/spring/blob/e55ce6231a0b125f41f56688277dca95ddc7b3bd/rts/Sim/MoveTypes/MoveDefHandler.cpp#L145-L147
https://github.com/beyond-all-reason/spring/blob/e55ce6231a0b125f41f56688277dca95ddc7b3bd/rts/Sim/MoveTypes/MoveDefHandler.cpp#L67-L69
Decouple this from magic constants and let maps control it independently via some boolean flag.
As a use case example, a bunch of ZK FFA maps have "tar" around them (water with no damage but filled with explicit 0 speed mod terrain to prevent boat shenanigans) but this fails because it is done via terrain typemap so is tied to the XZ location and not Y. So you can terraform a platform above the tar (and it will still have the 0 mod) or sink a regular part of the terrain down (which won't have the modifier and you can swim in tar).
Ground units also become more reluctant to path into damaging water as its DPS increases (via CMoveMath::waterDamageCost). This could become configurable too. I am unsure how a good interface to define the formula would look; ZK doesn't care much about this part because we use raw move.
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 with the referenced lines in rts/Sim/MoveTypes/MoveDefHandler.cpp to trace how water damage currently determines unpathability. Also inspect CMoveMath::waterDamageCost, which the issue identifies as a possible separate configuration concern. Done means map-controlled water pathability is independent of the damage thresholds, with the intended behavior verified for the described tar and terraforming cases.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- game-dev
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100