beyond-all-reason / Beyond-All-Reason

Main game repository for Beyond All Reason.
https://www.beyondallreason.info/
Other
1.64k stars 269 forks source link

Make LMB Drag Box Select add units that are partially within the box #3375

Open sprEEEzy opened 1 month ago

sprEEEzy commented 1 month ago

Description

Currently, if you try to drag box select units, you only select those that have their center within the box. This makes for awkward micro, especially if you're coming from other RTS titles.

https://github.com/user-attachments/assets/4605ca22-9b9b-47c8-81fe-380d3acc8eae

This has been talked about here: https://github.com/beyond-all-reason/spring/issues/671

Why?

Every other RTS game that I've played has something like the following: if more than 1 pixel (or small percentage) of a unit (or it's collision box) is within the select box, the unit is selected.

That way, you can make quick selections and issue commands more precisely.

Take a look at the example below, on how extreme this problem can get.

image

What area of the game does this feature request pertain?

Gameplay, UI/UX

Other (optional)

To me, this makes me not want to micro certain units, as I cannot make sure I always box select them correctly.

Partially related issue: https://github.com/beyond-all-reason/Beyond-All-Reason/issues/3116

PtaQQ commented 1 month ago

Approved by the GDT.

GoogleFrog commented 1 month ago

I can't find the other ticket with a lot of discussion on it. It should be linked.

sprEEEzy commented 1 month ago

I can't find the other ticket with a lot of discussion on it. It should be linked.

Here you go https://github.com/beyond-all-reason/spring/issues/671

sprunk commented 1 month ago

There was also https://github.com/beyond-all-reason/spring/discussions/668

GoogleFrog commented 1 month ago

Are you sure this isn't just a bug with something BAR is doing?

Currently, if you try to drag box select units, you only select those that have their center within the box. This makes for awkward micro, especially if you're coming from other RTS titles.

This seems to be false, given the tiny screenshot of the commander. I can't replicate the issue in ZK.

sprunk commented 1 month ago

1) dragging only taking midpos into account is true but that's (essentially) an engine matter. 2) BAR seems to place commander midpos at ground level, away from the bulk of its body, so any sort of non-topdown camera angle is likely to struggle. image

sprEEEzy commented 1 month ago
  1. dragging only taking midpos into account is true but that's (essentially) an engine matter.
  2. BAR seems to place commander midpos at ground level, away from the bulk of its body, so any sort of non-topdown camera angle is likely to struggle. image

Yes, this explains the ss.

drivver44 commented 1 month ago
  1. dragging only taking midpos into account is true but that's (essentially) an engine matter.

    1. BAR seems to place commander midpos at ground level, away from the bulk of its body, so any sort of non-topdown camera angle is likely to struggle. image

the midposition of the armcom in upspring is listed at 0 23 -3 i actually think there is something wrong here as that should already be seleceting the commander with how selection works in bar the midposition isnt at the ground level in the first place. what is at the ground level that is causing this

loveridge commented 1 month ago

Perhaps it is because SmartSelect uses GetUnitsInScreenRectangle which uses unit drawPos instead of midPos for the check. Whereas the engine box selection code uses midPos.

sprunk commented 1 month ago

Ideally the "filter out buildings etc" selection feature would just use wupget:SelectionChanged as returned by the engine box drag and filter down from there, instead of manually reimplementing the box via Spring.GetUnitsBla calls.