Jump to content
RichardEpsilonHughes

Mod idea - reaction-fire melee attacks for sebellian/reaper

Recommended Posts

How difficult would it be to alter Sebellians and Reapers to automatically take a swipe at anyone who approaches to hand to hand combat range? Beating those poor bastards down with stun prods is starting to feel like cheating.

Share this post


Link to post
Share on other sites

Not sure it could be done as I suspect melee attack weapons can't reaction 'fire' in code.

Try nerfing stun-rod stun damage to half instead. That might cure your problem.

Share this post


Link to post
Share on other sites

Yeah, melee reaction attempts cause a crash I think.

But it is possible to do (for reapers anyway, as Sebs have guns and won't be able to use melee attacks too), by changing the reaper attack to a different bullet type, and giving it a range of one. That'd be a good starting point.

Share this post


Link to post
Share on other sites

Do you know if that would work with their AI? I'm just wondering whether Reaper AI is tied into having a melee-type weapon rather than a ranged weapon. It would be an interesting experiment in any case.

Share this post


Link to post
Share on other sites

Xeno 1: Hey, look! A reaper! Let's send in our long runners and stun rod his noble behind!

Xeno 2: Uh, sir, it's a reaper.

Xeno 1: Well, get Xeno 3 & 4 to jock-shock then!

Xeno 2: Sir, caprturing the reapers with stun rod isn't going to be p-

Xeno 1: Look here Corporal, this is turn-based combat, the gentleman's way of war, he's stuck there looking like a dopey fool while there are 4 of us circling around it's stupid predicament, now send the order Corporal!

Xeno 2: But sir, the commander has installed reactionary attacks fo-

Xeno 1: GODDAMNIT, just send them in!

Xeno 3 & 4 charges with stun rods, *reaper counter-attacks*

Xeno 1: Oh-er...... now there's 2 of us now.

Xeno 2: Shall I get the dropship sir?

It's an excellent idea. Make'em think twice before doing nonsense like jousting towards a reaper with a stun rod. :P

Share this post


Link to post
Share on other sites
Do you know if that would work with their AI? I'm just wondering whether Reaper AI is tied into having a melee-type weapon rather than a ranged weapon. It would be an interesting experiment in any case.

Yeah, it works. There's one in the current M'nauts. It's just a new "rank" of reaper with a 1-range weapon (and a different spectre). It doesn't get chance to reaction fire though, as it's primary goal is to blow itself up and anyone near it (like the poppers from apoc)...so it's not the kind of unit that gets crept up on (it's weapon is also very low TU, to make sure it doesn't just come for a hug, like reapers sometimes do). Perhaps the more interesting aspect is that the ai has no qualms about blowing itself up (I don't think it understands blast radius).

Share this post


Link to post
Share on other sites
(I don't think it understands blast radius).

No, it really doesn't (although, at least in the case of Sebs, they probably don't care 'cause they'll regenerate anyway).

Cool to know it works with the AI. I might have a quick experiment to see if it works a la the OP, then. Unless someone else does so first.

Share this post


Link to post
Share on other sites

It might need some ai interference. Even with a non-melee bullet type, reapers will rarely have enough TU's to reaction fire anyhow.

Dropping the TU cost for their weapon would allow them to spam-reap. Perhaps copying something like a Caesan/passive ai might help.

Share this post


Link to post
Share on other sites
Dropping the TU cost for their weapon would allow them to spam-reap.

A reduction in their base TUs might help mitigate that. They'd still be able to spam if they're already close, but otherwise they could be limited to a move-attack distance more or less equivalent to what they have now.

Share this post


Link to post
Share on other sites

Wouldn't that also allow them to attack from a few tiles away though? The range of one tile would just be where accuracy starts to decline so I would have thought with the short range accuracy bonus they would have the opportunity to hit from two or three tiles on occasion. Reapers currently have 200 accuracy and also don't have an individual minimum accuracy defined in aiprops because they don't have to worry about trying to decide if a ranged attack will be a good use of TU. That could change with the addition of range to the claws. I would guess their accuracy would need to take into account the short range bonus or even have a high minimum accuracy set so they do not even consider firing from range.

Share this post


Link to post
Share on other sites

That's a good point.

Shot range bonus can be turned off, that's easily solved. In terms of attacking from more than one tile away, it's possible that the hit chance will be reduced to 0: if the over-range penalty is (effective range - tiles over max)/effective range then it should be fine since that will give you 0. But it might not work like that and if so I guess that's a deal-breaker.

Share this post


Link to post
Share on other sites

Can the short range bonus be turned off for individual weapons/aliens or would it be global?

The hit chance doesn't need to be reduced to zero, just below the threshold of the alien AI. The default is 35% I think but could be set individually. For example Reapers could have 40 accuracy, plus 30% short range bonus and have their minimum shot accuracy be set at 65%. If that was the case they would never be able to fire unless at point blank range but would still have a reasonable chance to hit when they did attack... Well that's the theory.

Share this post


Link to post
Share on other sites
Can the short range bonus be turned off for individual weapons/aliens or would it be global?

The hit chance doesn't need to be reduced to zero, just below the threshold of the alien AI. The default is 35% I think but could be set individually. For example Reapers could have 40 accuracy, plus 30% short range bonus and have their minimum shot accuracy be set at 65%. If that was the case they would never be able to fire unless at point blank range but would still have a reasonable chance to hit when they did attack... Well that's the theory.

Yeah, there's a variable that can be set to remove the short range bonus on weapons (precision weapons have this on by default).

As for hit chance, that could well work if accuracy isn't reduced to 0. I'd prefer the latter because it would outright block an attack (e.g. when you try and shoot a short range weapon at long range, it just won't let you). But trying minimum accuracy would be a good idea if this isn't possible.

Share this post


Link to post
Share on other sites

The 0% chance to hit would only prevent the alien from firing because it is below the threshold. It is basically the same as having 50% chance to hit with a 51% threshold. The alien AI checks chance to hit against threshold and if it is below then doesn't fire.

Of course that would be different if we were talking about a player controlled weapon as they could still choose to fire no matter how low the chance to hit is unless it was locked out by the 0% mechanic.

Setting a ballistic assault rifle to 45 accuracy and 1 range and giving it to a soldier with 43 accuracy still allows him to shoot out to 3-4 tiles before getting down to 0% chance to hit. Removing the short range bonus leaves him just barely able to fire two tiles but only gives a 19% chance to hit the enemy stood on the tile next to him. Reducing accuracy further may bring him down to only being able to attack adjacent tiles but may also bring his hit chance down to around 15%. That seems like a massive nerf to melee, especially for aliens who have no other form of attack.

The alternative seems better to me for alien weapons. Keep accuracy of the attack high but also increase the threshold so they will not attack outside of the adjacent tile.

*edit* Setting the rifle range to 1 also showed an interesting issue where diagonal attacks have a much lower chance to hit due to those tile apparently being classed as over 1 tile away. The difference was quite large, 95% hit chance to the cardinal directions but only 75% chance on the diagonals. Increasing the range to 2 tiles made it 79% and 74% respectively. That would allow a threshold of 72% to block shots over 1 tile in all directions.

Edited by Gauddlike

Share this post


Link to post
Share on other sites

Ta, thanks for testing that.

The best plan would seem to be to set the accuracy of the reaper very high (say 150 with a 100% modifier to hit) and set the minimum accuracy chance to 95 (so it won't attack below 95% chance to hit). Short range bonus would also be removed and range set to 1. That way, it shouldn't be able to attack outside of 1 tile range but doing so will give it maximum chance to hit.

It's set as 95% since that it is default maximum hit chance. Strictly speaking this is a slight nerf to the reaper, since it's giving it a chance that it can miss. But there's no way of changing that without changing the maximum hit chance as well. It's not likely to make much difference, though, and I think a 5% chance of not losing a soldier is actually a good thing from a game-play experience (you'd never rely on it, but the time your elite veteran survives a reaper attack is a moment you'll likely remember).

In terms of TU cost to attack, I think the Reaper currently uses 35%. To make it more viable that it can make a reaction attack, I'm tempted to reduce it down to 25% instead. That shouldn't increase it's dangerousness that much (it gives it a couple of extra tiles of movement before an attack) but might make it more likely to happen. It should probably get a fairly high reflex score/initiative modifier for the weapon as well to make sure it has a chance to get the attack off. (I suspect all this might lead to reapers being more powerful than in vanilla, but I can't think of any alternatives that will actually make the reaction-attack thing purposeful).

Share this post


Link to post
Share on other sites

I don't mind a small chance of surviving, just adds to the soldiers story, something he can tell the others back at base :P

The next concern is does the zombify ability work at all with a ranged attack or is it going to be hard coded like the vanilla medkit? I don't have a save to test that.

*edit* Just tried the rifle set to 500% accuracy and range of 1 with no short range bonus. It does give 95% chance to hit on all adjacent tiles, including diagonals, with pretty much 0% beyond that. Being behind cover doesn't seem to reduce that hit chance either so a threshold of 94% should prevent any attempt to fire outside of melee range.

Edited by Gauddlike

Share this post


Link to post
Share on other sites

Yes, it probably would have been wise to test that first! Should be able to set something up later to check.

Share this post


Link to post
Share on other sites

The unit I made with the weapon range of 1 - I've never seen it attack from further than an adjacent square (ie 1 tile), and that's with an accuracy of 1000.

I don't think aliens use "yellow range" (ie out of normal range), come to think of it. Their plasma splitter/shotgun is has a range of 5, and I've not seen them fire that at anything other than close range (in fact, they usually die trying to get into that range, but that's another story).

Share this post


Link to post
Share on other sites

Done it! Thought it wasn't going to work at first, as it wasn't zombifying. But apparently I can set the weapon type to melee without actually making it melee and it works.

Only trouble is that I'm not sure whether they're likely to save TUs even with the reduced cost. They seem to like to run around alot. However, my test was with Reapers on Aggressive AI, so passive/defensive ones might not suffer from the same problem as much.

Share this post


Link to post
Share on other sites

I don't think aliens use "yellow range" (ie out of normal range), come to think of it. Their plasma splitter/shotgun is has a range of 5, and I've not seen them fire that at anything other than close range (in fact, they usually die trying to get into that range, but that's another story).

That is quite possible. The AI settings for maximum range and so on may be overwritten by the weapon range. Or it is possible that the accuracy falloff and threshold is enough to make that an uncommon occurrence. Either way as long as it works then nothing else really matters :)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×