Author Topic: [DONE][Suggestion]sightRange for bases or radar facilities.  (Read 4198 times)

Offline Nord

  • Commander
  • *****
  • Posts: 1747
  • The Gate is open.
    • View Profile
[DONE][Suggestion]sightRange for bases or radar facilities.
« on: April 20, 2020, 02:40:56 pm »
I desperately need another way of detecting alien bases. Maybe it iss possible to add functionality of sightRange to X-com bases?
« Last Edit: May 14, 2020, 07:16:24 pm by Meridian »

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9101
    • View Profile
Re: [Suggestion]sightRange for bases or radar facilities.
« Reply #1 on: April 20, 2020, 04:40:25 pm »
1/ how often is the check performed? once a day? every hour?
2/ what's the detection chance? 100%? 20%?

Offline Nord

  • Commander
  • *****
  • Posts: 1747
  • The Gate is open.
    • View Profile
Re: [Suggestion]sightRange for bases or radar facilities.
« Reply #2 on: April 20, 2020, 04:56:00 pm »
1. As you want.
2. As you want
:-)
In fact, i think it is not really matters. If you have constantly sweeping radar on some area, measuret in thousands of miles, you can spend another hour or day to discover base.
So, lets say 15-30% chances per day is normal. I think.
But maybe other modders will want to choose chances by ruleset.
By the way, how it works with crafts? 100% once in a hour?

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9101
    • View Profile
Re: [Suggestion]sightRange for bases or radar facilities.
« Reply #3 on: April 20, 2020, 05:42:13 pm »
Xcom crafts are checking every 10 minutes,
chance is RNG::percent(50-(craft->getDistanceTo(alienBase) / sightRange) * 50)
i.e. from 0% to 50% based on distance to alien base

Xcom bases are checking once every month,
chance is fixed 20% (to find the first undiscovered base).

Offline Nord

  • Commander
  • *****
  • Posts: 1747
  • The Gate is open.
    • View Profile
Re: [Suggestion]sightRange for bases or radar facilities.
« Reply #4 on: April 20, 2020, 06:05:12 pm »
Xcom crafts are checking every 10 minutes,
chance is RNG::percent(50-(craft->getDistanceTo(alienBase) / sightRange) * 50)
i.e. from 0% to 50% based on distance to alien base base).
Well, same formula once per hour looks ggod. Or once per day. Maybe day is better, so craft detectors still be useful.

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9101
    • View Profile
Re: [Suggestion]sightRange for bases or radar facilities.
« Reply #5 on: April 20, 2020, 08:54:29 pm »
ok, will be done.

Offline Nord

  • Commander
  • *****
  • Posts: 1747
  • The Gate is open.
    • View Profile
Re: [Suggestion]sightRange for bases or radar facilities.
« Reply #6 on: April 21, 2020, 04:14:38 am »
ok, will be done.
This is great, thank you very much.

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9101
    • View Profile
Re: [Suggestion]sightRange for bases or radar facilities.
« Reply #7 on: May 14, 2020, 07:15:23 pm »
sightRange = Range at which the facility can detect alien bases in nautical miles. Zero means "cannot detect".
sightChance = Chance (0-100%) of this facility detecting an alien base that enters its sight range.

Example:

Code: [Select]
facilities:
  - type: STR_SMALL_RADAR_SYSTEM
    sightRange: 2000
    sightChance: 40

Check is done once per day.


Special case: if sightChance = 0, it doesn't mean 0%, but it's a dynamic probability based on the distance between xcom and alien base, using the following formula:

Code: [Select]
chanceToDetect = 50 - (distance * 50 / sightRange); // dynamic 0-50% based on relative distance