Opened 8 years ago

Closed 8 years ago

#3634 closed enhancement (invalid)

LoS improvements

Reported by: Palaxin Owned by:
Priority: If Time Permits Milestone:
Component: UI & Simulation Keywords:
Cc: Patch:

Description (last modified by Palaxin)

It would be nice if the line of sight depended on the surrouding terrain, buildings and other big obstacles. Also the field of view could get a more realistic shape.

This would provide a more strategic role for line of sight, I can think of situations like

  • scouting an enemy army without being seen
  • sneaking from behind to an enemy
  • more realistic guerilla warfare between (blocks of) buildings

Terrain

  • Simple: adjust LoS like archer's range
  • Advanced: units cannot see behind hills/mountains, on top of a plateau (when standing on a lower place) or at the bottom of deep gorges (if not standing at the cliff's edge)

Objects

  • Simple: units get an LoS Bonus when garrisoned on a wall (also tower, fortress or ship if implemented)
  • Advanced: Buildings and gaia elements like rocks with their height above the unit's eyes (human ~1.5m, mounted units ~2.5m, units on elephants ~4m, units on ships, buildings and siege towers perhaps even more) block the vision behind them.
  • Fancy: even if the obstacle's height is below the eyes' height there should be invisible area behind it like shadow is not "visible" for the sun; also smaller objects like trees or large animals could partially block vision (I don't know if this would demand too much resources for a large amount of units and therefore lead to game lags)

Field of View

Humans have a field of view of about 180° with decreasing vision quality at the edges. Animals have various angles and therefore a field of view in the shape of circular sectors. Actually I think it is debatable if animals should have an LoS since they can't communicate and therefore can't provide information - perhaps they could show some passive reaction if they detect something interesting instead?

  • Simple: LoS offset towards the current viewing direction
  • Advanced: semicircle LoS for humans and other circular sectors for animals (if they have LoS)
  • Fancy: modified "semicircle" LoS with less vision range at the edges e.g. vision range is described by something like r(θ)=sin(θ)*R for 0<=θ<=π where R=r(θ=π/2)=r(θ=90°) is the vision range straight forward. For animals the sine function would have to be stretched to match the specific maximum angle.

Change History (5)

comment:1 by Palaxin, 8 years ago

Description: modified (diff)

comment:2 by Lionkanzen, 8 years ago

Again, need be discussed.

comment:3 by Palaxin, 8 years ago

Ok, I have made this thread open for discussion.

comment:4 by Palaxin, 8 years ago

Priority: Nice to HaveIf Time Permits

Seems there is not much room for improvement at the moment... In the far future perhaps

comment:5 by leper, 8 years ago

Milestone: Backlog
Resolution: invalid
Status: newclosed

Parts of this are going to be hopelessly inefficient, other parts are balancing, other parts are config settings. All in all not really something for trac, and you already have a forum topic.

Note: See TracTickets for help on using tickets.