OpenXcom Forum

Modding => Released Mods => Topic started by: Kzer-Za on August 21, 2019, 05:32:11 pm

Title: Decreased TUs for aliens on your first turn [OXCE]
Post by: Kzer-Za on August 21, 2019, 05:32:11 pm
This is a little tweak that decreases the amount of TUs the aliens have during your first turn in Battlescape.

I have the plans of making this amount equal to the amount of TUs they normally reserve when in Patrol mode depending on their aggression stat. However, for now I had to go with one common amount for all of them, because I have no means to query the spawned unit about its aggression. So I went with 33% because: a) it is more or less average figure (they reserve 0% TUs with aggression 3+, 33% with aggression 2, 40% with aggression 1, and 50% with aggression 0 — my thanks to Meridian for providing that information); b) it corresponds to aggression 2, which is the most likely aggression level for the units you are going to encounter during the first turn.

As to the rationale for decreasing their first-turn TUs, there are two reasons: a gameplay-related one and a "realism"-related one.

Gameplay. Currently, on your first turn you either risk facing significant reaction fire, or just wait this turn out (if you don't see any enemies that can shoot you right inside your aircraft). This leads to the first turn always (with the above-mentioned limitation) being skipped. It means we might just as well give the aliens on your first turn the amount of TUs that they usually reserve. This way we get rid of: a) one routine action (clicking End of Turn); b) the element of being (un)lucky, because you can't just skip the first turn if an enemy has spawned in such a way that it can see the inside of your craft (I'm not a great fan of relying on luck).

"Realism". Of course, realism in a game is a very relative thing, and by itself it's not a reason to adjust something in the gameplay. But if there is a gameplay reason for some adjustment, then realism-related concerns can reinforce the decision. And the aliens having full TUs on your first turn do not make much sense. Did they have nothing to do until you arrived? Were they just standing there twiddling their thumbs? If a UFO has landed for its mission, they would be busy carrying out the said mission. If it has crash-landed, busy with repairing it: when your UFO is missing half a hull and a Power Source, I suppose even soldiers would have to lend a hand to engineers (not all work is gonna require qualified engineers in such a situation, there will be plenty of menial tasks). So they would have to rush out on your arrival, moving hurriedly, and barely having TUs to reserve. With the terror missions, the same: the aliens would be busy chasing civilians, civilians busy running away from aliens stupidly walking here and there, as they do :) So from the "realism" point of view it also makes sense that the aliens would have only their normally reserved TUs during the first turn, not the full amount.
Title: Re: Decreased TUs for aliens on your first turn [OXCE]
Post by: BlackStaff on September 18, 2019, 09:42:22 pm
Very interesting! Congratulations!  :)
I suppose it's compatible with TFTD if we change "master: xcom1" to "master: xcom2" ?
Title: Re: Decreased TUs for aliens on your first turn [OXCE]
Post by: 7Saturn on September 19, 2019, 12:50:05 am
JFTR: If it were about realism, they would have plenty of time to get into position while you are landing with your craft. The second the door opens, heavy bullet rain would be an appropriate response... But then again, you would not have to discover the entire map first, to see what it holds. You could just have a quick look outside the window, while you find a landing place. ;-)
Title: Re: Decreased TUs for aliens on your first turn [OXCE]
Post by: BlackStaff on September 19, 2019, 04:52:41 pm
I'm not interpreting the same thing you are!
Before landing it is logical that the pilot should look for two things:
- a flat, unobstructed place to land
- a relatively isolated place where the number of ENIs is the least important (in reality landing 1 or 2 km from the area will be feasible but we are talking about UFOs so we do what we want from reality).

Tactical landings are made in a matter of seconds. Meanwhile, the few ENIs who had seen the aircraft were approaching the assault point. So it's normal that they used part of their TU!

Translated with www.DeepL.com/Translator
Title: Re: Decreased TUs for aliens on your first turn [OXCE]
Post by: Kzer-Za on September 20, 2019, 11:11:49 am
I suppose it's compatible with TFTD if we change "master: xcom1" to "master: xcom2" ?

Yes, it absolutely should work with TFTD, I just didn't think about it because I don't play it myself :)
Title: Re: Decreased TUs for aliens on your first turn [OXCE]
Post by: N7Kopper on September 24, 2019, 11:11:33 pm
I'm not interpreting the same thing you are!
Before landing it is logical that the pilot should look for two things:
- a flat, unobstructed place to land
- a relatively isolated place where the number of ENIs is the least important (in reality landing 1 or 2 km from the area will be feasible but we are [b[talking about UFOs[/b] so we do what we want from reality).

Tactical landings are made in a matter of seconds. Meanwhile, the few ENIs who had seen the aircraft were approaching the assault point. So it's normal that they used part of their TU!
Yeah, in real life they're officially called UAP's! (Unidentified Aerial Phenomena)

But yeah, if this was more realistic, we wouldn't have the dropship on the Battlescape map at all, because X-Com would be either crawling through the brush to get to the UFO undetected, or at the very least landing in such a way that the Skyranger can be used as cover, after raking the enemy position with heavy firepower to force the ayys into cover.

With the terror missions, the same: the aliens would be busy chasing civilians, civilians busy running away from aliens stupidly walking here and there, as they do :) So from the "realism" point of view it also makes sense that the aliens would have only their normally reserved TUs during the first turn, not the full amount.
Or, if they have weapons (such as fists), running towards the militarily-trained/biologically engineered aliens spoiling for a fight. The implementation of civilians really is more like the Green Units in Fire Emblem than actual civilians, even the vanilla version. In OXCE especially, "civilian" in-engine is just defined as "allied AI" in a very broad sense.
Title: Re: Decreased TUs for aliens on your first turn [OXCE]
Post by: Gfixcom on September 26, 2019, 10:11:22 am
This is so logical that the mod should be integrated as an option in OXCE, I think.
Title: Re: Decreased TUs for aliens on your first turn [OXCE]
Post by: Solarius Scorch on September 26, 2019, 12:36:59 pm
I can't see how it is logical that people are oblivious to the fact that a Skyranger just landed nearby.
Sure, as discussed already, the fact that the Skyranger just drops on the enemy is controversial in itself. But there are two approaches to this:
1) It's just a game; discussing logic is pointless.
2) There are consistent, objective reasons for X-Com to land like this.
Limiting enemy TUs is not justified in any of these two approaches. Also, it's unXComy. ;)
Title: Re: Decreased TUs for aliens on your first turn [OXCE]
Post by: BlackStaff on September 26, 2019, 05:06:36 pm
In fact, there is no point in discussing the merits or uselessness of this principle.
It is now a Mod. So everyone is free to use it... at their own risk!
The integration into an existing pack remains at the initiative of the author(s) of the said packs!
If they accept it's good... if they refuse it's good too!
Title: Re: Decreased TUs for aliens on your first turn [OXCE]
Post by: N7Kopper on September 27, 2019, 07:59:34 pm
1) It's just a game; discussing logic is pointless.
Limiting enemy TUs is not justified in any of these two approaches. Also, it's unXComy. ;)
In that first case, the same gameplay argument can be made for this new approach as the gameplay argument for blocking the enemy from using explosives until turn three. The way X-Com sometimes land with no eye for deployment tactics and all of the aliens have full TUs despite being otherwise scattered and completely unready for the giant dropship are inherently illogical, and would need to be lore explained to not wrankle people.

And, maybe some of us are just fixing for a game that actually subjects the enemy to attrition: note how no rival Trainers in Pokémon ever have HP or PP missing when you start fighting them, even if they logically should.
Title: Re: Decreased TUs for aliens on your first turn [OXCE]
Post by: Solarius Scorch on September 27, 2019, 08:38:33 pm
In that first case, the same gameplay argument can be made for this new approach as the gameplay argument for blocking the enemy from using explosives until turn three.

Yeah, it's stupid too, I disable it by default.
Title: Re: Decreased TUs for aliens on your first turn [OXCE]
Post by: new_civilian on November 05, 2019, 11:46:25 am
Thanks for this mod/script! It's a real improvement over the original behaviour.
Title: Re: Decreased TUs for aliens on your first turn [OXCE]
Post by: Starving Poet on November 17, 2019, 09:24:36 pm
This is a great idea and Scorch is entirely wrong :)

If you want things that don't make sense, it's driving a van into the middle of a cult safehouse, letting yourself get completely surrounded, grabbing all your weapons, stepping outside of the car, and THEN waiting for reaction fire.

I think this makes MUCH more sense than waiting a turn - which is pretty much a required action unless an enemy is looking directly into the skyranger.

Blocking the aliens from using a grenade until X turn is a concession to OXC since vanilla behavior didn't have a weighting when spawning enemies to face them towards the skyranger.  In DOS it was 100% random which direction they were facing - where as here the numbers go up with difficulty.
Title: Re: Decreased TUs for aliens on your first turn [OXCE]
Post by: Solarius Scorch on November 18, 2019, 12:35:25 pm
Sorry, still doesn't change anything. It's still stupid and feels weird. I'd rather be bombed than smothered by the game.
Title: Re: Decreased TUs for aliens on your first turn [OXCE]
Post by: Solarius Scorch on November 18, 2019, 12:38:04 pm
Sorry, still doesn't change anything. It's still stupid and feels weird. I'd rather be bombed than smothered by the game.

And what's wrong with waiting a turn (when necessary)? It doesn't strike me as out of place.
Title: Re: Decreased TUs for aliens on your first turn [OXCE]
Post by: Starving Poet on November 18, 2019, 07:56:23 pm
Well, for one it's the same result  in that any enemies facing you now have less than maximum TU for reactions.  Which, if we are using their argument that they can see you and of course have full reactions when you leave the craft makes even *less* sense that they would just mill about and turn away from the craft :)
Title: Re: Decreased TUs for aliens on your first turn [OXCE]
Post by: Starving Poet on November 19, 2019, 02:10:29 am
I made a little change for personal use - since flat 33% is a bit too much of a guarantee they won't react:

has enemies spawn with somewhere between 33 and 100% TUs

Code: [Select]
extended:
  scripts:
    createUnit:
      - offset: 41
        code: |
          var int unitTUs;
          var int divisor;
          # var int unitAggression;
          # adjust aliens' TUs on the first turn
          unit.getTimeUnitsMax unitTUs;
          battle_game.randomRange divisor 33 100;
          muldiv unitTUs divisor 100;
          unit.setTimeUnits unitTUs;
          return;
Title: Re: Decreased TUs for aliens on your first turn [OXCE]
Post by: new_civilian on November 19, 2019, 01:52:17 pm
After using this mod now for several weeks I got so used to it, that I got totally slaughtered when forgetting to use it in a X-Piratez test  ;D
Anyway: This mod is so second-nature now for me, that i simply will not play without it anymore.

And thanks Starving Poet for the randomizer script!
Title: Re: Decreased TUs for aliens on your first turn [OXCE]
Post by: Solarius Scorch on November 20, 2019, 08:27:45 pm
Well, for one it's the same result  in that any enemies facing you now have less than maximum TU for reactions.  Which, if we are using their argument that they can see you and of course have full reactions when you leave the craft makes even *less* sense that they would just mill about and turn away from the craft :)

Good point, but that's more of a general AI issue. Not a "bug", but something to think about and perhaps address.
Still, ugly hacks are ugly. I like your randomizer way better!
Title: Re: Decreased TUs for aliens on your first turn [OXCE]
Post by: x60mmx on November 22, 2019, 10:37:35 pm
Turn one is for smoke grenade deployment, why are you just sending your troops out into the open?  ;)


More mods, the merrier.
Title: Re: Decreased TUs for aliens on your first turn [OXCE]
Post by: Starving Poet on November 26, 2019, 04:24:31 pm
This isn't vanilla

(https://media.discordapp.net/attachments/292974423563173888/648284106693672971/unknown.png?width=800&height=600)
Title: Re: Decreased TUs for aliens on your first turn [OXCE]
Post by: Solarius Scorch on December 03, 2019, 06:57:47 pm
This isn't vanilla

Oh, absolutely. But it was made with no artificial limitations in mind... :3
Title: Re: Decreased TUs for aliens on your first turn [OXCE]
Post by: PPQ on January 06, 2023, 09:06:05 pm
Will this work for the newest version of the mod? I really need the easy mode option as I am simply too old to keep up with the frustration of loosing agents.\

And what would I need to do to make it compatible with the X-Com Files?
Title: Re: Decreased TUs for aliens on your first turn [OXCE]
Post by: Juku121 on January 10, 2023, 05:31:50 pm
AFAIK, until XCF hits 41 sub-scripts for createUnit, both the original mod and Starving Poet's version ought to work as they are. Maybe even then, I don't know if Yankes-scripts from different mods share offsets or not. They probably do.
Title: Re: Decreased TUs for aliens on your first turn [OXCE]
Post by: TBeholder on January 10, 2023, 06:22:52 pm
Yes, “we landed in a clear spot, but somehow don’t know what is around, then waited until dust settled, now step out to the shooting gallery” part was always silly.
I doubt it’s the best solution, but it’s good — randomized, fairly simple and configurable.
Turn one is for smoke grenade deployment, why are you just sending your troops out into the open?  ;)
Definitely. Also, pre-equipping 2 soldiers closest to the door with smoke grenades in hands makes a nice marker when cycling through them.
But that’s just a workaround.
Title: Re: Decreased TUs for aliens on your first turn [OXCE]
Post by: Yankes on January 11, 2023, 01:05:01 am
AFAIK, until XCF hits 41 sub-scripts for createUnit, both the original mod and Starving Poet's version ought to work as they are. Maybe even then, I don't know if Yankes-scripts from different mods share offsets or not. They probably do.
offsets are used only to determine order on what scripts will be run, if different mods use same offset then mod load order will be used as tie-break.
Title: Re: Decreased TUs for aliens on your first turn [OXCE]
Post by: Juku121 on January 11, 2023, 02:47:11 am
Does that mean it's not possible to change a script via sub-mods?
Title: Re: Decreased TUs for aliens on your first turn [OXCE]
Post by: Yankes on January 11, 2023, 11:33:39 am
Not using this, but if base mod use new property `new: SomeScriptName` other mod can alter it using `override: SomeScriptName`.
Title: Re: Decreased TUs for aliens on your first turn [OXCE]
Post by: Juku121 on January 11, 2023, 12:22:42 pm
Ah, good to know. Thanks.
Title: Re: Decreased TUs for aliens on your first turn [OXCE]
Post by: PPQ on January 13, 2024, 11:13:30 am
Same question, ages later. Can I use this on the new version? Also, how do I install this. I forgot how I did it the first time round.
Title: Re: Decreased TUs for aliens on your first turn [OXCE]
Post by: Juku121 on January 13, 2024, 01:50:01 pm
I don't see why it wouldn't work now, scripts have gotten more support over time if anything.

For installation: drop it into your 'Mods' directory, change the 'master' in the metadata to 'x-com-files'. Optionally make Starving Poet's randomisation changes (https://openxcom.org/forum/index.php/topic,7308.msg119480.html#msg119480), too.
Title: Re: Decreased TUs for aliens on your first turn [OXCE]
Post by: 75338 on March 22, 2024, 04:55:37 am


For installation: drop it into your 'Mods' directory, change the 'master' in the metadata to 'x-com-files'. Optionally make Starving Poet's randomisation changes (https://openxcom.org/forum/index.php/topic,7308.msg119480.html#msg119480), too.

Took me a while to figure out where the file was. For anyone else confused, it's the tiny-text zip file attached to the first post in this thread.

Thx for the installation procedure. FYI The 'master' he's taking about is the file called metadata.yml, it can be opened with a text editor like Notepad.

The mods folder was inside C:\Users\YOURNAMEHERE\Documents\OpenXcom\mods