Questions about Mission Generation in LW2

For technical discussions and help
Post Reply
User avatar
Hobbes
Posts: 20
Joined: Fri Jan 27, 2017 5:21 pm

Questions about Mission Generation in LW2

Post by Hobbes »

I've been going through the LW_Overhaul.u and the config files to collect all the info about ADVENT Activities and missions for the wiki, or how the Strategic AI works. So far I've been able to figure out everything, with the exception of how LW2 when an activity is triggered for a specific region.

As an example, I currently have a game where a region has 3 activities active. When does the game runs the script for mission generation? Daily? Weekly? Is there a limit to the number of activities possible in a region? What functions are involved?

Thanks in advance
This alien aggression will not stand man!
User avatar
johnnylump
Site Admin
Posts: 1262
Joined: Wed Nov 11, 2015 4:12 am

Re: Questions about Mission Generation in LW2

Post by johnnylump »

Activity generation is daily. Detection is rolled every six hours.

There is no limit on activities in general in any region; that's determined on an activity-by-activity basis. For example, there are a set of activities of which only two can occur at a time in a region. The activities that comprise the liberation chain are set to occur in all regions, but only one at a time in each region.

The rules for generation are set in the activity templates, some of which call activity creation and activity condition classes that narrow down where they can occur. The general idea is that activities will occur anywhere and everywhere until you start putting restrictions on them.
User avatar
Hobbes
Posts: 20
Joined: Fri Jan 27, 2017 5:21 pm

Re: Questions about Mission Generation in LW2

Post by Hobbes »

Thanks, you pretty much confirmed what I already suspected but I was wondering if I had missed something.

By "activities will occur anywhere and everywhere until you start putting restrictions on them" you mean the player stopping them right? As in Liberation will prevent some activities taking place or sabotaging alien facilities.

The reason I'm asking is that from my empirical experience and from what I've been reading on the subreddit (which are both highly subjective, thus I wanted to look under the hood to see what was going on regarding missions generation), it seems that some activities like COIN Research are happening too often while others like Smash 'N Grab aren't appearing that much.
This alien aggression will not stand man!
User avatar
johnnylump
Site Admin
Posts: 1262
Joined: Wed Nov 11, 2015 4:12 am

Re: Questions about Mission Generation in LW2

Post by johnnylump »

Smash n' Grab is unfinished and turned off, so it shouldn't be occurring at all. There are some skeletons for it in 1.1, I think, but it won't work.

By "activities will occur anywhere and everywhere until you start putting restrictions on them" I mean the designer puts restrictions on them in the activity template. For example, COIN Research operates under the following code:

Code: Select all

Template.ActivityCreation = new class'X2LWActivityCreation';
	Template.ActivityCreation.Conditions.AddItem(default.TwoActivitiesInWorld);
	Template.ActivityCreation.Conditions.AddItem(default.SingleActivityInRegion);
	Template.ActivityCreation.Conditions.AddItem(new class'X2LWActivityCondition_AlertVigilance');
	
	RegionStatus = new class'X2LWActivityCondition_RegionStatus';
	RegionStatus.bAllowInContactedOrAdjacentToContacted=true;
	RegionStatus.bAllowInContacted=true;
	RegionStatus.bAllowInUncontacted=true;
	RegionStatus.bAllowInLiberated=false;
	RegionStatus.bAllowInAlien=true;
	Template.ActivityCreation.Conditions.AddItem(RegionStatus);

	ResearchFacility = new class'X2LWActivityCondition_ResearchFacility';
 	ResearchFacility.bAllowedAlienResearchFacilityInRegion = false;
	Template.ActivityCreation.Conditions.AddItem(ResearchFacility);

	RestrictedActivity = new class'X2LWActivityCondition_RestrictedActivity';
	RestrictedActivity.ActivityNames.AddItem(default.BuildResearchFacilityName);
	RestrictedActivity.ActivityNames.AddItem(default.COINOpsName);
	Template.ActivityCreation.Conditions.AddItem(RestrictedActivity);

	MonthRestriction = new class'X2LWActivityCondition_Month';
	MonthRestriction.UseDarkEventDifficultyTable = true;
	Template.ActivityCreation.Conditions.AddItem(MonthRestriction);
You'll need to look at the individual classes to interpret some of those settings.
User avatar
Hobbes
Posts: 20
Joined: Fri Jan 27, 2017 5:21 pm

Re: Questions about Mission Generation in LW2

Post by Hobbes »

johnnylump wrote:Smash n' Grab is unfinished and turned off, so it shouldn't be occurring at all. There are some skeletons for it in 1.1, I think, but it won't work.

By "activities will occur anywhere and everywhere until you start putting restrictions on them" I mean the designer puts restrictions on them in the activity template.

Gotcha, thanks for the explanation. I had a look at Smash N' Grab using the developer's menu/console and it seemed to work but some things were unfinished, wasn't sure if it was working or not. Since I've been having a rough time getting Supplies/etc. to build the stuff I need, the mission seemed interesting.
This alien aggression will not stand man!
Post Reply