aliens

Author Topic: Radar and Hyper Wave Decoder range are not the same  (Read 5263 times)

Offline The Reaver of Darkness

  • Commander
  • *****
  • Posts: 1512
    • View Profile
Radar and Hyper Wave Decoder range are not the same
« on: August 05, 2017, 07:03:03 am »
If a radar facility is set to a range of 2100 or shorter, it is listed as being short range, but if its range is 2101 or longer, it is listed as long range.

If a hyper wave decoder facility is set to a range of 1800 or shorter, it is listed as being short range, but if its range is 1801 or longer, it is listed as long range.

Why are these two values different?

Offline Yataka Shimaoka

  • Colonel
  • ****
  • Posts: 284
  • I'm the trouble maker
    • View Profile
Re: Radar and Hyper Wave Decoder range are not the same
« Reply #1 on: August 05, 2017, 09:57:15 am »
Must be hardcoded me thinks

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9087
    • View Profile
Re: Radar and Hyper Wave Decoder range are not the same
« Reply #2 on: August 05, 2017, 11:27:11 am »
Must be hardcoded me thinks

No, it's not.

If a radar facility is set to a range of 2100 or shorter, it is listed as being short range, but if its range is 2101 or longer, it is listed as long range.
If a hyper wave decoder facility is set to a range of 1800 or shorter, it is listed as being short range, but if its range is 1801 or longer, it is listed as long range.
Why are these two values different?

It's a bug.
The threshold = Minimum radar range... which is a global static variable and doesn't reset when you change a mod... only resets when you exit OpenXcom and start the application anew (restart is not enough).

Example:
short radar range = 1000
long = 2000
hyper = 3000

in this case the threshold is set to 1000 (and remembered).

Now you change to a mod which has:
short radar range = 2000
long = 2000
hyper = 3000

but the threshold will remain at 1000... doesn't update to 2000 until you exit and start OpenXcom.

Offline The Reaver of Darkness

  • Commander
  • *****
  • Posts: 1512
    • View Profile
Re: Radar and Hyper Wave Decoder range are not the same
« Reply #3 on: August 05, 2017, 06:32:12 pm »
I tested it by closing openxcom, changing radar range, then re-opening it. I must have seen the values I saw due to having LARGE_RADAR_SYSTEM at 2100 and SMALL_RADAR_SYSTEM at 1800 by default. If I changed small radar to have longer range than the defunct large radar, it displayed as long range. But when it's back to 1800, the hyper-wave decoder must go as low as that value to list as short range.

Is it just taking the lower of the two values between the original two facilities and setting that as the minimum radar range?


What I want to do is to have four radar facilities:
Radar System: 1x1, short range, 1800 NM
Large Radar System: 2x2, long range, 2700 NM
Hyper-wave Decoder: 1x1, short range, 2400 NM
Large Hyper-wave Decoder: 2x2, long range, 3600 NM


Based on this information, the best way I can see to implement this would be to hold both the SMALL_RADAR_SYSTEM and the LARGE_RADAR_SYSTEM defunct and make four new facilities, using the old ones to set the minimum radar range. Is there a better way to do this that doesn't involve handing people a 2400 NM radar just for upgrading their mod version and/or would it even work?

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9087
    • View Profile
Re: Radar and Hyper Wave Decoder range are not the same
« Reply #4 on: August 05, 2017, 07:18:51 pm »
Facilities with the lowest range count as short range.
Everything else counts as long range.

In your example:
- 1800 NM is short range
- 1801 and more is long range

Offline The Reaver of Darkness

  • Commander
  • *****
  • Posts: 1512
    • View Profile
Re: Radar and Hyper Wave Decoder range are not the same
« Reply #5 on: August 05, 2017, 08:54:33 pm »
So then it's not possible to have two facilities with different ranges both count as short range? That's terrible!

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9087
    • View Profile
Re: Radar and Hyper Wave Decoder range are not the same
« Reply #6 on: August 10, 2017, 06:38:57 pm »
It's a bug.

The bug was fixed in the latest nightly.

Offline The Reaver of Darkness

  • Commander
  • *****
  • Posts: 1512
    • View Profile
Re: Radar and Hyper Wave Decoder range are not the same
« Reply #7 on: August 10, 2017, 09:51:52 pm »
Facilities with the lowest range count as short range.
Everything else counts as long range.

Did this functionality change? Or only this:

It's a bug.
The threshold = Minimum radar range... which is a global static variable and doesn't reset when you change a mod...

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9087
    • View Profile
Re: Radar and Hyper Wave Decoder range are not the same
« Reply #8 on: August 10, 2017, 10:25:10 pm »
Only bugfix.

No functionality change, you'll have to ask vanilla devs for changes in vanilla.