Clickable area (hitbox) for natural resources and units is a screen-space rectangle/AABB; should behave like buildings

:arrow_forward: GAME INFORMATION

  • GAME BUILD #: 101.102.33868.0 #99404 12936891
  • GAME PLATFORM: Steam
  • OPERATING SYSTEM: confirmed on both Windows and Linux (presumably reproducible on all platforms)

:arrow_forward: ISSUE EXPERIENCED

Clickable area for natural resources and units is just a screen-space rectangle/AABB.

:arrow_forward: FREQUENCY OF ISSUE

Always

:arrow_forward: REPRODUCTION STEPS

Select a villager; hover or right click around a natural resource, enemy unit, boar, sheep, etc.

:arrow_forward: EXPECTED RESULT

Clickable area should behave like buildings, i.e. respect layer 2 in the sld files. The data is already there; the only change needed is to reuse existing code.

:arrow_forward: IMAGE

:arrow_forward: GAME FILES (SAVE / RECORDING)

n/a

2 Likes

Hi @m4ge123 !
This is like that by design, with the current hitbox for buildings, if you click on an empty pixel, you don’t click on anything, resources have a lot of gaps so it would be difficult to click on them :slight_smile:
Thanks for this detailed report!

The problem is that the hitboxes end up being too big and overlapping, making it hard to select e.g. a specific tree.
Isn’t the entire point of layer 2 to specify the clickable region?
As far as I can tell, it’s currently doing nothing for non-building assets.
If you want to maintain the current hitboxes, you could make this code change and replace layer 2 with solid rectangles equivalent to the current bounding boxes.
Alternatively, a simple toggleable game option would maintain the current behavior by default, give modders the flexibility to control hitboxes, and minimize dev work.
In any case, I would be more than happy to make a ‘better hitboxes’ mod, which I’m sure many players would be appreciative of.

2 Likes