Jump to content

City locations "shown" on Geoscape...


Zyxpsilon

Recommended Posts

Amineri or Ryan.. can you verify any of this stuff, please?

 

Cuz, i just got my very first "Oslo/Norway" GuerillaOps mission and the proper XY (530,167) location as defined in the code files actually was dispatched all the way up to northern Finland!

 

It's as if the equirectangular projection model & its dataset are being wrecked by whatever function has been given the task to translate valid Miller-Cylindrical vector "points".

 

Otherwise.. we're just creating Mods that can't rely on such imprecise patterns from the get-go.

 

EDIT; Okay -- correct me if i'm wrong but i think this might be *IT* from the XComEarth.uc script...

..
..
function vector ConvertEarthToWorldByTile(int tile, vector2D inCoords)
{
    local vector vLoc;
    local int col;
    
    col = tile - 1;

    inCoords.X = WrapF(inCoords.X, 0.0f, 1.0f);
    inCoords.Y = WrapF(inCoords.Y, 0.0f, 1.0f);

    vLoc.x = (inCoords.X*GetWidth() + XOffset);    
    vLoc.y = (inCoords.Y*GetHeight());
    vLoc.z = 0.1f;

    vLoc.x += GetWidth() * col;

    return vLoc;
}

static function vector ConvertEarthToWorld(vector2D inCoords, optional bool bWrap=true)
{
    local vector vLoc;

    // wrap earthspace coordinates
    if(bWrap)
    {
        inCoords.X = WrapF(inCoords.X, 0.0f, 1.0f);
        inCoords.Y = WrapF(inCoords.Y, 0.0f, 1.0f);
    }

    // Convert to World coords
    vLoc.x = (inCoords.X*GetWidth() + default.XOffset);    
    vLoc.y = (inCoords.Y*GetHeight());
    vLoc.z = 0.1f;

    return vLoc;
}
..
..

Right?

 

Honestly -- i really want to figure out what goes on under the hood for this very specific issue.. at it means many of my custom Cities coordinates are just wasted in empty space or outright completely off-the-mark. If the SkyRanger can't go 1) from The Netherlands to Bonaire (Antilles) or 2) from Norway to Svalbard or 3) from Denmark to Nuuk/Greenland (etc) for examples -- the immersion factor is simply blown to pieces and then, i'm certainly the fool's king of being wrongfully accused of screwing up a gameplay even further while i'm NOT responsible at all.

Edited by Zyxpsilon
Link to comment
Share on other sites

oooKay -- here's another proof (keeping track of weird stuff, just in case i should be able to detect an exact code pattern);

 

http://s31.postimg.org/d5mqc76wr/Flaw_Gaborone_in_Madagascar.png

 

Gaborone isn't really located in Madagascar!! :)

Link to comment
Share on other sites

Honestly, it's very hard to tell if there's some OFFset calculations at work or not.. simply because everything seems to happen in random fashion.

One time a city could be 70 pixels too far right, another it would show up 150 pixels to the north-west!

 

The way i see it.. the function(s) responsible aren't calibrated to handle Miller-Cylindrical (or even Patterson, btw) translations correctly. But, IF only someone at Firaxis should just bother to examine this whole stuff - we'd probably have a definitive proper solution in a week or less. Problem is, after this "kind of ignoring" state of affairs for this specific thread... my hope is fading by the hours.

 

Frankly, it's sad that this wonderful gameplay wouldn't receive such simple attention to details.

Edited by Zyxpsilon
Link to comment
Share on other sites

I think you seem to be misunderstanding how the game grabs cities?

 

The game doesn't take into account where cities are at actual mission generation, this is what the game does to define a mission's location when it spawns a mission is the following in the default mission sources templates:

RegionState = GetRandomContactedRegion();
MissionState.Region = RegionState.GetReference();
MissionState.Location = RegionState.GetRandomLocationInRegion();
With GetRandomLocationInRegion() being exactly what it sounds like. It just grabs a random set of X and Y coordinates within the region (New Mexico, South Africa, etc) the game chose.
Where cities comes in is when the mission site description is being built in the Skyranger loading portion and it's a City Center/Slums/Small Town map, as that's when it grabs the nearest city for usage like so:

static function X2CityTemplate GetNearestCity(Vector Location, XComGameState_WorldRegion LimitToRegion = none)
{
local array<X2StrategyElementTemplate> arrCityTemplates;
local X2StrategyElementTemplate IterateTemplate;
local X2CityTemplate CityTemplate;
//local StateObjectReference CityRef;
local float BestDistance;
local float Distance;
//local XComGameStateHistory History;
//local XComGameState_City CityState;
 
//History = `XCOMHISTORY;
 
//if(LimitToRegion == none)
//{
arrCityTemplates = class'X2StrategyElementTemplateManager'.static.GetStrategyElementTemplateManager().GetAllTemplatesOfClass(class'X2CityTemplate');
//}
//else
//{
// foreach LimitToRegion.Cities(CityRef)
// {
// CityState = XComGameState_City(History.GetGameStateForObjectID(CityRef.ObjectID));
// arrCityTemplates.AddItem( CityState.GetMyTemplate() );
// }
//}
 
 
BestDistance = 10000000.0f;
foreach arrCityTemplates(IterateTemplate)
{
Distance = VSize(X2CityTemplate(IterateTemplate).Location - Location);
if( Distance < BestDistance )
{
BestDistance = Distance;
CityTemplate = X2CityTemplate(IterateTemplate);
} 
}
 
return CityTemplate;
}
It just grabs every single city that's been defined and goes through them all, and goes with the one that's effectively closest to the mission site to build the string with. That's all.
As for converting city coordinates to the system XCOM 2 uses, I just used the method Amineri detailed in this thread.

 

The city with the east-most coordinate of vect2d(0.9240, 0.6480) is Brisbane, Australia, and the city with the west-most coordinate of vect2d(0.1560, 0.2390) is Seattle, United States.

Since the range of possible lats in radians goes from -pi/2 to +pi/2 (so pi total breadth), while the range of possible lons in radians goes from -pi to pi (so 2*pi in total breadth), while the XCOM scales (0.0, 1.0) in both directions, the scaling is probably not uniform.

Translating the above 3 cities lat/lon coordinates into XCOM x/y coordinates yields using y = (pi/2 - lat) / pi, and x = (pi + lon) / (2 * pi):

 

Basically you convert a city's GPS coordinates to radians (if it's north or east, it remains positive, if it's south or west, it must be negative), then you convert those numbers with the formulas above, and you have the X and Y coordinates for their proper location on XCOM 2's Geoscape.

Link to comment
Share on other sites

Whatever the code *WAS* designed with (the likely problem is that VSize estimate, btw) .. still introduces the geographic precision flaws we're all experiencing, Lad09 (RealityMachina).

 

So the only rational solution to such errors could be to have a direct "Stick to the currently selected exact location **AND** its pre-defined city string" rather than a re-setting principle based on relative distances within --that-- Region. Otherwise, we'll always get unreliable GuerillaOp models at the wrong spot(s).

As shown by those remmed // instructions, they probably had that feature in previous iterations of the code... then, the real dime&nickels question remains -- Why the hell discard that feature? Barring the "limit-to-region=none" conditional loop, i don't see what the advantage would be other than just creating a wild irrational effect.

 

For the coordinates, i used a different approach which produces very similar (and mostly the exact same) results.

 

1) Cities require two fields.. X(Long_WE) + Y(Lat_NS) coordinates

2) Roughly based on (DateLine=0/0 North-West of Alaska **TO** 1000/0 North-East of Siberia peninsula) while the Equator Line=0..1000/500

2) Decimals conversion formula: X == (180-W)/360..or..(E+180)/360 & Y == (90-N)/180..or..(S+90)/180

 

Soooo, no radians or Pi concerns here. Just straight up (pre-determined) Equi-Rectangular (of 2000x1000 pixels) accuracy & somehow, good enough precision.

 

To be clear, i just want the "random" function to stop scrambling our long list of cities (nearly 175 in yours, 201 in mine) and all of their properly intended locations for reality's sake.

 

Think of it this way... i supply a "Vostok Station" mission site in Antarctica (attached and defined as a New-Australia region in Oceania-South dependency, btw) or in "Svalbard" from Norway or in Nuuk/Greenland from Denmark (etc) -- for some wild storyline reasons... and the most effective way to transmit that gameplay feel is to have a correct traveling path taken by the Skyranger when deployed at those predictable spots & more! :wink:

 

Besides.. Toronto showing up in New-Brunswick (and a multitude of other awful stuff) isn't my idea of modern games worth the clutterbuck of enjoyable immersion.

Edited by Zyxpsilon
Link to comment
Share on other sites

Soooo.. i guess what i am trying to say is (sadly) this;

 

1) Doesn't really matter how many other new cities you & i add to this game.. IT will always scramble them wildly -- more so now than ever.

 

2) I just got the last immersion event of any given games -- the Truth Tower mission and the locations are always precisely defined.

 

Look at what i've got!

 

http://s31.postimg.org/a0cotyirv/Flaw_Ulaanbaatar_in_China.png

 

Middle of China near Beijing or further North-West in Mongolia's Capital -- you get to decide, buddy! :D

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...