Author Topic: another idea - radar range on geoscape  (Read 109356 times)

Volutar

  • Guest
Re: another idea - radar range on geoscape
« Reply #120 on: July 25, 2012, 12:15:29 pm »
BTW, I've noticed, currently there's a mess with UFO detection process in OpenXCom.
- Range units are not the same as in original ufo (in 1/60 of degree I guess, nautical miles), small radar have 1500 units, and distance calculated by great circles, while in original ufo they are using value of 500 and distance is 3d distance between sphere_points in space (globe has diameter of 2048). But for small_radar (500 units of ufo1) this distance will be slighly less than 1700 nautical miles. Actually I can't get why we should use "geodesic" distance for ranges? 3D distance is much easier and faster to calculate, and moreover result is more accurate (as in original). At least every radar range in ruleset could be rearranged for getting same results. https://volutar.no-ip.org/radi.php?val=500 - my converter from xcom distances to real km/nm (you can pass any val, but maximum is 2048 which is 10800nm)

- probability formulas are totally wrong...
Code: [Select]
ship:
if dist<200 detect=true;

base:
if (dist<800 && hyperwave>0) detect=true;
else {
size = 15*(3-ufosize);

if (ufoalt=0) visibility=-30; https://ground
if (ufoalt=1) visibility=size-20; https://verylow
if (ufoalt=2) visibility=size-10; https://low
if (ufoalt=3) visibility=size; https://high
if (ufoalt=4) visibility=size-10; https://veryhigh

if (dist<750) radars=20*large_radars;
if (dist<500) radars=10*small_radars+20*large_radars;

detect = xc_RandMod(100) < (radars * (100 + visibility) / 100) );
}
And detection should work for every base, not for every radar facility!
« Last Edit: July 25, 2012, 12:20:15 pm by Volutar »

Volutar

  • Guest
Re: another idea - radar range on geoscape
« Reply #121 on: July 25, 2012, 01:52:41 pm »
BTW, I've made my "experimental" circles showing real original xcom radar ranges. Like here:




But I've got quite different results. I don't know where did they got their range values from? How 200 game distance units of radius became 750nm?.. and 800 became 2400?
https://www.ufopaedia.org/index.php?title=Talk:UFO_Detection

Offline moriarty

  • Commander
  • *****
  • Posts: 1421
    • View Profile
    • Luke's OX mod site
Re: another idea - radar range on geoscape
« Reply #122 on: July 25, 2012, 02:01:01 pm »
Volutar, your radar looks really nice. Plus I love your globe-with-grid-on-it... do you think we could include that as a toggled option? For NW toggled in the .ini, but later through an options screen?

I also agree that detection should be per-base, but how do you Account for multiple radars? Increase detection probability or increase detection frequency?

Volutar

  • Guest
Re: another idea - radar range on geoscape
« Reply #123 on: July 25, 2012, 02:10:43 pm »
moriarty,
1. I doubt ocean grid will look anyhow nice on 320x200 :). Though radar circles will look jagged too (look at SupSuper's screenshot with large pixelated circles)
2. In original game they are increasing probability. I've sent "pseudocode" listing with this in msg#121 of this topic. Increasing detection frequency IMHO would be better option, though this is quite hard to implement just because we have to get probability values intact (which ain't known for the moment), while changing detection principles.

I'd prefer to have radar sweeping frequency increased while chances decreased (to keep overall probability value the same). I hate when all UFOs are detected at time XX:00 or XX:30, and ain't detected at all in-between.

Offline Daiky

  • Battlescape Programmer
  • Administrator
  • Commander
  • *****
  • Posts: 904
    • View Profile
Re: another idea - radar range on geoscape
« Reply #124 on: July 25, 2012, 02:22:36 pm »
the globe looks better in higher resolution :)

Offline luke83

  • Commander
  • *****
  • Posts: 1559
    • View Profile
    • openxcommods
Re: another idea - radar range on geoscape
« Reply #125 on: July 25, 2012, 02:41:27 pm »
the globe looks better in higher resolution :)
So , how do we do that?

Volutar

  • Guest
Re: another idea - radar range on geoscape
« Reply #126 on: July 25, 2012, 02:47:13 pm »
Easiest way - is to go into 640x400 while zooming all loaded graphics (in loader functions). And scaling all hardcoded coordinates. Everything except globe will stay the same, but we will get 4x performance drop. Software SDL is so software...

Offline Daiky

  • Battlescape Programmer
  • Administrator
  • Commander
  • *****
  • Posts: 904
    • View Profile
Re: another idea - radar range on geoscape
« Reply #127 on: July 25, 2012, 03:29:51 pm »
Maybe we need to switch to Unity, the game engine everyone seems to use these days. You can do isometric games with it :p

Volutar

  • Guest
Re: another idea - radar range on geoscape
« Reply #128 on: July 25, 2012, 03:52:17 pm »
Daiky, but it won't be openxcom anymore... it will be totally different software :)

Offline Daiky

  • Battlescape Programmer
  • Administrator
  • Commander
  • *****
  • Posts: 904
    • View Profile
Re: another idea - radar range on geoscape
« Reply #129 on: July 25, 2012, 04:04:35 pm »
True. Sorry for going off-topic. But yeah, the globe really has not much pixels to create nice smooth circles at the moment.
That's maybe another good reason why you should be able to hide them, they are not very pretty to look at.

Volutar

  • Guest
Re: another idea - radar range on geoscape
« Reply #130 on: July 26, 2012, 10:12:41 pm »
I was thinking of drawing radar circles as globe light modifier lines. Like, getting pixels from globe and changing its light level. In spite thick pixelated lines(for 320x200), they won't become visual obstacle.
But don't really know how to do this without getting light range shrinked. In order to have ability to change light level I need to have some levels reserved for that, so I need to stole them from normal light level range. That's not very good.
Other way - to set light level to fixed value, so day zones become brigther than radar line, and night zones - darker. But fixed light level mean clearing some of texture info. That's also not very good.
There is third way, though I'm not sure it will be nice. To have a copy of globe surface before day/night shade applied, and use this surface for drawing "semitransparent" circles.
Anyways, this could be a matter of further experiments after at least getting simple radar circles drawn with color:)

Offline Yankes

  • Global Moderator
  • Commander
  • *****
  • Posts: 3350
    • View Profile
Re: another idea - radar range on geoscape
« Reply #131 on: July 26, 2012, 11:57:12 pm »
I made some test with my globe and I probably hit limit, even having 100FPS game feel laggy.
This are screenshot from this version, I made small mistaken that caused pushed ocean color to another one.
Right now I have still 400 circles, but now I dont stop after first "hit". Because of that circles can overlap.

Offline Amunak

  • Colonel
  • ****
  • Posts: 101
    • View Profile
    • My homepage (czech only)
Re: another idea - radar range on geoscape
« Reply #132 on: July 27, 2012, 12:22:10 am »
Yankes: How is it possible that around 100FPS feels laggy? I doubt that your screen has greater refresh rate then 75Hz. Even "only" about 30FPS should be impossible to see - human eye sees about 25 "frames per second". So there has to be some great error with openxcom :/

Volutar

  • Guest
Re: another idea - radar range on geoscape
« Reply #133 on: July 27, 2012, 08:04:25 am »
BTW, in original xcom there's no need to show different ranged radar circles of one base, just because it doesn't matter - if you have 9 small radars and 1 large, overall detection rating will be about 9*10+1*20=100%, and only largest range used.
But in openxcom SupSuper decided to process radar sweeps per-facility, not per base. This most probably will impact on gameplay. And I'm not sure we should do that.

Having detection working on per facility base we need to show each radar, and their quantity... There could be 10 types of radars in some mod, and each of them could have different range, so 10 different circles will be shown around each base. That will make quite a mess.
1. Get rid of per-facility detection priniciple, and get back to original's (when only largest range is used), so largest radar range will be actual and real. But this is not quite realistic (in terms of real physics). - this will require one cached circle point array per base.
2. Show only largest range radar, and forget about lesser ones, paying no attention on detection chances "gradient" in this case. And probably give some notice on hidden zones of different detection chances. In this case visual radar circle would show less probable though largest zone. - this will also require one cached circle point array per base.
3. Show range circle of each radar. This might create visual mess if number of different radars used in single base. - this will require cached circle point array per facility.
4. Show no radar circles at all.
« Last Edit: July 27, 2012, 08:22:25 am by Volutar »

Offline moriarty

  • Commander
  • *****
  • Posts: 1421
    • View Profile
    • Luke's OX mod site
Re: another idea - radar range on geoscape
« Reply #134 on: July 27, 2012, 09:44:25 am »
I'd go for #2. we don't really need more information on the geoscape than "this is the maximum range of your radar".

A different case would be placing a new base: for that, I'd go with #3: show the ranges of all detection facilities available at that point, so you can see where you will want to place your base for optimum radar coverage.