Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#4297 closed defect (fixed)

[PATCH] Miraging is broken for certain entities the first time the mirage appears

Reported by: wraitii Owned by: wraitii
Priority: Must Have Milestone: Alpha 22
Component: UI & Simulation Keywords: patch
Cc: Patch:

Description

It seems for resources for example Miring is behaving quite erratically.

To reproduce:

Load a new map, task some units to check out an unknown tree somewhere. Order them to gather from it. Select it before they start gathering. Once they start gathering you should be switched over to the mirage. Order them away so that the tree becomes fogged. Select the tree. Once it goes fogged you should lose selection focus and click on the tree: the mirage will still show full resources.

Attachments (2)

tentativeFix.patch (888 bytes ) - added by wraitii 7 years ago.
fixv0.patch (684 bytes ) - added by wraitii 7 years ago.

Download all attachments as: .zip

Change History (9)

by wraitii, 7 years ago

Attachment: tentativeFix.patch added

comment:1 by wraitii, 7 years ago

Patch: Do not create a mirage for an entity that is currently visible. Do update the mirage if the entity becomes hidden rather than invisible, because mirage entities going in the FOW become hidden (I think - ITMS?)

in reply to:  1 comment:2 by Itms, 7 years ago

Keywords: review removed
Milestone: Alpha 21Alpha 22
Priority: Release BlockerMust Have

There is, indeed, something to change line 38, but your change is wrong here: this.miraged is true when there is a mirage loaded, but that never happened before because the component used to be deactivated (we're in the middle of Activate). The actual fix would be checking whether the visibility is "fogged", and if yes create the mirage - else the component will be only activated and the proper miraging will happen later.

This would be enough to fix the issue(s) you describe in this ticket.

Your second change doesn't make sense (there is no early return so you're just loading a mirage in all situations !) - but to answer your question above, no the code is right here. This is how it works: the entity falls into the FoW. The range manager triggers a visibility change, from "visible" to "fogged". In that case, and only if the component is activated, a mirage is loaded. When this mirage is finally loaded, the visibility of the actual entity will become "hidden" and you will only see the mirage, which will be "fogged".

becomes hidden rather than invisible

You seem to be confused: "visible" and "fogged" make the entity visible, "hidden" makes it invisible.

by wraitii, 7 years ago

Attachment: fixv0.patch added

comment:3 by wraitii, 7 years ago

Presumably this is the proper fix.

comment:4 by elexis, 7 years ago

Keywords: rfc added

comment:5 by elexis, 7 years ago

Milestone: Alpha 22Work In Progress

Moving to the new WIP milestone.

comment:6 by wraitii, 7 years ago

Owner: set to wraitii
Resolution: fixed
Status: newclosed

In 19100:

Fixes an issue with miraging. Fixes #4297. Reviewed by leper and Itms.

Differential Revision: https://code.wildfiregames.com/D10

-This line, and those below, will be ignored--

M binaries/data/mods/public/simulation/components/Fogging.js

comment:7 by elexis, 7 years ago

Keywords: rfc removed
Milestone: Work In ProgressAlpha 22
Note: See TracTickets for help on using tickets.