Page MenuHomeWildfire Games

Compute LOS for all vertices around an obstruction, not only the center.
Needs ReviewPublic

Authored by wraitii on Nov 10 2020, 4:25 PM.


Trac Tickets

An entity is currently considered visible iff the nearest LOS vertice is visible.
This is wrong for large entities, where we ought to consider all nearest vertices.
This is non-trivial to do, particularly to do fast.

This diff checks an enlarged circle around the obstruction, slightly imprecise (particularly for very rectangular buildings). I expect it to be reasonably fast, but it'll still take much more time than before to update visibilities.

This contributes to drastically reduce the LOS "popping" from #5606, though not entirely as there is also a purely graphical component (see D3077).

TODOs before merging:

  • Measuring the performance difference somehow.
  • work out if we ought to treat rectangles better / use the obstructions proper.
Test Plan

Review the changes. Agree with the changes.

Event Timeline

wraitii created this revision.Nov 10 2020, 4:25 PM

Successful build - Chance fights ever on the side of the prudent.

/Applications/ file: ../../../binaries/system/libnetwork.a(precompiled.o) has no symbols
/Applications/ file: ../../../binaries/system/libsimulation2.a(precompiled.o) has no symbols
/Applications/ file: ../../../binaries/system/libengine.a(precompiled.o) has no symbols

Link to build:

wraitii requested review of this revision.Nov 10 2020, 4:34 PM