Strategic Overhaul - Adjust Force Level by ADVENT strenght

Post Reply
Thrombozyt
Posts: 76
Joined: Tue Feb 14, 2017 10:37 am

Strategic Overhaul - Adjust Force Level by ADVENT strenght

Post by Thrombozyt »

I have been thinking quite some time about potential changes to the strategic layer to make the end game a more engaging experience. In theory, making the alien facilities (to remove pips) a tough combat mission instead of the current shinobi duo sneak mission and prolonging the infiltration times of story line missions would make it nearly impossible to win the race against the doom counter if you just ignore everything else. It should be the players responsibility to raise enough hell on the globe to sufficiently slow the doom counter to slowly progress.

Currently, that's hardly possible though. One reason for this is, that the number of squads that you can reasonably field is severely - you couldn't even attempt half the missions you'd need to do in order to further the ADVENT agenda. The limiting factors are usually both equipment and soldier experience. The opponent scale with the power level of your top 2 or 3 teams while you would need 7-10 teams running missions to a) allow for failure not to be catastrophic and b) to run enough missions to sufficiently slow the avatar progression.

Running missions with Cpl/Sgt soldiers and Laser/Mag/Predator gear against Muton Elites and Sectopods is simply a losing proposition. I would therefore in the first step, try to create a mod that scales the alien force level, so that there are regions, where you CAN run such missions. Where the squaddies and corporals earn their mettle maybe under the guidance of a veteran or two. It allows you to actually make use of those rookies that you start recruiting when you don't need them anymore.

The mod should take a the maximum strength value of all regions (or 10, which ever is lower) and assign the current force level to that region. Regions with strength 1 run at half the force level. The force level scales linearly (or maybe quadratic exponential?) from half force level (str 1) to full force level (str10 or max str - whichever is lower).

While I have edited a few lines of codes, I don't even have a clue where to begin writing a mod (language, files, implementation etc.), so I would greatly appreciate help.
chrisb
Pavonis Dev
Posts: 364
Joined: Mon Feb 27, 2017 8:43 pm

Re: Strategic Overhaul - Adjust Force Level by ADVENT strenght

Post by chrisb »

I think the biggest challenge of having there be much lower FL missions is that it makes it easy to 0% those missions with enough high level, fully geared guys that basically carry some lower levels. With no downtime on soldiers, it's basically free xp with little risk.

Not that it's a reason not to do it, just that it's something to think about in how low FL can go.

As for how to do it. I haven't written any mods myself, just read a lot of the LW code. You'd basically need to hook into the GetMissionForceLevelFn in each of the mission templates and override that, however that is done.
User avatar
johnnylump
Site Admin
Posts: 1261
Joined: Wed Nov 11, 2015 4:12 am

Re: Strategic Overhaul - Adjust Force Level by ADVENT strenght

Post by johnnylump »

We did code up functionality to have Force Levels vary by region, and iirc the reinforcements activity to transfer force level as well as the normal alert level. We ultimately didn't use it, but it's there.
Thrombozyt
Posts: 76
Joined: Tue Feb 14, 2017 10:37 am

Re: Strategic Overhaul - Adjust Force Level by ADVENT strenght

Post by Thrombozyt »

Thank you for the input! I'm not sure if I would go as far as to have the AI manage force levels on a per-region basis as that would be very complex very quickly and would require clear visibility for the player.

The flexible adjustment of force level was the first thing that I was interested in. Ideally, the complete mod would encompass a few more changes:
1) Force level adjustment for under-infiltrating. Set 0% at max-FL+4 and 100% at region specific FL and scale linearly. -> That should discourage 0% supply raids in any case.
2) Adjust how boosting infiltration works. When you boost for 10 intel, you basically get (32/28/24/20)h of infiltration for free. You can boost multiple times but each boost costs 10 intel more than the last (capped at 40 intel). So if you are prepared to throw enough intel at a mission, you can complete it. -> Intel becomes more of a resource and it slows the expansion.
3) Adding vigilance indicators - maybe requiring an intel investment to unlock. So in each region you'd have an indicator that reads something like "ADVENT in control" (str>vig), "ADVENT stretched thin" (str=vig +/-1) and "ADVENT calling for backup" (str<vig). In addition the global vigilance indicator would be automatically related to the global strength and give info like "AVATAR project progresses at maximum/full/increased/normal/diminished/limited/severely limited/a crippled speed". -> pointing the player towards his duty to keep ADVENT busy
4) The next part would be slightly more ambitious. I would raise the cost for gear significantly across the board, but allow for gear to be dropped as loot - maybe with massively increased chances for smash & grab and supply raid. That way, the X-Com operation becomes even more like a guerilla campaign in using the captured equipment for their own fighters. It would even add a bit more challenge and replay-ability as you never know, which gear you will have at which point. The engineering would be there to fill up the gaps instead of providing complete batches of weapons. -> Further incentivizes combat over pure stealth (you get weapons & armor!) and allows outfitting of a larger force with rather motley assembly of gear.

This would be the future outline of the mod - the end goal.
Thrombozyt
Posts: 76
Joined: Tue Feb 14, 2017 10:37 am

Re: Strategic Overhaul - Adjust Force Level by ADVENT strenght

Post by Thrombozyt »

However, a journey starts with the first step. I usually learn better from interacting with persons, so I was wondering if a mod maker would be around interested in helping a new guy. I'm currently working my way through xcom2 modding tutorials.
Thrombozyt
Posts: 76
Joined: Tue Feb 14, 2017 10:37 am

Re: Strategic Overhaul - Adjust Force Level by ADVENT strenght

Post by Thrombozyt »

So I went through the LW files and there are multiple questions:
1) I'm still uncertain that have found the correct place to hook in to modify the force level. It seems that I can either edit the force level when the tactical game is called OR in the alien spawn manager. Not sure which one to use.
2) I'm not exactly sure on how to retrieve the 'global strength' and region strength information.
3) I haven't found any mention of the infiltration variable. No class mentions inflitration or infiltrate. I haven't seen anything modifying the number of opponents in regards to the infiltration value.
chrisb
Pavonis Dev
Posts: 364
Joined: Mon Feb 27, 2017 8:43 pm

Re: Strategic Overhaul - Adjust Force Level by ADVENT strenght

Post by chrisb »

These are only some guesses based on my time reading the LW2 code. Someone who actually knows what they're talking about could clarify more specifically.
Thrombozyt wrote:So I went through the LW files and there are multiple questions:
1) I'm still uncertain that have found the correct place to hook in to modify the force level. It seems that I can either edit the force level when the tactical game is called OR in the alien spawn manager. Not sure which one to use.
2) I'm not exactly sure on how to retrieve the 'global strength' and region strength information.
3) I haven't found any mention of the infiltration variable. No class mentions inflitration or infiltrate. I haven't seen anything modifying the number of opponents in regards to the infiltration value.
1) The one place I know where this occurs specifically is in the mission template itself. There is a function that is assigned to the template that is called to retrieve the force level for that activity. It is called GetMissionForceLevelFn. Most activities use a default function called GetTypicalMissionForceLevel which simply looks up the region and returns the force level for that region plus any modifiers that the activity template itself has. For example Snare adds +1 force.

To change this I would guess that you would iterate through all the activities and change that function to one that you define, skipping any activity types that you don't want to change. The ones to skip would be Repression, Rendezvous, Foothold and Invasion, which all use custom FL function, or none in the case of Repression.

Something like the following might work? This would go in wherever the game/mod init function is.

Code: Select all

local X2LWAlienActivityTemplate Template;

foreach `XCOMHistory.IterateByClassType(class'X2LWAlienActivityTemplate', Template) {
  ActivityTemplate.GetMissionForceLevelFn = CustomForceLevel
}
Then add in your CustomForceLevel function and I would imagine that works, or something close to it.

2) Global strength can be queries from the activity manager. Regional strength can be queried from the RegionalAI attached to each Region.

Global Strength

Code: Select all

`LWACTIVITYMGR.GetGlobalAlert()
Region Strength

Code: Select all

RegionalAI = class'XComGameState_WorldRegion_LWStrategyAI'.static.GetRegionalAI(RegionState);
RegionalAI.LocalAlertLevel
3) Infiltration adds an alert modifier to the mission when it updates called AlertModifierAtInfiltration. If you look at the LWAlienActivityManager.Update function, you can see that it calls GetMissionAlertLevel(MissionSite) which takes into account regional alert, golden path difficulty, dark events and activity template modifiers. After that it queries the alertness modifier from the infiltrating squad which comes from the SquadManager.

Code: Select all

AlertLevel = GetMissionAlertLevel(MissionSite);

if (InfiltratingSquad != none && !MissionSite.GetMissionSource().bGoldenPath)
  AlertLevel += InfiltratingSquad.GetAlertnessModifierForCurrentInfiltration(); // this submits its own gamestate update
AlertLevel = Max(AlertLevel, 1);
I think you'd basically need to reproduce this in your FL function and it should get you the actual strength level.

Something along those lines should point you in the right direction, maybe someone who actually knows what they're talking about can point out anything wrong with this.
Post Reply