View Issue Details

IDProjectCategoryView StatusLast Update
0004363Spring engineLuapublic2014-05-10 08:57
ReporterGoogle_Frog Assigned ToKloot  
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
Product Version96.0.1+git 
Summary0004363: 96.0.1-404 Spring.IsUnitIcon is broken
DescriptionSometimes Spring.IsUnitIcon returns true when it should not. This occurs when the camera is almost zoomed out far enough to make a unit display as an icon. As far as I can tell the callin has always been broken.

This callin is required to make a decent replacement for the default engine selection visualization. In its current state these widgets show units as deselected when they are actually selected and this is very annoying.

The callin appears to be based on distance because it is affected by hills. Whether a unit is actually an icon depends on something else. This problem occurs even on completely flat maps.
Steps To ReproduceThe easiest way to reproduce is to move the camera to just below the level at which units are shown as icons. Then spawn about 400 large units and scroll around with a selection widget enabled as they tend to use Spring.IsUnitIcon. My flat map screenshot uses armsolar on the map white with Blurry Selection Halo enabled.

This code demonstrates the problem:
function widget:Update()
    local mx, my = Spring.GetMouseState()
    local pointedType, unitID = Spring.TraceScreenRay(mx, my)
    if pointedType == 'unit' and Spring.ValidUnitID(unitID) then
        local icon = Spring.IsUnitIcon(unitID)
        WG.UnitEcho(unitID, icon and "icon" or "model")
    end
end
TagsNo tags attached.
Attached Files
hill.jpg (Attachment missing)
flat.jpg (Attachment missing)
lod.jpg (Attachment missing)
Checked infolog.txt for Errors

Activities

jK

2014-04-18 22:08

developer   ~0013022

Maybe it returns true already for faricons (texture billboards)?

Google_Frog

2014-04-19 04:58

reporter   ~0013023

After some messing around with lod I determined that it does not affect this bug. When I first tested it lod was 5x higher than my icon distance so I never saw billboards.

I just attached a lod screenshot which shows some billboard units (the light ones) as well as some models (the dark ones). The selection graphics show that Spring.IsUnitIcon goes from false to true partway through the block of units.

Google_Frog

2014-05-10 08:03

reporter   ~0013046

This has been fixed. The ticket can be closed.

cleanrock

2014-05-10 08:57

reporter   ~0013048

Probably fixed by
https://github.com/spring/spring/commit/c38e590

Issue History

Date Modified Username Field Change
2014-04-18 10:05 Google_Frog New Issue
2014-04-18 10:05 Google_Frog File Added: hill.jpg
2014-04-18 10:06 Google_Frog File Added: flat.jpg
2014-04-18 22:08 jK Note Added: 0013022
2014-04-19 04:54 Google_Frog File Added: lod.jpg
2014-04-19 04:58 Google_Frog Note Added: 0013023
2014-05-10 08:03 Google_Frog Note Added: 0013046
2014-05-10 08:57 cleanrock Note Added: 0013048
2014-05-10 08:57 cleanrock Status new => resolved
2014-05-10 08:57 cleanrock Resolution open => fixed
2014-05-10 08:57 cleanrock Assigned To => Kloot