Jump to content
⚠ Known Issue: Media on User Profiles ×

Storms over former XCOM members | Controlling abductions


Drakous79

Recommended Posts

Storms over former XCOM members

Everyone knows storms over countries, who left XCOM project and sided with aliens. They can be small, medium or large (depending on a size of the country), sometimes covering a lot of Geoscape. I will show, how to decrease size of storms and how to turn them off completely. Changes take effect after new leaves.

http://i.imgur.com/Ka7vN.jpg

 

Storms entities are set in XComstrategyGame.upk, class XGCountry in relation to country size.

function XGStrategyActor.EEntityGraphic GetStormEntity()
{
    switch(m_kTCountry.iEnum)
    {
        case 0:
        case 15:
        case 8:
        case 2:
        case 1:
        case 19:
        case 7:
            return 21;
            break;
        case 21:
        case 20:
        case 18:
        case 22:
        case 25:
            return 22;
            break;
        default:
            return 23;
     }
}

// 21 = Large Storm (15 in hex)
// 22 = Medium Storm (16 in hex)
// 23 = Small Storm (17 in hex)

In byte code it is (order is large / medium / small):
0A 4D 00 2C 07 04 24 15 06 6F 00 0A 52 00 2C 15 0A 57 00 2C 14 0A 5C 00 2C 12 0A 61 00 2C 16 0A 6C 00 2C 19 04 24 16 06 6F 00 0A FF FF 04 24 17

 

XCOM EU Patch 5, Patch 6 - 0A 4D 00 2C 07 04 24 15 06 6F 00 0A 52 00 2C 15 0A 57 00 2C 14 0A 5C 00 2C 12 0A 61 00 2C 16 0A 6C 00 2C 19 04 24 16 06 6F 00 0A FF FF 04 24 17

It is just a matter of replacing numbers to desired storm size. Large to medium = 21 to 22 (is what I prefer). All to small = 21 and 22 to 23. To turn storms completely off, provide number higher than 23, like 99 :smile:

//Only Small and Medium Storms, Large Storms will be replaced with Medium Storms
04 24 15 replaced with 04 24 16

//Only Small Storms
04 24 15, 04 24 16, 04 24 17 replaced with 04 24 17

// No Storms - using 99 (63 in hex) as nonexistent entity
04 24 15, 04 24 16, 04 24 17 replaced with 04 24 63

This WISIWIG editor is crazy...

 

 

In XCOM EW, entities were shifted by +2.

// 23 = Large Storm (17 in hex)
// 24 = Medium Storm (18 in hex)
// 25 = Small Storm (19 in hex)

XCOM EW vanilla, Patch 1 - 0A 4D 00 2C 07 04 24 17 06 6F 00 0A 52 00 2C 15 0A 57 00 2C 14 0A 5C 00 2C 12 0A 61 00 2C 16 0A 6C 00 2C 19 04 24 18 06 6F 00 0A FF FF 04 24 19

Edited by Drakous79
Link to comment
Share on other sites

  • Replies 99
  • Created
  • Last Reply

Top Posters In This Topic

Controlling abductions

Abductions can be a pain, because they come with a lot of panic. Default number of abduction sites, we have to choose from, is 3. With the Second Wave it is 4. Number of abduction sites can be lowered in two ways:


  • by shooting down UFOs preparing the abduction. This requires ShowUFOsOnMission=1 in DefaultGameCore.
    Plenty of information regarding UFOs can be found in ShowUFOsOnMission and other UFO variables thread.
  • with UPK surgery.

In XComGameStrategy.upk, class XGStrategyAI is GetNumAbductionSites() function, where is what we need defined.

function int GetNumAbductionSites()
{
    // End:0x33
    if(IsOptionEnabled(11))
    {
        return int(class'XGTacticalGameCore'.default.SW_ABDUCTION_SITES);
    }
    // End:0x36
    else
    {
        return 3;
    }
}

In byte code it is 04 38 44 12 20 6D FE FF FF 09 00 EF FD FF FF 00 02 EF FD FF FF 06 36 00 04 2C 03

The code changed a bit for EU Patch 5 and EW, because SW_ABDUCTION_SITES is no longer part of the 2nd wave .

function int GetNumAbductionSites()
{
    return 3;
}

XCOM EU Patch 5, Patch 6 - 4B 42 00 00 AB 1F 00 00 00 00 00 00 4A 42 00 00 00 00 00 00 00 00 00 00 4B 42 00 00 00 00 00 00 9F 01 00 00 26 2E 00 00 0E 00 00 00 0A 00 00 00 04 2C 03

XCOM EW vanilla, Patch 1 - B2 4F 00 00 94 25 00 00 00 00 00 00 B1 4F 00 00 00 00 00 00 00 00 00 00 B2 4F 00 00 00 00 00 00 A7 01 00 00 79 2F 00 00 0E 00 00 00 0A 00 00 00 04 2C 03

  • To lower number of abduction sites, change 03 to 02 or 01.
  • To turn abductions completely off, change 03 to 00 (tested - 2 months without abductions).
  • The number can be increased as well, but user interface is not dynamic in height and new buttons are not shown. Interface's max is 3.

 

http://i.imgur.com/eUDpy.jpg

 

 

The problem - user interface not being dynamic
In fact I've tried increasing the number of abductions sites to 4 by UPK surgery and with SW_ABDUCTION_SITES, but I got three buttons at maximum.

The problem as I see it is, you cannot choose the fourth abduction site, but still the panic is increased in other 3 countries, meaning the player is out of control!

http://i.imgur.com/mCoxk.jpg

We should increase the number of buttons in XComStrategyGame.upk, class UIMissionControl_AbductionSelection according to the number we set in GetNumAbductionSites(), in this case 4.


function OnInit()
{
...
    if(I < 3)
...
}

In bytecode it is 07 30 00 81 19 01 40 FB FF FF 0B 00 97 FF FF FF 00 1C 68 FD FF FF 4A 16 16 0F 01 88 0D 00 00 25 0F 00 90 0D 00 00 25 07 97 02 96 00 90 0D 00 00 2C 03

 

XCOM EU Patch 5, Patch 6 - 07 30 00 81 19 01 42 FB FF FF 0B 00 97 FF FF FF 00 1C 69 FD FF FF 4A 16 16 0F 01 88 0D 00 00 25 0F 00 90 0D 00 00 25 07 97 02 96 00 90 0D 00 00 2C 03
XCOM EW vanilla, Patch 1 - 0F 01 01 10 00 00 35 2F 10 00 00 3B 10 00 00 00 00 19 1B 71 12 00 00 00 00 00 00 4A 16 09 00 46 45 00 00 00 01 46 45 00 00 0F 00 09 10 00 00 25 07 A4 02 96 00 09 10 00 00 2C 03

 

Replace 03 with 04 at the end.

Basically we told the function to add the fourth button. But the UI remains static, so a keyboard have to be used in order to choose the fourth country (arrows, s, d). On the image bellow is the fourth country France.

http://i.imgur.com/h8ji8.jpg

 

Well, at least the control is not lost, but not being able to adjust UI menu height is sad.


The Second Wave (does not apply to XCOM EU Patch 5 and higher, XCOM EW)
As UI isn't cooperating with the Second Wave, I've decided to use SW_ABDUCTION_SITES setting in DefaultGameCore for my own purpose, changing GetNumAbductionSites() function to this:

function int GetNumAbductionSites()
{
    // End:0x15
    if(IsOptionEnabled(11))
    {
        return 4;
    }
    // End:0x36
    else
    {
        return int(class'XGTacticalGameCore'.default.SW_ABDUCTION_SITES);
    }
}
SF: 07 33 00 1B A5 14 00 00 00 00 00 00 24 0B 16 04 38 44 12 20 6D FE FF FF 09 00 EF FD FF FF 00 02 EF FD FF FF 06 36 00 04 2C 03
RW: 07 15 00 1B A5 14 00 00 00 00 00 00 24 0B 16 04 2C 04 06 36 00 04 38 44 12 20 6D FE FF FF 09 00 EF FD FF FF 00 02 EF FD FF FF

What it does is, that SW_ABDUCTION_SITES setting is used for normal play even with the Second Wave disabled :smile:


And finaly how to get abductions in countries with satellite coverage
By default the game does not allow abductions in countries with satellite coverage, so we are not seeing abductions anymore after having complete satellite network.

This behaviour can be changed in XComStrategyGame.upk, class XGStrategyAi, function DetermineBestAbductionTargets() by jumping from End:0xc0 to End:0xd9. I'm reposting this for purpose to have relevant info together.

if(kCountry.LeftXCom())
{
}
// End:0xef
else
{
        // End:0xc0
        if(kCountry.HasSatelliteCoverage())
        {
        }
        // End:0xef
        else
        {
                // End:0xd9
                if(IsTerrorTarget(eTargetCountry))
                {
                }
                // End:0xef
                else
                {
                        arrPossibleCountries.AddItem(eTargetCountry);
                }
        }
}
if(kCountry.LeftXCom())
{
}
// End:0xef
else
{
        // This is an implied JumpToken;
        goto J0xc0;
        kCountry.HasSatelliteCoverage();
        // This is an implied JumpToken;
        goto J0xef;
        J0xc0:
        // End:0xd9
        if(IsTerrorTarget(eTargetCountry))
        {
        }
        // End:0xef
        else
        {
                arrPossibleCountries.AddItem(eTargetCountry);
        }
}

In byte code it is 07 9B 00 19 00 83 43 00 00 0A 00 41 24 00 00 00 1B B4 16 00 00 00 00 00 00 16 06 EF 00 07 C0 00 19 00 83 43 00 00 0A 00 74 24 00 00 00 1B 24 11 00 00 00 00 00 00 16 06 EF.

 

XCOM EU Patch 5, Patch 6 - 07 C0 00 19 00 88 43 00 00 0A 00 76 24 00 00 00 1B 24 11 00 00 00 00 00 00 16
XCOM EW vanilla, Patch 1 - 07 C0 00 19 00 13 51 00 00 0A 00 41 2B 00 00 00 1B 33 14 00 00 00 00 00 00 16

 

Change 07 to 06, so it would be 06 C0 00 ...

After doing the change I got abduction mission with full satellite coverage on 25th December 2015 (The game is in a state I am ready to assault mother ship).


Conclusion
Hope this post helps modders, who need to control abductions in some way. Hopefully we would get more dynamic UI one day, so the menu does not crop additional buttons.

Edited by Drakous79
Link to comment
Share on other sites

This is great work.

 

When you have abduction UFOs set to appear (ShowUFOsOnMission=1) and you have abductions continuing in a country despite satellite coverage, do you see the abduction UFO *in* the country where the abduction will take place?

 

You'll recall we may have established that abduction UFOs appear over a random country a few days before the pick-your-country abduction event takes place.

Link to comment
Share on other sites

Thank you guys!

 

When you have abduction UFOs set to appear (ShowUFOsOnMission=1) and you have abductions continuing in a country despite satellite coverage, do you see the abduction UFO *in* the country where the abduction will take place?

Yes I do see them. They spawn above target country. And it is kind of crazy, because they come in 2 waves.

 

Maybe we can see them with SUoM=1 and without satellite coverage, because they spawn in range of another satellite. Like Europe - France, Germany, UK.

 

Testing was done in a game, where I'm about to enter mother ship. Number of abduction sites = 3, ShowUFOsOnMission = 1. Every battleship going after satellite network was shot down. Also the Supply Barge was successfully intercepted. Rest was ignored. Council Report - Grade F!

 

UFO-13 | 09. 12. | Supply Barge - Scout Target

UFO-14 | 12. 12. | Battleship -
Terrorize Populace, Russia

UFO-15 | 18. 12. | Large Scout -
Abduct Specimen, Argentina

UFO-16 | 19. 12. | Large Scout -
Abduct Specimen, Germany

UFO-18 | 19. 12. | Large Scout -
Abduct Specimen, Nigeria

UFO-17 | 19. 12. | Battleship -
Destroy Satellite

UFO-19 | 21. 12. | Abductor -
Abduct Specimen, Germany

UFO-20 | 21. 12. | Abductor -
Abduct Specimen, Argentina

UFO-21 | 21. 12. | Abductor -
Abduct Specimen, Nigeria

_________
21. 12. | ABDUCTION - Nigeria, Germany and Argentina

UFO-22 | 21. 12. | Battleship -
Destroy Satellite

_________ 22. 12. | COUNCIL -
Bomb disposal

UFO-23 | 23. 12. | Battleship -
Destroy Satellite

UFO-24 | 25. 12. | Battleship -
Destroy Satellite

UFO-25 | 26. 12. | Battleship -
Terrorize Populace, Russia

_________
27. 12. | TERROR -
Saint Petersburg, Russia

As you see, I've got 3 large scouts, 3 abductors and just 1 abduction mission. And 2 battleships and just 1 terror mission.

 

  • 3 large scouts ignored ... 3 abductors ignored ... 3 abduction sites.
  • 2 of 3 large scouts shot down ... only 1 spawned abductor ignored ... 1 abduction site!
    Got only one abductor after shooting down two large scouts so they are connected! That's crazy.
  • 3 large scouts ignored ... 2 abductors ignored and 1 abductor shot down ... 2 abduction sites.
    Strange is that abduction mission did not happen once, after toasting one of abductors.
  • 3 large scouts shot down ... no abductors ... no abduction sites.

  • The 1st terror battleship ignored ... the 2nd terror battleship ignored ... 1 terror mission after the 2nd TB.
  • The 1st terror battleship shot down ... the 2nd terror battleship ignored, but came sooner, between 15. - 18. 12. ... 1 terror mission after the 2nd TB.
  • The 1st terror battleship ignored ... the 2nd terror battleship shot down ... no terror mission!
    Well, then what is the first battleship good for? Carrying more crew for later terror mission? I think I'll try to count aliens in St. Petersburg...
    Edit: Ok, I counted it, 10 units in every case.

Result: 1 UFO, 1 terror, 1 council and 1 abduction mission. Okay, that's correct for default mission assignments.

 

What puzzles me is that I am missing one late mission. I should get 1 more UFO or 1 more abduction mission. My LATE_UFO_CHANCE=50 so the roll for it had to fail, but then I would get 1 additional abduction (terror and council missions already in mission que ... function AddLateMission()). All countries are still XCOM members, so there should be enough abduction targets. Is the 1st terror battleship LATE_UFO?. Edit: No, it isn't. Tested with ShowUFOsOnMission = 0 and it didn't appear.

 

Eh, seems like I got too far for answering the question :) Going to repair my Firestorm fleet... :)

 

 

How about turning this into an XCMM mod so people can install it! This is pretty cool work!

It would be lovely, but I feel such mod requires an option for a user to change the values (you know, the dynamic feature). Atm I will be happy, if people use the knowledge to help them balance panic in their mods :)

 

Could you specify, what to include in the mod?

Edited by Drakous79
Link to comment
Share on other sites

Great work!

 

Thinking about the implications:

 

With large scouts extremely easy to shoot down, it seems like the presence of a satellite over a country would generally have the same effect as before -- no abduction would take place. But you'd at least have to work for it. (I'm also taking down Abductors with 3 interceptors with Phoenix cannons, but sometimes the Abductor manages to escape.)

 

OTOH, it might mean less abduction missions overall. The next question is, if you have partial satellite coverage, do the aliens prefer to pick countries without satellites, or is it entirely random? You might end up with a zillion crashed large scout missions, and miss a lot of the abduction maps over the course of a game

 

It's too bad they don't have another UFO type, a fighter type that beats up your interceptors and firestorms, that blows up when it crashes and can't be assaulted. (And, for that matter, something between the large scout and abductor classes in size)

 

You'd also need to adjust panic from UFOs and alloys and elerium from crashed UFOs, which are in DFC.ini. Perhaps one way to ensure abductions still happen is to increase repair times for interceptors and firestorms, so the player either runs out of interception capability, or has to pay to replace an interceptor. Just a thought.

Link to comment
Share on other sites

So, in an attempt to make the game a bit more like the original, where XCOM was capable of addressing every single threat if they had the manpower and weapons, I've changed the simultaneous abductions from three to one, and, to balance things a bit, also enabled abductions over satellite-covered nations, and, again for balance, tweaked alloy/elerium values for UFOs across the board. Now what I'd like to do is make the aliens do more missions each month, that way XCOM isn't just doing their one mission and not losing anything for it. Alternatively, I could make panic penalties more harsh, but I'd prefer more missions. Any idea how to do that?
Link to comment
Share on other sites

Sorry for another wall of text ... it just happened.

 

If I understand the code correctly, the game makes a plan for the next month by calling function AIAddNewObjectives() on pay day. The function sets how many abduction / terror / council missions and flying UFOs do we get next month. By default it is 1 terror / 1 council / 1 abduction misson and 1 UFO. Additions and adjustments to the default are set by few rules:

  • There is no terror mission in the first month (This has confusing code. I would swear it would happen).
  • Until looting Hyperwave Beacon, we get 1 more abduction mission and in the first three months 1 UFO (if EARLY_UFO_CHANCE roll successfull).
  • After looting the beacon, we also get Late Mission adding 1 UFO (if LATE_UFO_CHANCE roll successfull). If LATE_UFO_CHANCE roll fails, function AddLateMission() tries to randomly select from terror / council / abduction mission, if they aren't planned or haven't happened, but in case of abduction, there have to be more than 3 abduction targets available (and there should be enough with jumping over satellites conditional earlier).

But if we're always getting terror and council missions by default, Late Mission would add either LATE_UFO or additional abduction mission right? I can't find a situation, when AddLateMission() would be adding terror or council mission, so it may be a good place for some code improvement.

 

Anyway, AIAddNewObjectives() calls AddNewAbductions() function, which creates array of abduction targets by calling DetermineBestAbductionTargets(). DetermineBestAbductionTargets() checks an array of 36 countries and selects countries, who are Council members still participating in XCOM project, have no satellite (conditional we jump over) and are not a target of terror mission.

 

Function AddNewAbductions() also takes care about creating Abduction Blitz. In the end is a loop calling AddAbductionObjectives() function, which chooses cities for the abduction by passing number of cities with the array of abduction targets into PickAbductionTargets() function and then assigns objectives via AIAddNewObjective() into Linked Objectives Array.

 

Function PickAbductionTargets() fires a loop, which filters (FilterCountries()) the array of abduction targets and randomly chooses one city of randomly chosen country. Next the function returns array of target cities.

 

I'm missing what the filter does. It checks Avoid array defined in PickAbductionTargets() as arrContinents = arrContinents. I would understand it filtering out countries on a continent to avoid, but where is defined, what continent should be avoided and why? Can anybody check it please? The array seems empty.

 

 

With large scouts extremely easy to shoot down, it seems like the presence of a satellite over a country would generally have the same effect as before -- no abduction would take place. But you'd at least have to work for it. (I'm also taking down Abductors with 3 interceptors with Phoenix cannons, but sometimes the Abductor manages to escape.)

You are right about the work. It's fine to decide - let it happen and face battleships, let it happen and control number of sites or shoot all crafts responsible for it.

 

In unmoded game, the satellite over a country restricts the abduction from happening there. Jumping the conditional removes the restriction, so we get enough locations and if ShowUFOsOnMission = 0, the abduction should always happen.

 

With ShowUFOsOnMission = 1 is the effect different, because we get +3 or +6 UFOs to take care of and the decision.

 

I think you could use more armor on interceptors for such unequal fight.

 

 

OTOH, it might mean less abduction missions overall. The next question is, if you have partial satellite coverage, do the aliens prefer to pick countries without satellites, or is it entirely random? You might end up with a zillion crashed large scout missions, and miss a lot of the abduction maps over the course of a game.

Yes it is random. All countries are in the same array of targets, with or without satellite conditional jump.

 

Also hard to balance, because it is up to the player's decision, if the abduction happens.

 

I am working on something, that will add more decisions to air combat so you can expect more mess all around :)

 

 

It's too bad they don't have another UFO type, a fighter type that beats up your interceptors and firestorms, that blows up when it crashes and can't be assaulted. (And, for that matter, something between the large scout and abductor classes in size)

 

You'd also need to adjust panic from UFOs and alloys and elerium from crashed UFOs, which are in DFC.ini. Perhaps one way to ensure abductions still happen is to increase repair times for interceptors and firestorms, so the player either runs out of interception capability, or has to pay to replace an interceptor. Just a thought.

UFO interceptor would be sweet - shooting down Skyranger! That would really piss me :)

 

Good thought about resources and interceptors. Would be better, if the game sent either 3 Large Scouts or 3 Abductors depending on player's technology advancements, because 3 small and 3 big crafts at once throws in a lot of unbalance. Maybe someone could look into it.

 

 

Now what I'd like to do is make the aliens do more missions each month, that way XCOM isn't just doing their one mission and not losing anything for it. Alternatively, I could make panic penalties more harsh, but I'd prefer more missions. Any idea how to do that?

Aye. But there are some obstacles in the way. I'll make new post tomorrow to break the wall. I've tested 10 abductions missions per month each with 1 abduction site and it was very cool. If there's an abduction on geoscape and another pops up too soon, they actually stack to linked objective and the player have to choose like in vanilla!

Edited by Drakous79
Link to comment
Share on other sites

I included the "abductions in countries with satellites" part in the new Warspace version. :)

 

Something I noticed is that:

 

- When you get enough satellites, the abduction system will go into a new mode where abductions sometimes don't happen for a while. You can go for a month or two without abductions.

 

- A UFO on an abduction mission will increase the panic if you don't shoot it down. And afterwards you get the usual abduction mission with its penalties. So you get two panic penalties in such a case.

 

 

By the way, did anyone figure out how to decrease the scout UFO spam that you get when you put a satellite in most countries?

Edited by BlackAlpha
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.

×
×
  • Create New...