aliens

Author Topic: Configurable AlienBaseDetection chance  (Read 325 times)

Offline murkhach@centrum.cz

  • Captain
  • ***
  • Posts: 62
    • View Profile
Configurable AlienBaseDetection chance
« on: April 22, 2025, 03:42:39 pm »
In vanilla game there is hard-coded feature
  If alien had bases and player did not detected any of them,
  than at the beginning of each month  there is small chance (20%)
  that it will be discovered.

I'm working on some improvement for TWOTS mod for TFTD ..
 To find a base you have to do some research and build special subs and find by them a base ...

And hardcoded random feature is quite pain.
Either in vanilla game the players would have much greater joy when will discover alien bases by themselves.

[I tried  download and compile mod but failed to handle all dependencies, however I managed to find how to add desired changes ]

However  i suppose following modifications in OXCE should do the job:

Engine/mod.h
      int _crewEmergencyEvacuationSurvivalChance, _pilotsEmergencyEvacuationSurvivalChance;
   bool _showUfoPreviewInBaseDefense;                                             
         bool _firstAlienBaseDiscover;// INS LINE 260

        /// Should UFO preview be shown in base defense UI?
        bool showUfoPreviewInBaseDefense() const { return _showUfoPreviewInBaseDefense; }
       /// Should Agents try to Discover first Alien base each month (20 % chance) ?  // INS LINE 944
       bool firstAlienBaseDiscover() const { return _firstAlienBaseDiscover; }        // INS LINE 945


Engine/mod.cpp
       _showUfoPreviewInBaseDefense(false),
      _firstAlienBaseDiscover(true),                       // INS line at 440
      _soldiersPerRank({-1, -1, 5, 11, 23, 30}),
   
        reader.tryRead("showUfoPreviewInBaseDefense", _showUfoPreviewInBaseDefense);
        reader.tryRead("firstAlienBaseDiscover", _firstAlienBaseDiscover);             // INS LINE 3260
       reader.tryRead("soldiersPerSergeant", _soldiersPerRank[RANK_SERGEANT]);

Geoscape/GeoscapeState.cpp
        // Handle Xcom Operatives discovering bases
       if (!_game->getSavedGame()->getAlienBases()->empty() && _game->getMod()->firstAlienBaseDiscover() && RNG::percent(20)) // UPD line 2902
« Last Edit: April 22, 2025, 09:48:28 pm by murkhach@centrum.cz »

Offline murkhach@centrum.cz

  • Captain
  • ***
  • Posts: 62
    • View Profile
Re: Configurable AlienBaseDetection chance
« Reply #1 on: April 22, 2025, 10:10:27 pm »
HI,
I considered  my suggestion rather like option for override "strange hidden fixed feature"  than something new.
I believed that posting code changes would save programming time and be considered as reasonable.

Thank you for the work on this awesome project.