OpenXcom Forum

Modding => OpenXcom Extended => OXCE Suggestions DONE => Topic started by: Solarius Scorch on March 20, 2020, 03:51:49 pm

Title: [DONE] Spawning missions at base coords
Post by: Solarius Scorch on March 20, 2020, 03:51:49 pm
I have a request: an option to spawn a mission (not UFO) right at the coordinates of X-Com base. This would be the same as normal spawning at a fixed point, except instead of given coordinates it would choose one of your bases (at random, if there's more than one).

Justification (in the context of Piratez as a good example):
- It would allow to remove "comm waves", which are a not-so-elegant hack.
- It would allow special missions taking place directly at your base, for example "attack of creatures from the sewers".
- It would allow creation of some missions which would logically take place around the base.

Optional considerations:
Terrain used would be governed by alienDeployments, same as with normal missions, but also including your base.
Also, it would be nice to have an option to tie the terrain to the global texture instead of specifying it directly, because (for missions not actually happening inside your base, but outside) the game doesn't know where the player will put their bases.
Title: Re: Spawning missions at base coords
Post by: Dioxine on May 11, 2020, 04:14:19 pm
This could be useful.
Title: Re: Spawning missions at base coords
Post by: Meridian on May 11, 2020, 04:17:08 pm
what is the purpose of "comm waves" today?
Title: Re: Spawning missions at base coords
Post by: Solarius Scorch on May 11, 2020, 04:26:36 pm
Comm waves are a hack to spawn a base assault which cannot be prevented: it's a UFO which moves at light speed and therefore cannot be shot down. Basically it simulates a base assault which is not made by dropping the invading force from air, but in some other way: they come by land, or from the underground, or teleport in, whatever.

My request is partially a way to do it more cleanly, but this is not the most important part, more like an additional boon. The most important thing is to be able to create base assaults without UFOs and without X-Com base detection. It would also allow to make other missions which do not take place on the X-Com base, but still should be in the same place on the globe, like for example exploring the caves beneath your base in Piratez.
Title: Re: Spawning missions at base coords
Post by: Finnik on May 11, 2020, 04:49:07 pm
Maybe we can have syntax like that to solve the problem:
Code: [Select]
alienMissions:
  - type: STR_ALIEN_RETALIATION
    points: 0
    objective: 4
    spawnUfo: STR_BATTLESHIP # Vanilla - Spawned for the final retaliation run
    baseDefenseCustomDeployment: STR_BATTLESHIP #case we still want base defense without any ufo
    customMissionDeploument: STR_CULT_SAFEHOUSE #custom deployment, that would be spawned on top of the base
so before we to spawn a ufo with
Code: [Select]
const RuleUfo &battleshipRule = *mod.getUfo(_rule.getSpawnUfo(), true);
const UfoTrajectory &assaultTrajectory = *mod.getUfoTrajectory(UfoTrajectory::RETALIATION_ASSAULT_RUN, true);
Ufo *ufo = new Ufo(&battleshipRule, game.getId("STR_UFO_UNIQUE"));
ufo->setMissionInfo(this, &assaultTrajectory);
we can choose to spawn base defence with deployment `data:` loaded from `baseDefenseCustomDeployment:` or even just spawn a mission site within region's xcom base coordinates using `customMissionDeploument:`. I think we can process each rules suquencially using something like if(!ruleProperty.empty()), or pick only one with priorities customMissionDeploument -> baseDefenseCustomDeployment -> spawnUfo.

Also, I looked at how to tweak base defense deployment to make special one and end up to use the dirty hack, that is working more or less ok for FTA, but to make a general solution to use other properties other than `data` for baseDefenseCustomDeployment case it looks to me we should do a big job with battlsescape generation.
Title: Re: Spawning missions at base coords
Post by: Meridian on May 11, 2020, 05:20:16 pm
Comm waves are a hack to spawn a base assault which cannot be prevented: it's a UFO which moves at light speed and therefore cannot be shot down. Basically it simulates a base assault which is not made by dropping the invading force from air, but in some other way: they come by land, or from the underground, or teleport in, whatever.

My request is partially a way to do it more cleanly, but this is not the most important part, more like an additional boon.

ok, I will ignore this part for now

1) The most important thing is to be able to create base assaults without UFOs and without X-Com base detection.

2) It would also allow to make other missions which do not take place on the X-Com base, but still should be in the same place on the globe, like for example exploring the caves beneath your base in Piratez.

But 1) and 2) are two completely different things... I don't see how they relate at all... or how could they be done by just a single feature?

Can you elaborate why you talk about them as one feature?
How would implementing 1) also implement 2) ?
Title: Re: Spawning missions at base coords
Post by: Solarius Scorch on May 11, 2020, 05:54:07 pm
The only difference as I see it is that one uses the X-Com base layout, and the other uses a terrain declared by the modder.

No idea if it makes sense from the coding perspective, but in my view it's the only functional difference.
Title: Re: Spawning missions at base coords
Post by: krautbernd on May 11, 2020, 06:38:34 pm
I'm not sure if I understand this correctly, but to me these sound like two distinct features:

1)Directly Trigger base assault without UFOs

2)Create mission sites at player base location

The difference - as far as  I can tell - is that mission sites can't trigger base assaults and by extension can't destroy player bases. Taking a stab in the dark here, but if I follow your train of thought (missions "at" the player base) aren't you also asking for a third feature - triggering base assaults (on the closest player base) on mission failure?

If the player is supposed to fight off a invasion via the base sewers, what happens when he fails/abandons the mission? Shouldn't this trigger a "real" base assault?
Title: Re: Spawning missions at base coords
Post by: Meridian on May 11, 2020, 06:44:21 pm
ok, so maybe let's start from the beginning

I have a request: an option to spawn a mission (not UFO) right at the coordinates of X-Com base. This would be the same as normal spawning at a fixed point, except instead of given coordinates it would choose one of your bases (at random, if there's more than one).

Doable.

Optional considerations:
Terrain used would be governed by alienDeployments, same as with normal missions, but also including your base.

I don't get this... what does "including your base" mean?

Should it be a base defense mission (with a real base map) or not? Does the battlescape map correspond to a real base... or is it something fake/random?

Also, it would be nice to have an option to tie the terrain to the global texture instead of specifying it directly, because (for missions not actually happening inside your base, but outside) the game doesn't know where the player will put their bases.

What do I need to do here?
Isn't this already possible with the 'globeTerrain' mapscript constant? https://openxcom.org/forum/index.php/topic,7536.0.html
Title: Re: Spawning missions at base coords
Post by: Solarius Scorch on May 14, 2020, 11:30:41 am
Doable.

Bueno!

I don't get this... what does "including your base" mean?

Should it be a base defense mission (with a real base map) or not?

Yes!

Does the battlescape map correspond to a real base...

Yes!

or is it something fake/random?

Not sure what you mean exactly, but what I want is two separate options:

1) Real base map, exactly like on a normal base defence. (For base defence not triggered by a UFO.)
2) Some other terrain, defined in the alienDeployments. (For missions which should logically happen around your base, like exploring the surroundings, but not in the actual base.)

(So yes, Krautbernd is correct.)

What do I need to do here?
Isn't this already possible with the 'globeTerrain' mapscript constant? https://openxcom.org/forum/index.php/topic,7536.0.html
Perhaps, frankly I am not familiar with this option. I'll investigate.

If the player is supposed to fight off a invasion via the base sewers, what happens when he fails/abandons the mission? Shouldn't this trigger a "real" base assault?

I haven't planned anything this involved, a base defence is a base defence, doesn't matter from where.
Title: Re: Spawning missions at base coords
Post by: Meridian on May 14, 2020, 11:42:26 am
1) Real base map, exactly like on a normal base defence. (For base defence not triggered by a UFO.)
2) Some other terrain, defined in the alienDeployments. (For missions which should logically happen around your base, like exploring the surroundings, but not in the actual base.)

OK.

Just that option 1) is directly in conflict with the name of this thread "Spawning missions at base coords"... as no mission site will be spawned at all.
That was the confusion.
Title: Re: Spawning missions at base coords
Post by: Solarius Scorch on May 14, 2020, 12:33:40 pm
OK.

Just that option 1) is directly in conflict with the name of this thread "Spawning missions at base coords"... as no mission site will be spawned at all.
That was the confusion.

All right, sorry for the confusion. Not sure if a base defence counts as a "mission" or not :)
Title: Re: Spawning missions at base coords
Post by: krautbernd on May 14, 2020, 12:52:03 pm
I haven't planned anything this involved, a base defence is a base defence, doesn't matter from where.
Sorry for being pedantic, but it's not a base defence if failing the mission doen't result in the player losing the base - that's why I was trying to ascertain what it is you're asking for.

One of your examples was "player base is attacked via the sewers", so you want a mission site spawned at the base coordinates that takes place in an underground/sewer map. But how would this be different from a "standard" sewer mission site? What is the incentive here if the player can simply ignore the site alltogether because it's not an actual threat to the base? I'm just trying to follow your train of thought to it's logical conclusion - which is either missions progressing into an "actual" base defence or substituting custom maps for base defence maps.

Maybe I'm misunderstanding your example and/or original intent, sorry if that should be the case.

Title: Re: Spawning missions at base coords
Post by: Solarius Scorch on May 14, 2020, 12:55:42 pm
Sorry for being pedantic, but it's not a base defence if failing the mission doen't result in the player losing the base - that's why I was trying to ascertain what it is you're asking for.

Yes, it would work the same as any other base defence.

One of your examples was "player base is attacked via the sewers", so you want a mission site spawned at the base coordinates that takes place in an underground/sewer map. But how would this be diffrent from a "standard" sewer mission site? What is the incentive here if the player can simply ignore the site alltogether because it's not an actual threat to the base? I'm just trying to follow your train of thought to it's logical conclusion - which is either missions progressing into an "actual" base defence or substituting custom maps for base defence maps.

No, the hypothetical attack from the sewers would still be a normal base defence, with normal consequences.

That exploration you mentioned would be a different thing, taking place in a different terrain.
Title: Re: Spawning missions at base coords
Post by: krautbernd on May 14, 2020, 01:24:14 pm
Ah, okay. Sorry for the misunderstanding.

How exactely would these base defence mission be triggered and could they be defended against/avoided? Taking for example a small radar/interceptor base with a limited number of soldiers, would the player have any warning that an attack on the base would be forthcoming?

Also @Meridian, how would this interact with base defenses (if at all), or would these bypass base defense facilities alltogether?
Title: Re: Spawning missions at base coords
Post by: Meridian on May 14, 2020, 01:29:56 pm
no base defense missiles, no warning, no detection, no nothing

full surprise attack
Title: Re: Spawning missions at base coords
Post by: Solarius Scorch on May 14, 2020, 02:40:19 pm
That's what I wanted, yes. (Assuming that the standard missionScripts flags work, so you don't get a hard mission on month 1, or before a certain research, etc.)
Title: Re: Spawning missions at base coords
Post by: Finnik on May 14, 2020, 08:18:36 pm
would that new base defenses have own deployment properties, like breifing data?
Title: Re: Spawning missions at base coords
Post by: Meridian on May 14, 2020, 08:21:51 pm
I don't know, I haven't done it yet.
Title: Re: Spawning missions at base coords
Post by: Finnik on May 14, 2020, 08:41:32 pm
I faced that problem when making FTA, for nice solution it needs pretty invasive change so for my solution I end up with very dirty hack that is easy to code but even I don't like it  :( Base defense mission is very special, it uses both deployments (attacking ufo and base defense), where `data` is taking from attacking ufo and all other properties are taken from base defense deployment. So with that, we can change only all base defense at once, without having separate briefing for the special one.
Title: Re: Spawning missions at base coords
Post by: Solarius Scorch on May 20, 2020, 04:17:34 pm
would that new base defenses have own deployment properties, like breifing data?

I certainly hope so, a separate deployment is necessary for, well, almost everything about my request. This includes custom info screens.
Title: Re: Spawning missions at base coords
Post by: wcho035 on June 21, 2020, 11:39:26 am
I would like to support this feature. One day, I would like do to arch mission spawn from base. It is not base defense but can be, without the UFO.

I am thinking in the line of Stargate Command. Start at gate room in your base, step through the gate, next level is another planet and etc.
Title: Re: Spawning missions at base coords
Post by: Solarius Scorch on April 15, 2022, 12:02:00 pm
Sorry, is this suggestion still being considered, or has it been dropped?

No rush, I am only asking to know if I should be accounting for such a possibility in the future.
Title: Re: Spawning missions at base coords
Post by: Meridian on April 15, 2022, 12:15:20 pm
still todolisted
Title: Re: [DONE] Spawning missions at base coords
Post by: Meridian on October 12, 2022, 09:02:40 pm
I have implemented the above ideas in 3 separate independent features:

1. Instant retaliation: https://openxcom.org/forum/index.php/topic,10808.0.html
(as a replacement for comm waves workaround)

2. Option for retaliation UFO to ignore base defenses: https://openxcom.org/forum/index.php/topic,10809.0.html
(for alien attacks not targetable by ground-to-air defenses)

3. Mission sites at xcom base locations: https://openxcom.org/forum/index.php/topic,10810.0.html
(for mission sites)

Hope that covers everything.

Please test carefully.
Title: Re: [DONE] Spawning missions at base coords
Post by: Solarius Scorch on October 12, 2022, 09:38:42 pm
Thank you very much, kind sir! :)