OpenXcom Forum

Modding => OpenXcom Extended => OXCE Suggestions DONE => Topic started by: Meridian on October 23, 2016, 10:24:22 pm

Title: [Documentation] Surrender mode and Bug-Hunt mode
Post by: Meridian on October 23, 2016, 10:24:22 pm
So, seeing some more unbearable bug-hunt pain on certain stream, I've decided to give surrender mechanic a try.
I know it's highly arguable, but let's at least try, maybe something comes out of it... and if not, well, we tried.

So basic idea is that once the surrender-condition applies, all your units will get X psi vision (e.g. X=20) until the end of the battle.
I don't want to auto-end battle, last enemies can be the most dangerous ones, I just want to spend (a lot) less time searching for them.

Basic (global, configurable) attributes for surrender are:
1. max number of enemies that can surrender (e.g. 2)
2. min turn for surrendering (e.g. 20)

If those two are not met, nothing else is checked.

3. enemies which cannot surrender (e.g. VIPs, mercs, star gods?)

If any of these remain, surrender doesn't happen. No more checks.

Then, we introduce a few rules (if any of them applies, surrender):
Rule A: if no enemy has a weapon anymore (i.e. both hands are empty), surrender
Rule B: if average morale of all remaining enemies is below Y (e.g. Y=40), surrender
Rule C: if no enemy moved at least Z tiles (e.g. Z=20) in the last Q turns (e.g. Q=3), surrender -- distance moved per turn is measured at the beginning and the end of their turn (i.e. running in circles in the toilet is no distance).

Checks would be done at the beginning of each player's turn.
Once surrendered, a special avatar (e.g. angry glowing-eyes monster :P) would be displayed instead of usual avatar... to indicate to the player, that surrender mode was activated.

Feedback is welcome... but please try to keep it simple, only if there is something really wrong with my algorithm or if I have missed some super-important rule.
Title: Re: Surrender mode
Post by: Solarius Scorch on October 23, 2016, 10:54:27 pm
Thanks for tackling this problem, Meridian!

It's interesting, but I think it doesn't address one important problem: even if you know where the enemies are, they are still out to get you. I think at least part of the problem was that running after an unarmoured Savvy Girl around the map is much more annoying and awkward than sweeping the map to find that last guy, and happens much more regularly.
I'm not saying the idea is wrong, it's indeed a step forward from, well, not having anything. But it's an upgrade to the after-turn-20-mechanic, which is a solution to a different problem than I hoped for. And this problem is that every last Altar Boy fights to the end like a legendary hero, even if he's mostly panicking. (And you can't take prisoners without stunning them, even if they should be defenceless.)

Sorry if my post doesn't seem very encouraging; I think it's definitely an interesting idea and a step in the right direction. However, I feel the need to point out that it has little to do with surrendering and therefore the name is just misleading (not intentionally, of course).

If taken as it is presented, my main concern will be communicating it to the player. I think the entire surrender mode (with the indicator) looks very much like something that was hacked into the game, instead of making a proper design. It is just completely detached from the game action, you just inexplicably develop cognitive powers after turn 20, provided that the stars are aligned. Yes, it's similar to the vanilla "after turn 20" system, but much more exposed and less abstract. It just looks extremely artificial and not really that different from entering a debug mode (I mean as a gameplay feature, obviously not a challenge-related feature). But I believe it can all be polished with some thought, although I'd like to see more feedback first.
Title: Re: Surrender mode
Post by: Meridian on October 23, 2016, 11:11:53 pm
Well, I am not trying to implement real surrender... that doesn't even belong to this game. That doesn't even belong to gaming as such I think... do you know any game, where they implemented any kind of surrender (on the opponent's side)?

Let's be honest, in majority of missions (at least for me), it is clear I will win... question is only if there will be any (small) losses or not... if I were the enemy, I would just give up on turn 1... lol.

So yes, probably should change the naming... I am trying to prevent a time-wasting bug hunt, nothing more nothing less.
Title: Re: Surrender mode
Post by: Solarius Scorch on October 23, 2016, 11:40:57 pm
Well, I am not trying to implement real surrender... that doesn't even belong to this game. That doesn't even belong to gaming as such I think... do you know any game, where they implemented any kind of surrender (on the opponent's side)?

Frankly I think that's not really relevant if it was used in other games or not. But in fact the reason is because many other games allow the enemies to escape - like X-Com: Apocalypse or Jagged Alliance (if I remember correctly). In X-Com there's no exit, or presumably no way to escape for the enemies, which is exactly why they need to be able to surrender.

Let's be honest, in majority of missions (at least for me), it is clear I will win... question is only if there will be any (small) losses or not... if I were the enemy, I would just give up on turn 1... lol.

But your enemies don't have this knowledge, most of them aren't very good with military tactics. :) And no, I don't want the enemies to surrender on turn 1. I would like to not having to kill or maim all those poor people who have no weapon, no morale and no reason to fight to the death, because frankly it's freakish and distasteful. And also a boring waste of time, but that's totally a secondary thing.

So yes, probably should change the naming... I am trying to prevent a time-wasting bug hunt, nothing more nothing less.

In this case I guess I shouldn't push the surrender issue at all. Pity, because I personally think it's way more important than problems with finding enemies, and should be easy to do... Just make it so whenever all remaining enemies are panicked, you win the battle automatically (just like when they're all mind-controlled), but only if all remaining units have a boolean canSurrender flag (to preserve vanilla settings for unmodded aliens). We've discussed it in the OXC thread last year and there was much interest. Plus it could mean less reactions training. :P

But if we focus on the finding the last alien issue, then I have already explained my first impression of it. I'd like to hear what people have to say, too...
Title: Re: Surrender mode
Post by: Meridian on October 23, 2016, 11:50:39 pm
In this case I guess I shouldn't push the surrender issue at all. Pity, because I personally think it's way more important than problems with finding enemies, and should be easy to do... Just make it so whenever all remaining enemies are panicked, you win the battle automatically (just like when they're all mind-controlled), but only if all remaining units have a boolean canSurrender flag (to preserve vanilla settings for unmodded aliens). We've discussed it in the OXC thread last year and there was much interest.

Sounds much better than it actually is... in OXCE, they will very rarely all panic... in all my battles, I don't remember a single instance of this scenario.
I will implement this, so that you can test it... but be prepared to be disappointed.

Now please back to anti-bug-hunt...
Title: Re: Surrender mode
Post by: Eddie on October 24, 2016, 01:26:10 am
That doesn't even belong to gaming as such I think... do you know any game, where they implemented any kind of surrender (on the opponent's side)?

The Starcraft 2 AI can surrender, if you play a custom game. They will type "gg" in chat, as is customary in online matches to acknowledge defeat, and then you have the option to accept or hunt them down to the last building. I do not know the mechanic for when it is triggered though.

Also, Heroes of Might and Magic has surrender. It happens automatically if your army really outclasses the enemy (>10x), but is disabled for some fights (boss battles).

To contribute to the topic:
How about using Aye Phones to indicate where the last enemies are? Approximate location will be displayed as an arrow at the edge of the Aye Phone screen. Not immersion breaking explanation: "Your Aye Phone has picked up an enemy distress call and can triangulate it's origin. It seems the enemy ranks have broken." Or something like that.
Title: Re: Surrender mode
Post by: Arthanor on October 24, 2016, 01:52:59 am
Indeed, I was going to say Starcraft II does it too. And I believe it's rather common place in PvP games. If humans would do it, I won't say the AI should do it, but it certainly could. Recognizing defeat and giving up is a natural trait and would be quite realistic for human enemies. Altar boys, some low level cultists in XCom Files, enemy "civilians" in XPiratez.

Anyhow.. since that's not what you want, I'll comment on the not-surrender, bughunt mechanic:
The last enemy is dangerous because the AI suddenly knows the position of everyone and can act accordingly. Giving the player such knowledge removes some of that challenge because suddenly the enemy can't ambush you out of nowhere. Yes, it helps to remove the long search, and it doesn't remove the risk as much as outright surrender, but giving psi-vision is a bit jarring. If you use flags to only allow harmless enemies, then the mechanic removes only affects non-challenging ones which might as well just give up and save you the time.

I don't really have a better way, except the way XCom2 does with the "sound waves" coming from alien pods when you have nothing engaged at the moment. This tells you which way to go without ruining the actual position or type of the enemy.
Title: Re: Surrender mode
Post by: Starving Poet on October 24, 2016, 03:06:04 am
I think one of the problems with my last bug-hunt mission wasn't necessarily that we couldn't find them - it's that one guy literally did not move out of that building, so it became a room-by-room clear,

One idea I had was instead of implementing the PSI vision approach could be to turn their aggression to max, if that's even possible. 
Title: Re: Surrender mode
Post by: Meridian on October 24, 2016, 10:37:57 am
To contribute to the topic:
How about using Aye Phones to indicate where the last enemies are? Approximate location will be displayed as an arrow at the edge of the Aye Phone screen. Not immersion breaking explanation: "Your Aye Phone has picked up an enemy distress call and can triangulate it's origin. It seems the enemy ranks have broken." Or something like that.

That's a very nice idea.
I like it more than the psi vision.
Title: Re: Surrender mode
Post by: Arthanor on October 24, 2016, 04:27:58 pm
Yes, that's a pretty good one! Aye-phone direction is much less information and at the same time much more explainable.
Title: Re: Surrender mode
Post by: Dioxine on October 24, 2016, 06:20:49 pm
Hurray! I really hope we manage to get this surrender mode to work.

The parts of your mechanics I'd like to see implemented:

2. min turn for surrendering (e.g. 20)
Rule A: if no enemy has a weapon anymore (i.e. both hands are empty), surrender
Rule B: if average morale of all remaining enemies is below Y (e.g. Y=40), surrender
Rule C: if no enemy moved at least Z tiles (e.g. Z=20) in the last Q turns (e.g. Q=3), surrender -- distance moved per turn is measured at the beginning and the end of their turn (i.e. running in circles in the toilet is no distance).

Nicely broken down to the basics. A & B cover the situation of scared escapees nicely, C accounts for AI error.

I think we don't need more than this. However, I don't like the psi-vision thing. It's gamey, gamey as hell! I'd like a prompt asking, 'the enemy wants to surrender, is peace an option?' if yes, auto-end battle with all captured. If not, continue and don't ask again.

1. max number of enemies that can surrender (e.g. 2)

This needs to be discussed. There are situations where even a large squad could surrender... but this is OK for now.

Games with surrender (or rather, escape) mechanism are Necromunda and Mordheim (the latter had a PC version lately), but I think what Meridian proposed is better anyway.
Title: Re: Surrender mode
Post by: Meridian on October 24, 2016, 06:38:04 pm
I think we don't need more than this. However, I don't like the psi-vision thing. It's gamey, gamey as hell! I'd like a prompt asking, 'the enemy wants to surrender, is peace an option?' if yes, auto-end battle with all captured. If not, continue and don't ask again.

There is an alternative to psi vision already proposed above... the motion scanner-like display of the enemy position.
I think that is quite acceptable and not gamey as psi vision.

The problem with "real surrender" under rule C is that it would trigger too often.
For example Marsec Bodyguard with Heavy Gauss "stuck" on the upper floor of Supply Ship is the most dangerous part of the whole mission, and usually the last enemy too. And since the ship is so small, he would not move much and trigger surrender. We should not allow him to surrender IMO... that would be a false positive.
Just showing his position though is OK, because we anyway know he's there (we are just afraid to come closer and he's camping, which is what I would do as well on his place)... but we should definitely fight this last enemy and not get his valuable loot gratis.

This needs to be discussed. There are situations where even a large squad could surrender... but this is OK for now.

I think this would be covered by Solarius' "real surrender mode"... just with a different condition than he wants (all panicked), so that it actually happens. There, we wouldn't need a limit on how many can surrender.


So, I think the combination of "anti-bug-hunt mode" and "surrender mode" could work nice for you. I'll try to make it work within the next 2 weeks and publish it for testing... once we see it in action, we'll be able to say more.
Title: Re: Surrender mode
Post by: Dioxine on October 24, 2016, 06:49:05 pm
The problem with "real surrender" under rule C is that it would trigger too often.
There is an alternative to psi vision already proposed above... the motion scanner-like display of the enemy position.
I think that is quite acceptable and not gamey as psi vision.

Hanging a core mechanic on an item/gadget that might not even exist in a mod? Nah. We can do better than that. Possibly by fine-tuning. How about rule C not applying if the enemy is inside 'ufo' (or rather, applying only when outside, so it always works in missions w/o UFO)? If it can be tracked, that is.

Just showing his position though is OK, because we anyway know he's there (we are just afraid to come closer and he's camping, which is what I would do as well on his place)... but we should definitely fight this last enemy and not get his valuable loot gratis.

This is true. If anything else fails, maybe we can show the movements of such an enemy (un-hidden movement)?

So, I think the combination of "anti-bug-hunt mode" and "surrender mode" could work nice for you. I'll try to make it work within the next 2 weeks and publish it for testing... once we see it in action, we'll be able to say more.

Indeed. These 2 will work best when combined. And we'll see how it works in praxis.
Title: Re: Surrender mode
Post by: Meridian on October 24, 2016, 07:00:10 pm
Hanging a core mechanic on an item/gadget that might not even exist in a mod? Nah. We can do better than that. Possibly by fine-tuning. How about rule C not applying if the enemy is inside 'ufo' (or rather, applying only when outside, so it always works in missions w/o UFO)? If it can be tracked, that is.

I wouldn't bind it to the item.
Just when the mode activates (user is informed somehow, e.g. by a short message/indicator), you could bring up the motion scanner UI by pressing a hotkey with any soldier at any time at zero TU cost.

This is true. If anything else fails, maybe we can show the movements of such an enemy (un-hidden movement)?

That's also a good idea! (certainly most intuitive and straightforward anyway)
A small disadvantage compared to motion scanner UI is that it wouldn't show enemies that don't move at all.
(The bug-hunt version of motion scanner UI would show those too, if you're asking yourself that question right now; and also those which are 10+ tiles away would be shown at distance 10... so that you know the direction to go)
Title: Re: Surrender mode
Post by: Zharkov on October 24, 2016, 07:49:39 pm
I like this idea, as a lot of tedium in this game comes from battles the enemy has already lost.

Rule A: if no enemy has a weapon anymore (i.e. both hands are empty), surrender

I guess rating weapons and checking whether they are a threat to the gals would be too much?

Also, Heroes of Might and Magic has surrender. It happens automatically if your army really outclasses the enemy (>10x), but is disabled for some fights (boss battles).

I wish we had something like that for openxcom, too. It would certainly fit the piratez theme: Instead of getting killed or enslaved by pirates, lots of people would consider handing over ship and valuables. And the gals might accept, as this provides booty without the work. Well depends on their mood, I'd think...
Title: Re: Surrender mode
Post by: clownagent on October 24, 2016, 09:13:44 pm
I wouldn't bind it to the item.
Just when the mode activates (user is informed somehow, e.g. by a short message/indicator), you could bring up the motion scanner UI by pressing a hotkey with any soldier at any time at zero TU cost.

That's also a good idea! (certainly most intuitive and straightforward anyway)
A small disadvantage compared to motion scanner UI is that it wouldn't show enemies that don't move at all.
(The bug-hunt version of motion scanner UI would show those too, if you're asking yourself that question right now; and also those which are 10+ tiles away would be shown at distance 10... so that you know the direction to go)

I think the minimap would be better suited for showing the last remaining enemies. Red circles or arrows could point to an area, without giving the exact location.
Title: Re: Surrender mode
Post by: khade on October 25, 2016, 02:49:59 am
The actual surrender could have different behaviors based on what those trying to surrender actually are.  A still armed Merc I'd have evade and escape with his equipment, with a score penalty, while civilians who want to surrender, armed or not, would be captured and/or ransomed.  Wild animals could decide to flee, while trained ones will fight until the target is gone.  A disarmed Merc I think I'd give a 50% chance of escaping on a surrender, since these guys are supposed to be extremely good soldiers.
Title: Re: Surrender mode
Post by: Meridian on October 25, 2016, 05:52:26 pm
Just FYI, OpenXcom has a fleeing mechanic already :)

If you attack for example enemy base in TFTD and go to second stage via exit (i.e. not killing everyone), the ones you spared count as fled and won't be recovered.
Title: Re: Surrender mode
Post by: Meridian on October 25, 2016, 06:15:07 pm
Sounds much better than it actually is... in OXCE, they will very rarely all panic... in all my battles, I don't remember a single instance of this scenario.
I will implement this, so that you can test it... but be prepared to be disappointed.

Units marked as "canSurrender: true" (default is false) will surrender if they panic or berserk.
Their loot and they themselves will be recovered.
You get a single scoring point per such weakling.

PS: screenshot is just for illustration, since they of course didn't all panic... I had to force them to panic by debug magic

Code: [Select]
units:
  - type: STR_GUILD_ATTENDANT
    canSurrender: true
  - type: STR_HUMAN_FATMAN
    canSurrender: true
  - type: STR_HUMAN_FEMALE_4
    canSurrender: true
#  - type: STR_HUMAN_MALE_3
#    canSurrender: false
#  - type: STR_GUILD_GUARD
#    canSurrender: false
#  - type: STR_GUILD_PILOT
#    canSurrender: false
extraStrings:
  - type: en-US
    strings:
      STR_LIVE_ALIENS_SURRENDERED: "SURRENDERED WILLINGLY"
Title: Re: Surrender mode
Post by: karadoc on October 26, 2016, 02:40:05 am
I like the way it works in Apocalypse, where the enemies start fleeing the combat area after awhile - and the mission ends when they are all gone. Of course, that isn't really viable in this game though - because enemies can't exit the combat area, and there's nowhere for them to go even if they did. (In apoc, they the enemies just move to a neighbouring building - and you can hunt for them there.)

In any case, I don't mind the idea of a surrender mechanic - but I just hope it is never 'surprising'. I mean, don't want the enemy to surrender unless they are definitely defeated. I don't want to suddenly win a mission that I didn't think was over.

The AI shouldn't surrender if the human's team is in bad shape. I'm not sure what the best rules would be, but I suggest we I'd suggest we check the relative health of the player team as well as the proposed conditions.
 * don't surrender if the player has any critical wounds.
 * don't surrender if the player only has fewer units than the AI; or if the human team has lost ~50% of their team already during this mission.
 * (armoured vehicles and terror units should not surrender.)
Title: Re: Surrender mode
Post by: Dioxine on October 26, 2016, 03:48:38 pm
Automatically surrender when panicking is less than ideal, but - baby steps :)
How does it work, exactly? Are units which surrender stunned, or do you have to kill/stun everyone who's not surrendering before the rest surrenders?

You get a single scoring point per such weakling.

No need to penalize this, you should get full capture score.

* don't surrender if the player has any critical wounds.

Objection  - the enemy has no way of knowing that. How about use simple outnumbering rules (surrender only if the player has more conscious units than AI)?
Title: Re: Surrender mode
Post by: Meridian on October 26, 2016, 04:14:19 pm
So, first of all, the above is the "true surrender" mode, as requested by SolariusScorch.
I am still working on the "anti bug hunt" mode, which will be something different... these 2 are not to be confused.

How the surrender mode works:

If during enemy turn all enemy units that are still standing (i.e. are not dead, are not unconscious and "have not fled"**) either panic or berserk... and all of them are capable of surrendering (the new "canSurrender: true" flag), the battle game automatically ends... in a very similar fashion to what happens with psi-capture.

If at least one of the remaining units didn't panic or berserk (this can happen even with morale=1), no surrender.
If at least one of the remaining units is not capable of surrendering (by default nobody is capable, mod needs to define that), no surrender.

** fled units are the ones who you haven't killed in the first part of a 2-part mission (e.g. TFTD base attack)

Automatically surrender when panicking is less than ideal, but - baby steps :)

As requested by SS.

How does it work, exactly? Are units which surrender stunned, or do you have to kill/stun everyone who's not surrendering before the rest surrenders?

No, they are not stunned.
Yes, you have to kill/stun everyone who is not surrendering... only if all remaining standing enemy units surrender, mission ends.

No need to penalize this, you should get full capture score.

Over my dead body :)
I wanted to give 0 points actually, but that leads to some other problems.
No work, no score.

EDIT: and you actually get more points now, because normally you would get minus points for killing/stunning them, right?

Objection  - the enemy has no way of knowing that. How about use simple outnumbering rules (surrender only if the player has more conscious units than AI)?

It's impossible to make good rules for automatic surrender... the current one is acceptable IMO, because it almost never happens (unless you start tweaking bravery stats).

All these more complicated rules belong to the "anti bug hunt" mode, which can be more forgiving to false positives, since it doesn't end mission automatically... only tells you where the bugs are hiding (approximately).
Title: Re: Surrender mode
Post by: Dioxine on October 26, 2016, 09:02:17 pm
EDIT: and you actually get more points now, because normally you would get minus points for killing/stunning them, right?

That's only because it's impossible to set a separate score for capturing (which is a shame); now it somehow works (stuns saving points) only through my 'magic', a state of affairs I don't like.
As for the surrender points, I'd argue that forcing the enemy to surrender is the same as stunning/killing them manually, only w/o stat training, which is a tangible minus. A grind-streamlining feature shouldn't be discouraged IMO. Naturally this can only work if the modder properly balances the chances of it happening.

Simple improvement proposition: instead of the requirement for all enemies to panic at once, any units allowed to surrender should save a 'has already panicked' info if panics. If all enemies left standing are allowed to surrender, and when all are panicking or have already panicked before, they surrender.

To discourage 'muton rape' stat training, those enemies who were stunned and woke up could count as 'have already panicked' too (naturally if mutons never surrender in a mod, 'muton rape' is still a thing).

I know bug hunts are a separate topic, but this improvement would save the player effort of finding the last 2 Altar Boys at least 50% of the time (more often if he plays fast and aggresively, racking a lot of kills within the space of a few turns).
Title: Re: Surrender mode
Post by: Meridian on October 26, 2016, 09:18:57 pm
Simple improvement proposition: instead of the requirement for all enemies to panic at once, any units allowed to surrender should save a 'has already panicked' info if panics. If all enemies left standing are allowed to surrender, and when all are panicking or have already panicked before, they surrender.

What does Solarius think of this?

If I do it, which enemies are you planning to mark with canSurrender flag? Approximately...

To discourage 'muton rape' stat training, those enemies who were stunned and woke up could count as 'have already panicked' too (naturally if mutons never surrender in a mod, 'muton rape' is still a thing).

The waking up Ghouls (and potentially Cyclops) could become a lot less scary than they are now with this change... are you sure? The Cyclops messed me up pretty bad last time (episodes not aired yet), so just thinking out loud. Again, depends on which enemies are you planning to mark...
Title: Re: Surrender mode
Post by: Dioxine on October 26, 2016, 10:52:44 pm
If I do it, which enemies are you planning to mark with canSurrender flag? Approximately...

Basically everyone with 90 or less Bravery, most monsters and aliens excluded (so Cyclops wont get it).
Title: Re: Surrender mode
Post by: Meridian on October 26, 2016, 10:58:22 pm
Basically everyone with 90 or less Bravery, most monsters and aliens excluded (so Cyclops wont get it).

OK, I'll make the change tomorrow for you to test.
Title: Re: Surrender mode
Post by: Solarius Scorch on October 26, 2016, 11:53:14 pm
What does Solarius think of this?

It's hard to say, because it depends on how this plays out. I'm unable to get a good feel of it without trying it... But I think the general mechanic is exactly what I asked for.

I think units who panicked before and then regained their composure probably shouldn't surrender, because it would make some missions too easy... It would still be useful in many cases, where only one or two enemies remain and they both aren't feeling well. Why would a soldier who panicked before but now has Morale 80 surrender? Unless of course some more complex tactical mechanisms are introduced (like some ideas above), but for now I'm looking at the simple, core feature. I guess the "has no weapon equipped" condition would probably be good enough.

If I do it, which enemies are you planning to mark with canSurrender flag? Approximately...

It depends if the "surrenders if has panicked before" is in, so (regarding X-Com Files):

The waking up Ghouls (and potentially Cyclops) could become a lot less scary than they are now with this change... are you sure? The Cyclops messed me up pretty bad last time (episodes not aired yet), so just thinking out loud. Again, depends on which enemies are you planning to mark...

Actually, if you add the additional check so that only unarmed units surrender, it would probably solve most problems with giving the flag to almost everyone. This would also include units with built-in weapons, who would never surrender.
Title: Re: Surrender mode
Post by: Dioxine on October 27, 2016, 12:44:18 am
The discrepancy between mods makes unified surrender mechanic hard to pull off; In Piratez, enemies regenerate Morale while in other mods, no.

Actually, if you add the additional check so that only unarmed units surrender, it would probably solve most problems with giving the flag to almost everyone. This would also include units with built-in weapons, who would never surrender.

Combined with the 'has already panicked?' this could be enough to make surrender global, instead of unit-by-unit. I like that.
Title: Re: Surrender mode
Post by: Solarius Scorch on October 27, 2016, 02:24:42 am
Combined with the 'has already panicked?' this could be enough to make surrender global, instead of unit-by-unit. I like that.

Yeah, but it'd influence vanilla. A unit wouldn't surrender only if specifically forbidden from doing so (I assume it'd be possible). And vanilla rulesets don't have this flag.

Therefore, it'd have to be an option. (Otherwise it wouldn't matter.)
Title: Re: Surrender mode
Post by: karadoc on October 27, 2016, 10:02:49 am
One side effect is that the mission will sometimes  end when the player doesn't want it to.


For example, I sometimes keep a couple of enemies alive for a few turns while I revive my soldiers to quaff mushroom beer. Doing that might be harder if the AI is likely to surrender.
Title: Re: Surrender mode
Post by: Meridian on October 27, 2016, 11:02:42 am
You guys are the worst!  ;D

Feel free to choose your poison:
(https://openxcom.org/forum/index.php?action=dlattach;topic=4997.0;attach=24560)

Example:

Code: [Select]
surrenderMode: 2
units:
  - type: STR_GUILD_ATTENDANT
    canSurrender: true
  - type: STR_HUMAN_FATMAN
    canSurrender: true
  - type: STR_HUMAN_FEMALE_4
    canSurrender: true
Title: Re: Surrender mode
Post by: Dioxine on October 27, 2016, 02:08:50 pm
Multiple options are always the best option!
Title: Re: Surrender mode
Post by: Solarius Scorch on October 27, 2016, 02:58:00 pm
Multiple options are always the best option!

Yes :)
Title: Re: Surrender mode and Bug-hunt mode
Post by: Meridian on October 27, 2016, 10:19:14 pm
OK, so there were quite a few things wrong with my bug hunt algorithm in the first post.
I won't go into details here (but feel free to ask), the new algorithm is:

Basic idea: Once the bug-hunt-condition applies, all enemy units will become visible on the minimap until the end of the battle.

Basic pre-conditions for bug hunt are:
1. max number of enemies (e.g. 2)... global
2. min turn for bug hunt (e.g. 20)... global or per alien deployment
3. no VIPs (e.g. no commanders)... global
4. no enemies in sight

If all above is true, then check if all remaining enemies are powerless or not.
Powerless is a unit, which:
- does not have any weapon
- or has morale below configurable threshold (global, e.g. 40)
- or has too many TUs left on the beginning of player's turn (i.e. couldn't move and couldn't shoot in its turn); threshold is configured as percentage of max. TUs (global, e.g. 60)

Check is done at the beginning of each player's turn.
Player is notified by a message on the top of the screen... we can probably think of other ways too (e.g. play a sound, pop-up window, ...)

Example:

Code: [Select]
# these are global defaults
bughuntMinTurn: 999
bughuntMaxEnemies: 2
bughuntRank: 0 # commanders are VIPs
bughuntLowMorale: 40
bughuntTimeUnitsLeft: 60

# for alien deployment overrides, the default is 0 = not used
alienDeployments:
  - type: STR_MY_DEPLOYMENT
    bughuntMinTurn: 40

# translate to empty string if the message bothers you (and give a new proposal)
extraStrings:
  - type: en-US
    strings:
      STR_BUG_HUNT_ACTIVATED: "Bug Hunt mode activated: enemies are visible on the minimap!"
Title: Re: Surrender mode
Post by: Meridian on October 27, 2016, 10:38:09 pm
Once you start using/testing this feature, please keep saves with situations where you think bug hunt should have been activated (and wasn't) or vice versa.
It will help.
Title: Re: Surrender mode and Bug-Hunt mode
Post by: Meridian on October 30, 2016, 04:59:17 pm
Addendum to the surrender mode: a flag is needed to exempt an unit from surrender calculations. Some units will never surrender & never trigger surrender, but should surrender once their masters do (drones, reapers). Not sure how this will work out, though (I can see funny situations arising), so I'd appreciate input.

So, if I understand correctly, these units are basically auto-surrendered from the start already (only waiting for others to surrender too).

New attribute on unit level introduced: autoSurrender, default false.
"autoSurrender: true" also sets the "canSurrender" to true... otherwise it makes no sense... so no need to define canSurrender, if you already defined autoSurrender.
Also, this new attribute works for all surrender modes different than 0... currently 1, 2 and 3.

Code: [Select]
units:
  - type: STR_DRONE
    autoSurrender: true
  - type: STR_REAPER
    autoSurrender: true

Btw. why not post directly in the Surrender thread?

Also, surrender mode = 3 doesn't work properly at the moment (in version 2016-10-27)... the units will surrender properly, but debriefing will ignore them. I will fix that in the next version.
Furthermore, with surrender mode = 3, I cannot distinguish surrendered units from psi-captured units... so both will count as just surrendered for scoring purposes... and I changed the scoring back to vanilla values because of that.
Title: Re: Surrender mode and Bug-Hunt mode
Post by: Drasnighta on October 30, 2016, 05:56:38 pm
So, if I understand correctly, these units are basically auto-surrendered from the start already (only waiting for others to surrender too).



I think the difference is, that on their own, they still won't surrender...   

So take a mission that has a Reaper and a pair of Sectoids...   If you drop the last 2 Sectiods in one turn, the Reaper is left alone, and will not surrender, as its too stupid to do so...

But if you only drop 1, and the last remaining Sectioid panics, drops his gun, runs about and ultimately, calls it Quits, despite it being Him and the Reaper...  The Reaper sits down and plays nice Doggy because the Sectoid told him to....
Title: Re: Surrender mode and Bug-Hunt mode
Post by: Meridian on October 30, 2016, 06:06:52 pm
Well, that's a bit absurd... Dioxine, did you mean it this way?  :-\

Cause that's a lot more coding for (IMO) no gain. Well, not really a lot, but certainly more potential to make mistakes/inconsistencies... and I don't even want to think what will others think of my mental health when reading such code.
Title: Re: Surrender mode and Bug-Hunt mode
Post by: Dioxine on October 30, 2016, 06:38:03 pm
So, if I understand correctly, these units are basically auto-surrendered from the start already (only waiting for others to surrender too).

No, that'd be the exact wrong way to do it - it's like Drasnighta said :) It's Surrealistik's idea, so it's mega-convoluted to code it, but these units should only surrender if all the others decided to surrender. It's basically him wanting to indulge into death threats ('surrender or we will kill your master' mode): If all the others die or there are no others to begin with, these units should fight as normal. Otherwise it makes no sense. But I won't fight to introduce this, as it'd basically only affect Reapers and possibly Celatids (too stupid to surrender, but will do so if their masters are threatened and order them to) - even tho IMO existence of such option makes sense.
Title: Re: Surrender mode and Bug-Hunt mode
Post by: Meridian on October 30, 2016, 06:55:19 pm
Well, the autoSurrender flag is in there already, maybe you can use it for something else.
I am building a version now, so that the bugs in surrenderMode = 3 are fixed.

As for the "surrender if all others (at least 1) surrender" idea... all stars and planets and their moons have to be in perfect alignment for this to happen... and once it happens in 1 out of 500 battles... there will be (almost) nobody to appreciate it, since (almost) nobody will know that exactly this special scenario has happened (or that it even exists).

I mean, we are talking about a corner case of a a corner case here, which is not even communicated to the player in any way.
I'll pass on this one, for now.
Title: Re: Surrender mode and Bug-Hunt mode
Post by: Dioxine on October 30, 2016, 07:44:22 pm
As for the "surrender if all others (at least 1) surrender" idea... all stars and planets and their moons have to be in perfect alignment for this to happen... and once it happens in 1 out of 500 battles... there will be (almost) nobody to appreciate it, since (almost) nobody will know that exactly this special scenario has happened (or that it even exists).

Indeed, unless you know the mechanic and aim specifically to exploit it. But yeah, let's give it a rest for now, I agree.
Title: Re: Surrender mode and Bug-Hunt mode
Post by: Meridian on October 30, 2016, 09:13:19 pm
New version 2016-10-30 download here: https://drive.google.com/open?id=0B8itkFQbhj-Ybm4xQWNzbG9wU00
Title: Re: Surrender mode and Bug-Hunt mode
Post by: Solarius Scorch on November 01, 2016, 03:17:52 pm
Sorry, can you please explain which mode does what? Dioxine explained it to me before, but I forgot the details and now can't understand it very well from the screenshot with explanations. Or actually I think I do, but it's not really explained and I'd like to just know.
Title: Re: Surrender mode and Bug-Hunt mode
Post by: Meridian on November 01, 2016, 04:20:02 pm
mode 0 = turned off
modes 1 2 3 = turned on

If all enemies are surrendering, missions ends.

Condition to surrender is different for different modes:

Mode 1 (your original requirement): all enemies can surrender (new flag) and all are currently panicking or berserking
Mode 2 (dioxine's first idea): all enemies can surrender (new flag) and all are "broken" (panicked/berserked now or in the past or stunned in the past and woken up)
Mode 3 (more brilliant ideas from undecided modders): all enemies have no weapons at all and all are "broken" (same as above)

I vote for mode 2.

Btw. after dust settles I will remove (or merge) unused modes... they are confusing and I need to fix funny situations with so many modes... as we have seen with the last 2 critical bugfixes.
Title: Re: Surrender mode and Bug-Hunt mode
Post by: KateMicucci on November 01, 2016, 04:58:59 pm
Which mode is active right now? Other than the mechtoid fiasco I haven't seen a surrender yet.
Title: Re: Surrender mode and Bug-Hunt mode
Post by: Solarius Scorch on November 01, 2016, 05:11:21 pm
OK, thanks for the answer. And I'm glad it was as I thought. :)

Btw. after dust settles I will remove (or merge) unused modes... they are confusing and I need to fix funny situations with so many modes... as we have seen with the last 2 critical bugfixes.

Which mode is active right now? Other than the mechtoid fiasco I haven't seen a surrender yet.

Well, Piratez use mode 2 while X-Com Files use mode 1. The reason is that morale works differently in both mods (because in Piratez you play as, well, pirates, while XCF has campy FBI agents), so they need different conditions. AFAIK nobody's using mode 3 yet.
Title: Re: Surrender mode and Bug-Hunt mode
Post by: Dioxine on November 01, 2016, 05:16:37 pm
Piratez use mode 2.

Surrender does work, in a test mission I had 2 Ninjas surrendering, and I think I've seen one surrender in Gaudium's stream as well.
Title: Re: Surrender mode and Bug-Hunt mode
Post by: khade on November 02, 2016, 11:59:39 pm
I've had some humanists and spartans surrender. Though keep in mind I play on the second difficulty, so it's probably going to be less common on the hardest ones.
Title: Re: Surrender mode and Bug-Hunt mode
Post by: Nygmus on November 04, 2016, 08:12:58 pm
Quote
Mode 2 (dioxine's first idea): all enemies can surrender (new flag) and all are "broken" (panicked/berserked now or in the past or stunned in the past and woken up)

Does this mean that we should no longer have to be so cautious with certain units that are hard to capture, such as Ghouls? Assuming Ghouls are able to surrender, that is.

That'd certainly be nice. One of the most aggravating things about pogroms with Ghouls along is trying to finish the mission while also trying to keep those damned bastards down so we can try to beat Toxiguns out of them.
Title: Re: Surrender mode and Bug-Hunt mode
Post by: Slaughter on December 10, 2016, 08:37:36 pm
How about a player surrender mode for units that end up stunned/MIA?

I had a mission I lost like that. 5 hands stunned, one dead. There went the Airbus lol.

Of course, in the end you have to pay a ransom - a big fat one.

Enviado de meu SM-G3502T usando Tapatalk

Title: Re: Surrender mode and Bug-Hunt mode
Post by: tylor on December 10, 2016, 10:11:44 pm
How about a player surrender mode for units that end up stunned/MIA?

I had a mission I lost like that. 5 hands stunned, one dead. There went the Airbus lol.

Of course, in the end you have to pay a ransom - a big fat one.

Enviado de meu SM-G3502T usando Tapatalk

Have you tried using manacles?
Title: Re: Surrender mode and Bug-Hunt mode
Post by: Starving Poet on December 11, 2016, 05:52:26 pm
I'm playing on Superhuman and I get surrenders all the time - there are certain units that can't surrender - but it works.   
Title: Re: Surrender mode and Bug-Hunt mode
Post by: Dioxine on December 12, 2016, 02:48:47 pm
To maximize the chance of enemy surrendering, attack fast and hard - enemy Morale regenerates every turn and you need to either panic or stun everyone who's alive at least once.
The biggest problem is when a high-Bravery or never-surrenders unit hides somewhere, blocking the surrender of all the others.
Title: Re: Surrender mode and Bug-Hunt mode
Post by: Absalom on December 23, 2016, 06:17:33 pm
I'd like to thank Meridian for this addition - has made my life much easier, especially in a recent mission that had a random civilian stuck in a tower in the corner of the map with no doors.  Thankfully I always bring hammers etc for such occasions.

To maximize the chance of enemy surrendering, attack fast and hard - enemy Morale regenerates every turn and you need to either panic or stun everyone who's alive at least once.
The biggest problem is when a high-Bravery or never-surrenders unit hides somewhere, blocking the surrender of all the others.

It's actually interesting balance-wise since the best way to get a quick surrender is to kill as many as possible, especially the leaders, as soon as possible to maximize morale drop.  It provides an alternative to just stunning everyone for the ransom by trading ransom money for mission complete speed.
Title: Re: Surrender mode and Bug-Hunt mode
Post by: Meridian on December 23, 2016, 06:41:15 pm
I'd like to thank Meridian for this addition - has made my life much easier, especially in a recent mission that had a random civilian stuck in a tower in the corner of the map with no doors.  Thankfully I always bring hammers etc for such occasions.

You're very welcome.
And thanks for the thanks, always makes my day.