Opened 10 years ago

Last modified 9 years ago

#2913 closed task

Better way to handle visibilities in the simulation — at Version 2

Reported by: Itms Owned by: Itms
Priority: Should Have Milestone: Alpha 18
Component: Core engine Keywords:
Cc: Patch:

Description (last modified by Itms)

My work on #599 allowed me to work on the visibility systems (fog-of-war, line of sight, etc.), and currently, a large part of the visibility logic is handled by the RangeManager system component, especially in this function.

As a consequence, scripted components can't influence the visibility of an entity. Mods, but also planned features for the main game (like Iberian camouflaged units), would need a way to influence this visibility. Also, the way I plan to tackle #2710 needs it.

I propose to separate this logic into a Visibility component. Several things could benefit from this change.

I think it would be better to do changes in separate patches/commits, to avoid complexity and possible regressions. So I set this ticket as a task, and I will use it to track the changes. Remaining planned changes:

  • Create the Visibility component
  • Find a way to remove the hardcoded and duplicated VIS_FOO in the scripted components Fogging, Mirage and Visibility
  • Move template items GetRetainInFog and AlwaysVisible from Vision to Visibility
  • Update component documentations (RangeManager, Visibility), including code comments
  • Fix #2710 with the new system
  • Improve #958 with the new system if possible (see this TODO)
  • For fun, implement camouflaging for some units

Change History (2)

comment:1 by Itms, 10 years ago

In 15925:

Add a new Visibility component that will eventually allow scripted components and mods to influence an entity's visibility.

This first commit only refactors code and does not add any new feature.

Refs #2913 (see this ticket for more information about the change)

comment:2 by Itms, 10 years ago

Description: modified (diff)
Note: See TracTickets for help on using tickets.