Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add feature to only dock damaged air units #6620

Open
wants to merge 10 commits into
base: develop
Choose a base branch
from

Conversation

Garanas
Copy link
Member

@Garanas Garanas commented Jan 14, 2025

Description of the proposed changes

Introduces the ability to dock the damaged air units in your current selection. This can either be achieved via a hotkey or by right-clicking the dock button in the UI.

Originates from a suggestion on our [Discord server](https://discord.com/channels/197033481883222026/13283730906771619940.

dock-damaged.mp4

Testing done on the proposed changes

Have damaged air units in your selection. Use the hotkey and/or the UI.

Checklist

  • Changes are annotated, including comments where useful
  • Changes are documented in the changelog for the next game version

@Garanas Garanas added area: ui Anything to do with the User Interface of the Game feature: hotkeys related to miscellaneous hotkeys labels Jan 14, 2025
@Garanas Garanas changed the title Feature/dock damaged Add feature to only dock damaged air units Jan 16, 2025
@Garanas Garanas marked this pull request as ready for review January 16, 2025 18:10
Copy link
Contributor

@lL1l1 lL1l1 left a comment

Choose a reason for hiding this comment

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

The dock button's tooltip should be updated with the new behavior.

I think a fuel limit should be added to the button's behavior. The sim uses 20% fuel (Console NeedRefuelThresholdRatio) in patrol/attack move so I'd use the same. It would be practical for users.

lua/ui/game/hotkeys/dock-damaged.lua Outdated Show resolved Hide resolved
lua/ui/game/hotkeys/dock-damaged.lua Show resolved Hide resolved
Comment on lines +292 to +296
if modifiers.Ctrl then
import("/lua/ui/game/hotkeys/dock-damaged.lua").DockDamaged(0.75)
else
import("/lua/ui/game/hotkeys/dock-damaged.lua").DockDamaged(0.50)
end
Copy link
Contributor

Choose a reason for hiding this comment

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

The default sim behavior docks aircraft below 75% hp (NeedRepairThresholdRatio in console), so 50% and 75% are quite low values. I would set a 90% threshold because below 90% is when ASF-ASF and inty-inty shots to kill change.

I don't think a Ctrl modifier is needed since people won't be clicking mid-combat to dock damaged aircraft (like attack move would with 75%), and they just want a dock-damaged modifier to not dock their full HP units and waste time repairing the fleet to full HP.

The default value for the hotkey itself should be updated too.

Copy link
Member Author

Choose a reason for hiding this comment

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

I was not aware of that threshold. I initially had it at 0.25 (25% hp remaining) but noticed that a lot of units that I would personally want to go and repair too did not go. In some cases no air craft would try to dock.

lua/ui/game/hotkeys/dock-damaged.lua Outdated Show resolved Hide resolved
@lL1l1 lL1l1 added this to the Development Iteration I of 2025 milestone Jan 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: ui Anything to do with the User Interface of the Game feature: hotkeys related to miscellaneous hotkeys
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants