aliens

Author Topic: Country Zones  (Read 9798 times)

Offline Warboy1982

  • Administrator
  • Commander
  • *****
  • Posts: 2333
  • Developer
    • View Profile
Country Zones
« on: November 19, 2012, 11:38:38 am »
i want to start adding alien/xcom activity scores and graphs,  but i've hit a brick wall.

Does anybody have the values of the country zones (as shown here) on hand either in raw (hex) form with region zones for comparison or in OpenXcom lon/lat values (if there's even a difference) like the regions? or is anyone able to look them up? or tell me expressly where to look? the ufopedia article talk page wasn't quite... complete enough for me to even really begin to work with, not to mention it doesn't seem to be written in anything i can understand. none of the addresses in the static disassembly dump seem to correspond to relevant hex offsets or values, so i'd be stabbing in the dark at best.

Offline SupSuper

  • Lazy Developer
  • Administrator
  • Commander
  • *****
  • Posts: 2162
    • View Profile
Re: Country Zones
« Reply #1 on: November 19, 2012, 04:14:55 pm »
I'm pretty sure I have that info stashed somewhere, I'll have a look.

Volutar

  • Guest
Re: Country Zones
« Reply #2 on: November 19, 2012, 08:14:07 pm »

Offline SupSuper

  • Lazy Developer
  • Administrator
  • Commander
  • *****
  • Posts: 2162
    • View Profile
Re: Country Zones
« Reply #3 on: November 19, 2012, 09:22:46 pm »
Note that X-Com coordinates and OpenXcom coordinates aren't in the same units, you can find the code to convert them in Globe::loadDat.

Offline Warboy1982

  • Administrator
  • Commander
  • *****
  • Posts: 2333
  • Developer
    • View Profile
Re: Country Zones
« Reply #4 on: November 19, 2012, 10:52:04 pm »
lovely. thank you very much :D

Offline Warboy1982

  • Administrator
  • Commander
  • *****
  • Posts: 2333
  • Developer
    • View Profile
Re: Country Zones
« Reply #5 on: November 20, 2012, 03:25:27 am »
just checking to make sure i've got my math and interpretation right here.

entry 0:

1880, 2040, -392, -256, 0  ==  4.10152374, 4.45058959, -0.855211333, -0.558505360, country 0 (usa)
(according to formula: value * 0.125 * PI / 180)?

the values at least LOOK like they're proximate to the usa country label (Lon: 4.53786 Lat: -0.698132)
« Last Edit: November 20, 2012, 03:48:42 am by Warboy1982 »

Offline Warboy1982

  • Administrator
  • Commander
  • *****
  • Posts: 2333
  • Developer
    • View Profile
Re: Country Zones
« Reply #6 on: November 20, 2012, 05:58:41 am »
initial testing shows good results.
thanks guys for the data, and thank you to whomever provided the insideRegion routine for me to copypasta.

Volutar

  • Guest
Re: Country Zones
« Reply #7 on: November 20, 2012, 06:45:43 am »
Actually regions and countries better to be defined not as bunch of rectangles, but as bunch of polygons, which will follow (more or less) actual geographic outlines. But this could be post 1.x :)

Offline Warboy1982

  • Administrator
  • Commander
  • *****
  • Posts: 2333
  • Developer
    • View Profile
Re: Country Zones
« Reply #8 on: November 20, 2012, 07:13:13 am »
yeah, i totally agree. 2 dimensional rectangular surfaces don't really make sense as expressions of areas on a globe as they do on say, a map.
but it does what it's supposed to, and that's good enough for me. (for now)

Offline moriarty

  • Commander
  • *****
  • Posts: 1421
    • View Profile
    • Luke's OX mod site
Re: Country Zones
« Reply #9 on: November 20, 2012, 03:26:28 pm »
for "later", I guess it would be nice to have the region defined in the globe data itself: every polygon of the globe surface not only has a "terrain", but also a "zone" - and perhaps even more relevant information attributes. also dynamic properties like "alien activity" and "xcom activity" could be stored by polygon, which would allow us to display that information directly in the geoscape view :)


Volutar

  • Guest
Re: Country Zones
« Reply #10 on: November 20, 2012, 06:29:27 pm »
moriarty, there is a flaw in approach you described. It will have country/zone borders along poly edges, and not wherever it need to be. Or it should be very detailed Earth polygonal model/map.

Offline moriarty

  • Commander
  • *****
  • Posts: 1421
    • View Profile
    • Luke's OX mod site
Re: Country Zones
« Reply #11 on: November 20, 2012, 06:49:07 pm »
Or it should be very detailed Earth polygonal model/map.

This. Precisely. :)