Opened 8 years ago

Closed 6 years ago

Last modified 6 years ago

#3915 closed enhancement (fixed)

[PATCH] Visual Attack Range

Reported by: scythetwirler Owned by: elexis
Priority: Should Have Milestone: Alpha 23
Component: UI & Simulation Keywords: patch beta
Cc: Patch: Phab:D568

Description (last modified by elexis)

We need to have a visual idea of how much attack range is (including techs);

e.g. when you hover or click on a tower, it will draw a circle (or a deformed circle, depending on elevations). Similarly for building previews (taking techs into account)

When attempting to place a foundation of a building with attack range, this circle should be displayed

Circle can be black in color to differentiate from aura effects.

See #4349 for aura range.

Attachments (2)

visualrange_v0.1.patch (4.5 KB ) - added by Sandarac 8 years ago.
WIP patch that shows the maximum range of defensive structures when hovered or selected. Based on the code used to display the debug range overlay.
visualrange_v0.2.patch (7.2 KB ) - added by Sandarac 8 years ago.
Properly handles multiple selected buildings.

Download all attachments as: .zip

Change History (27)

comment:1 by Lionkanzen, 8 years ago

This good example in AOE castle under siege: http://i.imgur.com/U31sHsi.jpg

Last edited 8 years ago by sanderd17 (previous) (diff)

comment:2 by elexis, 8 years ago

Backlogging due to lack of progress.

comment:3 by elexis, 8 years ago

Milestone: Alpha 21Backlog

by Sandarac, 8 years ago

Attachment: visualrange_v0.1.patch added

WIP patch that shows the maximum range of defensive structures when hovered or selected. Based on the code used to display the debug range overlay.

comment:4 by Sandarac, 8 years ago

Keywords: rfc patch added
Milestone: BacklogAlpha 21
Summary: Visual Range[PATCH] Visual Range

comment:5 by elexis, 8 years ago

  • Don't forget to bump the year in the comments.
  • size_t should be std::size_t, but preferably use a ranged loop, see wiki:Coding_Conventions
Last edited 8 years ago by elexis (previous) (diff)

comment:6 by Imarok, 8 years ago

It would be nice to show this range circle in the building preview too. Bugs(/Features?):

  • Select a tower, hover another one => no range indicator at all
  • Should it show only one range circle when selecting multiple towers?
Last edited 8 years ago by Imarok (previous) (diff)

by Sandarac, 8 years ago

Attachment: visualrange_v0.2.patch added

Properly handles multiple selected buildings.

comment:7 by bb, 8 years ago

This patch doesn't seem to take the range upgrade for the defence tower into account (at least the visual range does not change when researched) It would be nice if the was a visual range when constructing a building: to know the limits of the range before building.

comment:8 by Sandarac, 8 years ago

Keywords: rfc removed
Milestone: Alpha 21Backlog

comment:9 by scythetwirler, 7 years ago

Keywords: beta added

comment:10 by scythetwirler, 7 years ago

Summary: [PATCH] Visual Range[PATCH] Visual Attack Range

comment:11 by scythetwirler, 7 years ago

Description: modified (diff)

comment:12 by scythetwirler, 7 years ago

Description: modified (diff)
Keywords: wip added

comment:13 by scythetwirler, 7 years ago

Keywords: wip removed
Milestone: BacklogAlpha 22

comment:14 by elexis, 7 years ago

Delenda Est has a visually appealing aura range:

http://media.moddb.com/images/members/4/3718/3717519/profile/screenshot0714_small.jpg

However the implementation is inacceptable, as it replaces the selection ring texture with that texture and scales it to the aura size manually (so every balancing change needs to change some graphical setting by hand): https://github.com/JustusAvramenko/delenda_est/commit/0019f858b8854baac28c042859400ff6e2a3f300#diff-a6bb63d568e94dbf00b07cdc5199a70c

comment:15 by fatherbushido, 7 years ago

(and it throws unit far away when ungarisoning iirc :))

comment:16 by elexis, 7 years ago

Description: modified (diff)
Milestone: Alpha 22Backlog

comment:17 by elexis, 6 years ago

Milestone: BacklogAlpha 23
Patch: Phab:D568

comment:18 by elexis, 6 years ago

Owner: set to elexis
Resolution: fixed
Status: newclosed

In 20608:

Attack Range Visualization.

Fixes #3915
Differential Revision: https://code.wildfiregames.com/D568
Based on patch by: Sandarac

comment:19 by elexis, 6 years ago

In 20618:

Move EOverlayType and SOverlayDescriptor from the Selectable component to Overlay.h.

Refs #3915, D568
Patch By: Sandarac
Taken from D555
Reviewed By: Vladislav

comment:20 by elexis, 6 years ago

In 20621:

Move selection ring OverlayTexture code from CCmpSelectable::UpdateTexturedLineOverlay to the SOverlayTexturedLine struct in graphics/Overlay.cpp and SimRender in simulation2/helpers/Render.cpp.
This abstraction allows calling that code again from other simulation components, like the RangeOverlayRenderer in D555.

Differential Revision: https://code.wildfiregames.com/D1139
Refs #3915, D555
Comments By: Vladislav, echotangoecho

comment:21 by elexis, 6 years ago

In 20622:

Render the range visualization of auras, heal and attack component in a separate RangeOverlayRenderer component instead of abusing Selectable for that.
This also allows non-selectable entities like building previews to cast range visualizations.

Patch By: Sandarac
Differential Revision: https://code.wildfiregames.com/D555
Refs #3915, #4349, rP19519 / D238.
Comments By: Vladislav

comment:22 by elexis, 6 years ago

In 20624:

Use only one getter for range overlays instead of three to four in the Heal and Auras component.
Move default Heal range visualization texture properties to the template and only display Heal ranges if the template was given.

Differential Revision: https://code.wildfiregames.com/D1128
Refs #3915, #4349, D238, D432, D568

comment:23 by elexis, 6 years ago

In 20627:

Rename RangeVisualization component from rP19519 / D238 to RangeOverlayManager for consistency with the RangeOverlayRenderer from rP20622 / D555.
Refs #4899, #3915

comment:24 by elexis, 6 years ago

In 20963:

Fix range overlay color after deserialization following rP20622 / D555, refs #3915.

Since the component initialization order is the alphabetic filename order and
since the RangeOverlayRenderer < Player < Selectable, the new file in that commit introduced the issue.
Similar to rP19861, refs #4632.

UpdateColor function taken from temple's D754

comment:25 by elexis, 6 years ago

Refs #5207 for elevation adapted attack range.

Note: See TracTickets for help on using tickets.