aliens

Author Topic: Mission site detection  (Read 1124 times)

Offline Juku121

  • Commander
  • *****
  • Posts: 1798
  • We're all mad here.
    • View Profile
Mission site detection
« on: March 04, 2024, 08:45:05 pm »
Not sure it's actually an OXCE question, but what governs the detection of 'fake terror' mission sites that are used extensively in many mods to create static mission sites?

The question is inspired by this post and three preceding ones.

Online CrazedHarpooner

  • Colonel
  • ****
  • Posts: 101
    • View Profile
Re: Mission site detection
« Reply #1 on: March 05, 2024, 01:34:30 pm »
These are the things I've come to understand from the rulesets:
- Terror sites ('fakes' or 'proper') are all defined as objective: 3 in alienMissions
- Terror sites can be generated with a standard wave of ufos. This is how UFO does it for its terror missions and TFTD for its port terror sites
- Terror sites can be generated with a dummy ufo wave. This dummy ufo appears already landed and thus instantly generates the site. TFTD uses this for naval terror (Cargo and Cruise)
- Terror sites can be generated with a wave definition that points directly to the site deployment not even a dummy UFO. TFTD uses this for its artifact sites. This is also the method the mod in question uses for most of terror sites, including the zombie hive.

They key difference that I believe comes into play with what's happening in the other post is the use of startDelay and randomDelay in the mod. TFTD has no delay whatsoever in its generation, neither in the missions scripts not in the alien missions ruleset files but X-com Files does as well as probably all the others. I theorize that the engine is generating the mission at the very start of the month and 'placing' it on the globe merely delaying its visibility and notification by the delays configured. Once the delay is over, then the marker will be revealed and the corresponding alert will be shown. Alternatively, it could be that the site is not spawned until startDelay, 30 mins past midnight of the 1st day of the month as per configured, spawns it then, but is not revealed until the period of randomDelay is over.

If I'm correct in this I wonder what happens if you attempt to reach the site before it is revealed, do you get the mission generation as per usual? Does it result in a crash? Does the craft just hover at destination like a waypoint as the site is not revealed yet?

Offline Juku121

  • Commander
  • *****
  • Posts: 1798
  • We're all mad here.
    • View Profile
Re: Mission site detection
« Reply #2 on: March 05, 2024, 06:44:53 pm »
I don't think randomDelay is behind this (like 99% sure). First, it'd make no sense to implement it like that instead of just randomly extending startDelay as a value. Second, I took a look and of all the saves I have, mine or others', only the one referenced in my first post and a quick battle save (which is in BattleScape and fakes the mission site anyway) had 'detected: false'. My experience has also been that missions go straight from alienMissions to missionSites in the save, and it's the former that have starting times and are 'placed' at the beginning of the month, and the latter that can be 'undetected'.

Using the same save from the XCF discussion, you can proceed to the site normally and even start the mission while it's 'undetected'. Looks a bit weird when there's no destination marker on the globe, but that's all. Check it out yourself if you wish, a test save is attached.

So, IDK what's going on here and how much of it is intended. It's probably mostly OXC code and not OXCE, though.

Online CrazedHarpooner

  • Colonel
  • ****
  • Posts: 101
    • View Profile
Re: Mission site detection
« Reply #3 on: March 07, 2024, 11:54:57 pm »
Ok, so I decided to track a site generation. For my example I was playing TWoTS.

At the beginning of the month I made a save and looked up in the savefile what was scheduled. As expected there were the scheduled 'alienMissions' and no 'missionSites'. I tracked the value the mission with the lowest 'spawnCountdown'. Proceeded to track up to the day the mission should spawn and all 'alienMissions' were still there with no 'missionSites'. Kept making saves as the time got closer and nothing changed other than the 'spawnCountdown' until I passed it. I made another save and there it was, a 'missionSite' flagged as 'detected: false'. I had to wait until the next hour for the notification to pop up and the detection flag to change.

My conclusion from this singular test, probably should do more, is that missionSites are spawned as 'undetected' and when the game reaches the next o'clock hour it checks if there's any undetected site to notify the player and change the flag. So what happend in that other post was an extreme combination of luck and timing. How likely is it that someone clicks on any spot of the globe and find something happening before the next o'clock check reveals it?

Offline Juku121

  • Commander
  • *****
  • Posts: 1798
  • We're all mad here.
    • View Profile
Re: Mission site detection
« Reply #4 on: March 08, 2024, 09:01:25 am »
Took a look at the code.

Apparently, this is some sort of "only one 'site detected' popup per hour" hack. Sauce.

It seems (but not 100% sure) that UFO-spawned sites, including 'dummy' UFOs, don't have this limitation ('cause you can probably see the UFO vanish at the mission point, and might get curious about what's going on there). Sauce.


I suppose the moral of the story is that if you don't want invisible mission sites around, use 'dummy' UFOs?