Author Topic: [Documentation] Surrender mode and Bug-Hunt mode  (Read 10434 times)

Online Meridian

  • Global Moderator
  • Commander
  • ***
  • Posts: 5597
  • Aaand we're back!
    • View Profile
    • My Wiki
Re: Surrender mode
« Reply #30 on: October 27, 2016, 11:02:42 am »
You guys are the worst!  ;D

Feel free to choose your poison:


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
« Last Edit: October 27, 2016, 10:26:39 pm by Meridian »

Offline Dioxine

  • Commander
  • *****
  • Posts: 5244
  • punk not dead
    • View Profile
    • Nocturnal Productions
Re: Surrender mode
« Reply #31 on: October 27, 2016, 02:08:50 pm »
Multiple options are always the best option!

Offline Solarius Scorch

  • Global Moderator
  • Commander
  • *****
  • Posts: 8937
  • WE MUST DISSENT
    • View Profile
    • Nocturmal Productions modding studio website
Re: Surrender mode
« Reply #32 on: October 27, 2016, 02:58:00 pm »
Multiple options are always the best option!

Yes :)

Online Meridian

  • Global Moderator
  • Commander
  • ***
  • Posts: 5597
  • Aaand we're back!
    • View Profile
    • My Wiki
Re: Surrender mode and Bug-hunt mode
« Reply #33 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!"
« Last Edit: July 14, 2018, 10:58:53 pm by Meridian »

Online Meridian

  • Global Moderator
  • Commander
  • ***
  • Posts: 5597
  • Aaand we're back!
    • View Profile
    • My Wiki
Re: Surrender mode
« Reply #34 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.
« Last Edit: October 27, 2016, 11:15:48 pm by Meridian »

Online Meridian

  • Global Moderator
  • Commander
  • ***
  • Posts: 5597
  • Aaand we're back!
    • View Profile
    • My Wiki
Re: Surrender mode and Bug-Hunt mode
« Reply #35 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.
« Last Edit: October 30, 2016, 05:19:44 pm by Meridian »

Offline Drasnighta

  • Captain
  • ***
  • Posts: 82
    • View Profile
Re: Surrender mode and Bug-Hunt mode
« Reply #36 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....

Online Meridian

  • Global Moderator
  • Commander
  • ***
  • Posts: 5597
  • Aaand we're back!
    • View Profile
    • My Wiki
Re: Surrender mode and Bug-Hunt mode
« Reply #37 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.
« Last Edit: October 30, 2016, 06:09:48 pm by Meridian »

Offline Dioxine

  • Commander
  • *****
  • Posts: 5244
  • punk not dead
    • View Profile
    • Nocturnal Productions
Re: Surrender mode and Bug-Hunt mode
« Reply #38 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.
« Last Edit: October 30, 2016, 06:40:39 pm by Dioxine »

Online Meridian

  • Global Moderator
  • Commander
  • ***
  • Posts: 5597
  • Aaand we're back!
    • View Profile
    • My Wiki
Re: Surrender mode and Bug-Hunt mode
« Reply #39 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.

Offline Dioxine

  • Commander
  • *****
  • Posts: 5244
  • punk not dead
    • View Profile
    • Nocturnal Productions
Re: Surrender mode and Bug-Hunt mode
« Reply #40 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.

Online Meridian

  • Global Moderator
  • Commander
  • ***
  • Posts: 5597
  • Aaand we're back!
    • View Profile
    • My Wiki
Re: Surrender mode and Bug-Hunt mode
« Reply #41 on: October 30, 2016, 09:13:19 pm »

Offline Solarius Scorch

  • Global Moderator
  • Commander
  • *****
  • Posts: 8937
  • WE MUST DISSENT
    • View Profile
    • Nocturmal Productions modding studio website
Re: Surrender mode and Bug-Hunt mode
« Reply #42 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.

Online Meridian

  • Global Moderator
  • Commander
  • ***
  • Posts: 5597
  • Aaand we're back!
    • View Profile
    • My Wiki
Re: Surrender mode and Bug-Hunt mode
« Reply #43 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.
« Last Edit: November 01, 2016, 04:21:34 pm by Meridian »

Offline KateMicucci

  • Colonel
  • ****
  • Posts: 105
    • View Profile
Re: Surrender mode and Bug-Hunt mode
« Reply #44 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.