Author Topic: Upcoming mission changes  (Read 42048 times)

Offline Falko

  • Commander
  • *****
  • Posts: 802
    • View Profile
Re: Upcoming mission changes
« Reply #15 on: March 03, 2015, 12:23:29 am »
if there is no city entry anymore
we need something like this
Code: [Select]
- [3.125, 3.125, -6.5, -6.5, -1, STR_LAGOS, 3](3 - default zoomvalue) right?

Offline HotIceHilda

  • Sergeant
  • **
  • Posts: 30
    • View Profile
Re: Upcoming mission changes
« Reply #16 on: March 03, 2015, 03:27:19 am »
While this is great news since there is so many new features that mods can benefit from, the major problem is getting the people making the mod use to the new rules. Better hold onto your butts and hope you know how to overhaul your mods for the upcoming changes.

To think there was so a good handful of upcoming mods underdevelopment before this announcement was made. Those mods better keep trucking.

Offline kikimoristan

  • Commander
  • *****
  • Posts: 647
    • View Profile
Re: Upcoming mission changes
« Reply #17 on: March 03, 2015, 04:22:27 am »
nah is for the better. hobbes will have toughest time and he already has his rulset prepared haha cause he knew ahead of time of the changes . so....everyone else's mod is mostly units, maps and weapons and graphic stuff . nobody really changes the cities that much. maybe piratez or MiB might need it . no big deal tho.

having custom terror missions is awesome.

Offline Dioxine

  • Commander
  • *****
  • Posts: 5455
  • punk not dead
    • View Profile
    • Nocturnal Productions
Re: Upcoming mission changes
« Reply #18 on: March 03, 2015, 05:24:51 am »
No worries for the mods, I was waiting for this update for a looong time and it seems to be actually even better than I hoped for :) Still, the first nightlies after this change are likely to be error-prone, so I'll introduce the changes gradually :)

Offline hellrazor

  • Commander
  • *****
  • Posts: 2027
  • Deep Ruleset Digger & Bughunter
    • View Profile
    • Github Account
Re: Upcoming mission changes
« Reply #19 on: March 03, 2015, 12:31:07 pm »
nah is for the better. hobbes will have toughest time and he already has his rulset prepared haha cause he knew ahead of time of the changes . so....everyone else's mod is mostly units, maps and weapons and graphic stuff . nobody really changes the cities that much. maybe piratez or MiB might need it . no big deal tho.

having custom terror missions is awesome.

Well every mod which fiddles with Alien missions need also updates... ->  objective: true

Offline hellrazor

  • Commander
  • *****
  • Posts: 2027
  • Deep Ruleset Digger & Bughunter
    • View Profile
    • Github Account
Re: Upcoming mission changes
« Reply #20 on: March 03, 2015, 12:41:22 pm »
Also Aliendeployment has some changes. for special missions like terror.

Offline SupSuper

  • Lazy Developer
  • Administrator
  • Commander
  • *****
  • Posts: 2162
    • View Profile
Re: Upcoming mission changes
« Reply #21 on: March 03, 2015, 01:45:07 pm »
A brief explanation of X-Com missions

Before explaining the rest of the changes, I think it's time for a primer on X-Com missions, because they probably look confusing as all hell to outsiders, so here's a very very simplified explanation.

Let's take a mission like this:
Code: [Select]
type: STR_ALIEN_RESEARCH
points: 0
raceWeights: ...
  0:
    STR_SECTOID: 70
    STR_SNAKEMAN: 10
    STR_FLOATER: 20
  1:
    ...
waves:
- ufo: STR_SMALL_SCOUT
  count: 1
  trajectory: P0
  timer: 9000
- ufo: STR_MEDIUM_SCOUT
  count: 1
  trajectory: P2
  timer: 7800
- ufo: STR_LARGE_SCOUT
  count: 2
  trajectory: P4
  timer: 9000

What does this all mean? Well, when this mission is first generated, the race is picked based on the current game month. If you're on the first month (0), then there's a 70% chance of sectoids, 20% chance of snakemen and 10% chance of floaters.
Then, the UFO waves begin. Only one UFO runs at once. The first wave consists of 1 Small Scout with trajectory P0 with 9000s between them. What's trajectory P0?

Code: [Select]
id: P0
groundTimer: 3000
waypoints:
- [5, 4, 100]
- [0, 3, 74]
- [0, 1, 28]
- [1, 1, 47]
- [5, 2, 100]
Each waypoint consists of a [zone, altitude, speed]. So first, the Small Scout will spawn in a point in mission zone 5 at altitude 4 at 100% speed. Then it will travel to the next waypoint in mission zone 0, at which point it will switch to altitude 3 and 74% speed. And so on. If the UFO reaches a ground waypoint, it will spend 3000s landed on it before moving on to the next.

So what are these mysterious zones? Well, let's go look at a region:
Code: [Select]
missionZones:
  -
    - [200, 220, -65, -60]
    - [230, 260, -65, -55]
    - [280, 290, -50, -40]
    - [230, 250, -50, -40]
    - [260, 280, -50, -40]
    - [230, 250, -40, -30]
    - [250, 272, -40, -28]
    - [270, 290, -42, -25]
    - [275, 295, -35, -10]
    - [240, 280, -30, -10]
  - ...
Each region has a series of areas [lonMin, lonMax, latMin, latMax]. The first group is zone 0, the next is zone 1, etc. So when a UFO has a waypoint in zone 0, what this means is it'll go to a random point inside one of the zone 0 areas.

And the UFOs carry on their business until the mission is over. So let's move on.

Changes to mission behavior

Up until recently, OpenXcom missions were pretty damn strict. You couldn't really add, remove or mess around with them much, because they had pretty hardcoded behavior. After all, that's how vanilla worked! But of course TFTD went and threw a wrench into that, so now missions are split by objective:

objective:
- 0 = score (default)
- 1 = infiltration
- 2 = alien base
- 3 = mission site (terror etc)
- 4 = retaliation
- 5 = supply

So yes, they're still the same missions as before, this is still X-Com. :P But now you don't need to worry about hardcoded string IDs. Plus now you can have multiple missions of the same type! So when the game needs for example an "infiltration", it'll pick one randomly from the available ones. Why would you wanna do that? I dunno, maybe you want the late-game to be nothing but battleships. You can also add missionWeights in a similar format to raceWeights:
Code: [Select]
missionWeights:
  0: 50
  2: 43
  3: 89
They only apply when deciding from multiple missions of the same type.

There's also these special properties based on the mission objective (see the vanilla missions for more details):
spawnZone: mission zone to use when spawning mission sites / alien bases.
spawnUfo: UFO to spawn for retaliation.
objective: true Marks this wave as the one that carries out the mission objective (for mission site / supply missions).

Odds and ends

New Battle mode now lets you select the terrain for any mission (not just UFO missions).

Extra properties added to alien deployments:
alert: Alert message to use when this mission site is spawned.
briefing: Custom briefing data to use for this mission.
duration: Number of hours the mission site lasts [min, max].
markerName: Custom name for the mission site marker on the globe.
markerIcon: Custom icon for the mission site marker on the globe.

Extra properties added to crafts/UFOs:
marker: Custom icon for the marker on the globe.

I think that's everything, grab the latest nightly if you wanna try it out! Please make sure the vanilla behavior still works as vanilla, and the new features work as advertised.
« Last Edit: March 03, 2015, 02:00:40 pm by SupSuper »

Offline Hobbes

  • Commander
  • *****
  • Posts: 2102
  • Infiltration subroutine in progress
    • View Profile
Re: Upcoming mission changes
« Reply #22 on: March 03, 2015, 02:22:56 pm »
Supsuper, thanks a lot for your work here :D

I've got one question: where/how can you define the text of a new briefing for a mission? (answered by XOps)
And another additional question: can you post the code for Artifact Sites on TFTD? It will be easier to implement such missions if we already have an example of how to do it.

People interested in modding missions might also be interested in checking this page I did a while ago for the wiki explaining them with a little more detail: https://www.ufopaedia.org/index.php?title=Alien_Missions_in_Enemy_Unknown_(OpenXcom).

Meanwhile, I've attached below the new ruleset as a single file (to help modding, not for playing), with the relevant changes to globe, regions, terrains, alienDeployments and alienMissions sections.

« Last Edit: March 03, 2015, 06:49:15 pm by Hobbes »

Offline volutar

  • Colonel
  • ****
  • Posts: 351
  • Vanilla digger & Quality assistant
    • View Profile
Re: Upcoming mission changes
« Reply #23 on: March 03, 2015, 02:51:00 pm »
SupSuper, really impressive work. Cheers!  ;)
It's not much left really. Just make "ignore last N terror sites" (which should be also stored), and somehow make artifact site limited number of appearances. BTW I didnt find a way of making dynamic mission chances depending on this mission depletion state.

Offline XOps

  • Colonel
  • ****
  • Posts: 193
  • Guy who drowns first
    • View Profile
Re: Upcoming mission changes
« Reply #24 on: March 03, 2015, 05:41:35 pm »
Awesome! At long last! Thanks for the hard work.  :)

So yes, they're still the same missions as before, this is still X-Com. :P But now you don't need to worry about hardcoded string IDs. Plus now you can have multiple missions of the same type! So when the game needs for example an "infiltration", it'll pick one randomly from the available ones. Why would you wanna do that? I dunno, maybe you want the late-game to be nothing but battleships. You can also add missionWeights in a similar format to raceWeights:
Code: [Select]
missionWeights:
  0: 50
  2: 43
  3: 89
They only apply when deciding from multiple missions of the same type.

I can find missionWeights, but I can't find section that sets the weights by month. Is this in the region's section? It has missionWeights listed, but no month designations.


I've got one question: where/how can you define the text of a new briefing for a mission?
It's STR_WHATEVER_BRIEFING
For example, I have a mission deployment in alienDeployments called STR_CODEX_JUNGLE. The briefing is called STR_CODEX_JUNGLE_BRIEFING. The game automatically finds it so you don't have to tell it what the string is. This has actually been around for a while.

Offline Hobbes

  • Commander
  • *****
  • Posts: 2102
  • Infiltration subroutine in progress
    • View Profile
Re: Upcoming mission changes
« Reply #25 on: March 03, 2015, 06:36:33 pm »
I can find missionWeights, but I can't find section that sets the weights by month. Is this in the region's section? It has missionWeights listed, but no month designations.

If I'm understand it correctly, then you aren't finding it because there are none defined for vanilla missions. But in case you want to use it, then you add a missionWeights subsection on the relevant mission entry on alienMissions.

Quote
It's STR_WHATEVER_BRIEFING
For example, I have a mission deployment in alienDeployments called STR_CODEX_JUNGLE. The briefing is called STR_CODEX_JUNGLE_BRIEFING. The game automatically finds it so you don't have to tell it what the string is. This has actually been around for a while.

Ah, nice. I had wondered if that was the mechanism. Thanks.

Offline Dioxine

  • Commander
  • *****
  • Posts: 5455
  • punk not dead
    • View Profile
    • Nocturnal Productions
Re: Upcoming mission changes
« Reply #26 on: March 03, 2015, 06:43:24 pm »
Will it be possible to tweak the "number of missions per month" hardcoded rule?

Offline Hobbes

  • Commander
  • *****
  • Posts: 2102
  • Infiltration subroutine in progress
    • View Profile
Re: Upcoming mission changes
« Reply #27 on: March 03, 2015, 06:47:02 pm »
Will it be possible to tweak the "number of missions per month" hardcoded rule?

From what I've seen in the new ruleset, it doesn't seem possible.

Offline SupSuper

  • Lazy Developer
  • Administrator
  • Commander
  • *****
  • Posts: 2162
    • View Profile
Re: Upcoming mission changes
« Reply #28 on: March 03, 2015, 06:55:47 pm »
I've got one question: where/how can you define the text of a new briefing for a mission?
It uses the deployment name ID.

I can find missionWeights, but I can't find section that sets the weights by month. Is this in the region's section? It has missionWeights listed, but no month designations.
Vanilla doesn't have per-mission weights, but they are put in the mission itself much like "raceWeights".

To clarify, some missions have special triggers like terror missions (monthly) and retaliations (in response to player). If there are multiple missions possible for this trigger, then the mission's missionWeights are used. Example:
Code: [Select]
alienMissions:
- type: STR_TERROR_EASY
  objective: 3
  missionWeights:
    0: 50
- type: STR_TERROR_MEDIUM
  objective: 3
  missionWeights:
    0: 30
- type: STR_TERROR_HARD
  objective: 3
  missionWeights:
    0: 20
So in the first month onward, there's a 50% chance of STR_TERROR_EASY, 30% chance of STR_TERROR_MEDIUM and 20% chance of STR_TERROR_HARD.

For stuff like the monthly regional mission, the region's missionWeights are used. Example:
Code: [Select]
regions:
  - type: STR_NORTH_AMERICA
    regionWeight: 18
    missionWeights:
      STR_ALIEN_RESEARCH: 14
      STR_ALIEN_HARVEST: 17
      STR_ALIEN_ABDUCTION: 20
      STR_ALIEN_INFILTRATION: 20
      STR_ALIEN_BASE: 20
North America has a 18% chance of being picked for a mission. If it is, it has 14% chance of getting Alien Research, 17% Alien Harvest, 20% Alien Abduction, 20% Alien Infiltration and 20% Alien Base. You'll notice the other missions aren't here since they are triggered separately.

Will it be possible to tweak the "number of missions per month" hardcoded rule?
Depends. There is no hard rule on the number of missions, just what triggers them. Some are simply monthly triggers, others are more complex.

Offline Dioxine

  • Commander
  • *****
  • Posts: 5455
  • punk not dead
    • View Profile
    • Nocturnal Productions
Re: Upcoming mission changes
« Reply #29 on: March 03, 2015, 07:11:01 pm »
Thanks for claryfying, now more questions :)

1. Correct me if I'm wrong, but the "terror monthly" seems to be selected from all available "objective: 3" missions. Is that correct? Or is the terror monthly selected from every mission named STR_TERROR_something ?

2. Will it be possible to change the total number of standard regional missions being triggered each month?