beyond-all-reason / beyond-all-reason/RecoilEngine

[Feature Request] Conic Airsight

Open
#623 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
679
Forks
290
Avg merge
3d 1h
Merged PRs (30d)
38

Description

Currently we have an airsightdistance parameter for vision over aircrafts. First of all, why is it needed? As I understand: 1. It is natural that a plane is visible from afar, unlike some ground unit hidden in landscape; 2. For gameplay reasons: aircrafts are quick so ground units need better reaction time to be able to do something about them.

The thing is, in my game aircrafts fly at different heights. So gunships fly lower, fighters - higher, and there are these huge flying units that fly very-very high. Imagine a satellite or a space ship. So if such a huge unit suddenly appears over you out of nowhere, that looks kinda dumb! And that happens because no sane value for an airsightdistance would cover this case, because with that one parameter you can only cover 1 case: either properly simulate lower aircrafts, or higher.

My proposition for air units detection is to use a frustum test like this:
![ConicAirSight](https://user-images.githubusercontent.com/84379085/217632635-e01d91f7-b9b4-41ff-8699-26877ab7ecd8.jpg)

Any aircraft above the unit within the frustum shall be detected ~~(provided it has direct eye contact of course, just as usual)~~.
This should adequately simulate detection for aircrafts at any scale.
In this case, the unitdef parameter is the angle of the sight frustum, and the bottom radius of it is the radius of normal ground vision.

I do not propose to replace existing airsightdistance though! Rather to make it work like a switch, when specified, like some unitdef components already do.

You can also rework air sight for BAR as well, using this method. Air sight frustum angle will need to be set to a value that corresponds to airsightdistance and average aircraft cruise height with some small multiplier like 1.1. It's hard to tell if it would be an improvement for BAR gameplay specifically, because behavior would differ, although being roughly similar, but its hard to judge on paper.

Contributor guide

Open the contributing guide

Research direction

Start by tracing how the existing airsightdistance unitdef parameter is parsed and used for aircraft detection. Compare that behavior with the proposed frustum angle and ground-vision radius, including direct-eye-contact rules. Done means a documented design and implementation path that handles aircraft at different heights without removing the existing parameter.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
game-dev
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
28/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.