Jump to content

Storms over former XCOM members | Controlling abductions


Drakous79

Recommended Posts

Only entry I've found is in XComStrategyGame.upk, class XGGeoscape, function int DetectUFO(). Interesting, I see Overseer defined there or UFOs that completed a mission.

function int DetectUFO(XGShip_UFO kUFO)
{
...
   // End:0x10f
   if(class'XGTacticalGameCore'.default.ShowUFOsOnMission == 0 && kUFO.m_kObjective.GetType() == 5 || kUFO.m_kObjective.GetType() == 6)
   {
       return -1;
   }
...
}

enum EAlienObjective

5 = eObjective_Abduct

6 = eObjective_Terrorize

 

This can be tweaked to show only abductions for an example. Or just terror missions.

Link to comment
Share on other sites

  • Replies 99
  • Created
  • Last Reply

Top Posters In This Topic

Only entry I've found is in XComStrategyGame.upk, class XGGeoscape, function int DetectUFO(). Interesting, I see Overseer defined there or UFOs that completed a mission.

function int DetectUFO(XGShip_UFO kUFO)
{
...
   // End:0x10f
   if(class'XGTacticalGameCore'.default.ShowUFOsOnMission == 0 && kUFO.m_kObjective.GetType() == 5 || kUFO.m_kObjective.GetType() == 6)
   {
       return -1;
   }
...
}

enum EAlienObjective

5 = eObjective_Abduct

6 = eObjective_Terrorize

 

This can be tweaked to show only abductions for an example. Or just terror missions.

 

OK, I guess this tells us that the game indeed adds the abductor and terror ships regardless of ShowUFOsOnMission, but only shows them to the player if it's turned on.

 

So the trick is find the place where it builds the UFO queue and that objective causes a UFO #5 (large scout) and UFO #6 (abductor) to be added, and two battleships for a terror mission. And then, the destruction of the large scout canceling the abductor, too.

Link to comment
Share on other sites

Trying to trace the chain by which ufos are queued up and launched:

 

(number of * 's mark how deeply nested the function call is

 

Class XGStrategyAI:

Start of game month, MakeMonthlyPlan() calls AIAddNewObjectives()

 

AIAddNewObjectives

* May Add council mission

* May add terror mission;

** calls AddNewTerrorMission (var location);

*** calls AIAddNewObjective (#6, picks date and location)

**** Spawns a new objective, including a UFO parametner.

***** This looks like we jump to Class XGAlienObjective, function Init, which sets up some aspects of a new alien mission. There is some ship-related code in Init that may associate a ship with a mission, but I'm not sure.

* (Back to AIAddNewObjectives): Gets abduction count and possibly creates additional missions and UFOs.

* calls AddNewAbductions

** Calls AddAbductionObjectives

*** Calls AIAddNewObjective (#5, picks date and location), spawning new objective, including UFO parameter, jumps to XGAlienObjective again (like terrror)

* AIAddNewObjectives calls DetermineBestVisibleTargets -- this seems to figure out what countries will see UFOs, as it checks where satellites are (?)

* AIAddNewObjectives calls AddUFOs.

** AddUFOs creates UFOs via MakeUFO function, including abductors and battleships, but it only seems to care about the month, and it only assigns missions 1 and 2 (which I guess are scouting?). So this doesn't seem to be where we get our mission-related ships. Then it calls:

*** May call FillUFOPool () which calls AddUFOtoPool via MakeUFO again. Then calls ChooseUFO,

**** ChooseUFO Calls ChooseUFOMission

***** ChooseUFOMission seems to pick which UFOs will be landed which will be flying; this may have nothing to do with terror or abduction-mission UFOs.

***** Calls ChooseUFOMissionType. Seems to randomly pick a mission for UFOs, then checks if the UFO is a "good choice" for the mission, by calling IsGoodUFOMissionChoice.

****** IsgoodUFOMissionChoice calls one line of code that references varoab;e m_kLastUFO and returns a boolean, and I don't get how it works. MAYBE there's a table of constants somewhere that says what UFOs can go on what missions, and this ChooseUFOMissionType keeps calling this function until it's happy. I don't know how you would always get large scouts always preceding abductors if they both have the same mission number, though.

**** Back to ChooseUFO, which then calls AIAddNewObjective and sends a UFOtype as a parameter. It also sets m_kLastUFO.

* Back to AIAddNewObjectives (I guess the UFO pool is full). Calls AddNewOverssers, which does just that if the conditions are right.

 

That's it for monthly setup.

 

As time moves forward, something must call XGAlienOBjective function Update. This determines when missions are launched, with a timer countdown and "LaunchNextMission" function.

 

* LaunchNextMission calls LaunchUFO, with a ship# parameter. It looks like by now the game knows which UFO it is using for the launch.

 

No conclusions, just data at this point, in hopes someone can build off of it.

Link to comment
Share on other sites

Here's a list of UFO missions used in "AddUFOs":

 

enum EAlienObjective
{
eObjective_Recon,
eObjective_Scout,
eObjective_Harvest,
eObjective_Flyby,
eObjective_Hunt,
eObjective_Abduct,
eObjective_Terrorize,
eObjective_Infiltrate,
eObjective_MAX
};

Edited by BlackAlpha
Link to comment
Share on other sites

Here's a list of UFO missions used in "AddUFOs":

 

enum EAlienObjective
{
eObjective_Recon,
eObjective_Scout,
eObjective_Harvest,
eObjective_Flyby,
eObjective_Hunt,
eObjective_Abduct,
eObjective_Terrorize,
eObjective_Infiltrate,
eObjective_MAX
};

 

Thanks! Where is this stuff listed on UE? I don't know how to find it.

Edited by johnnylump
Link to comment
Share on other sites

Function AddUFOs links to:

 

function TUFO MakeUFO(XComGame.XGGameData.EShipType eUFO, XGStrategyActor.EAlienObjective eObj)

 

So it's in XGStrategyActor > enum EAlienObjective.

 

You can also search the text files for "enum" and then you'll find all of such lists.

 

Note that I always look at the text files so that I can search for stuff easier.

Edited by BlackAlpha
Link to comment
Share on other sites

Thanks ...

 

The main problem I think we're both after is not making it so easy to stop abductions in countries with satellites, right? Because shooting down a default large scout quickly becomes trivial.

 

One way is to buff large scouts, although the drawback is there isn't really any low-medium difficulty UFO to take its place, unless you nerf another one, and there just aren't that many choices. That means the interception game ramps up in difficulty very quickly.

 

Another is to send a more difficult class of ship as the prescursor mission to the abduction, but we haven't had any luck figuring out just how that mission is launched; nor have we figured out how the two battleships for terror missions are generated.

 

The third is to make the abduction mission template more like the terror mission. That is, if you shoot down the first battleship on that precedes a terror mission, the second still spawns and the mission goes forward. But that doesn't happen with abductions, for some reason; if we can set it so the shot-down large scout doesn't prevent the abductor from spawning, we're golden.

 

I've looked in XComStrategyGame class XGInterception function CompleteEngagement, which resolves interceptions. It refers to XGStrategyAI functions OnUFOShotDown, onUFODestroyed, and onUFOAttacked. From those you can ultimately get to class XGAlienObjective, functions NotifyOfCrash, NotifyOfAssaulted, NotifyOfSuccess, which may cancel a UFOs mission, but I'm not sure how it cancels that of *another* UFO.

 

Edit: Check out XGStrategyAI.BuildObjective and OnObjectiveEnded -- potentially clues in there.

 

I don't have a game with a working hyperwave detector at the moment; but perhaps it would be useful if we could generate a table of which UFO types we've seen on the various mission types above.

Edited by johnnylump
Link to comment
Share on other sites

Got it!

 

XGStrategyAI, function BuildObjectives.

 

This associates certain alien Objectives with UFOs.

 

function BuildObjectives()

{

BuildObjective(1, false);

AddUFOMission(1, 1, 4, 0, -1, 7);

BuildObjective(3, false);

AddUFOMission(3, 1, 4, 4, -1, 7);

BuildObjective(2, false);

AddUFOMission(2, 1, 4, 2, -1, 7);

BuildObjective(4, false);

AddUFOMission(4, 1, 5, 7, -1, 1);

BuildObjective(0, false);

AddUFOMission(0, 10, 4, 0, -1, 5);

BuildObjective(5, true);

AddUFOMission(5, 1, 5, 0, 500, 1);

AddUFOMission(5, 3, 6, 5, 0, 0);

BuildObjective(6, false);

AddUFOMission(6, 9, 8, 4, 100, 3);

AddUFOMission(6, 20, 8, 5, 0, 7);

BuildObjective(7, true);

AddUFOMission(7, 1, 9, 1, 100, 0);

AddUFOMission(7, 4, 9, 5, 0, 3);

}

 

BuildObjective parameters are objective# (EAlienObjective) and "abandonmission" boolean. I strongly suspect that the boolean determines whether killing the first ship on the mission prevents the second from launching. (Note #5, the abduction, is true, while #6 (terror), it's false.

 

AddUFOMission parameters are objective# (EAlienObjective), startdate, ufo type (what we're after!), ufomission (EUFOMission, which may govern UFO behavior on geoscape), "radius" and "randomdays".

 

So I think we can now send different types of ships on missions!

 

(I put specific code changes in longwar upk changes thread) -- Update -- the changes work.

Edited by johnnylump
Link to comment
Share on other sites

Got it!

 

XGStrategyAI, function BuildObjectives.

 

This associates certain alien Objectives with UFOs.

 

function BuildObjectives()

{

BuildObjective(1, false);

AddUFOMission(1, 1, 4, 0, -1, 7);

BuildObjective(3, false);

AddUFOMission(3, 1, 4, 4, -1, 7);

BuildObjective(2, false);

AddUFOMission(2, 1, 4, 2, -1, 7);

BuildObjective(4, false);

AddUFOMission(4, 1, 5, 7, -1, 1);

BuildObjective(0, false);

AddUFOMission(0, 10, 4, 0, -1, 5);

BuildObjective(5, true);

AddUFOMission(5, 1, 5, 0, 500, 1);

AddUFOMission(5, 3, 6, 5, 0, 0);

BuildObjective(6, false);

AddUFOMission(6, 9, 8, 4, 100, 3);

AddUFOMission(6, 20, 8, 5, 0, 7);

BuildObjective(7, true);

AddUFOMission(7, 1, 9, 1, 100, 0);

AddUFOMission(7, 4, 9, 5, 0, 3);

}

 

BuildObjective parameters are objective# (EAlienObjective) and "abandonmission" boolean. I strongly suspect that the boolean determines whether killing the first ship on the mission prevents the second from launching. (Note #5, the abduction, is true, while #6 (terror), it's false.

 

AddUFOMission parameters are objective# (EAlienObjective), startdate, ufo type (what we're after!), ufomission (EUFOMission, which may govern UFO behavior on geoscape), "radius" and "randomdays".

 

So I think we can now send different types of ships on missions!

 

(I put specific code changes in longwar upk changes thread) -- Update -- the changes work.

 

Thanks for finding that! I tested it as well and it works quite nicely! :thumbsup:

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.

×
×
  • Create New...