long-war-2 / lwotc

Port of Long War 2 to XCOM 2's War of the Chosen expansion
345 stars 91 forks source link

Spawned mission icons clump together #15

Open pledbrook opened 5 years ago

pledbrook commented 5 years ago

All the missions seem to spawn in a very small circle within a region, leading to annoying overlap. Check both XCGS_LWAlienActivity and the XComGame XCGS_WorldRegion.GetRandomLocationInRegion() method. The latter should ensure that the location isn't close to existing entities, but that seems to be breaking down for some reason.

pledbrook commented 5 years ago

I think the big problems with the logic in XComGameState_WorldRegion for selecting a random location are:

I don't think there's anything we can do about the second one, if there is indeed a problem there. The first could be finagled in X2WOTCCommunityHighlander if people wanted that. I don't know what you get from comparing the random location against the region it's in.

The last issue could perhaps be fixed in X2WOTCCommunityHighlander by comparing locations to Geoscape entities in any pending game state, not just submitted ones.

A "dirty" fix that will potentially allow better distribution is to reduce the minimum desired distance between entities from its current value of 0.02. This should allow more spawns close to the centre of the region.