aliens

Author Topic: Recoverable armors and stunned soldiers  (Read 6582 times)

Offline Arthanor

  • Commander
  • *****
  • Posts: 2488
  • XCom Armoury Quartermaster
    • View Profile
Recoverable armors and stunned soldiers
« on: November 18, 2014, 09:59:08 pm »
Recoverable and repairable armors have been a feature of OpenXCom mods for a while.

In vanilla, a dead soldier means a destroyed armor. With mods in OpenXCom, you can recover the corpse and, from it, make a new armor through a manufacturing project.

A problem arises when your soldier is only stunned though. In both vanilla and OpenXCom, a stunned soldier comes back with his armor at the end of the mission. But there is also a corpse.. which, if it is set to recoverable, will give you what you need to repair the armor, even though your soldier is also already wearing that armor. So stunning soldiers duplicates armors.

As far as I know, there is nothing to set the recovery of armor from a stunned soldier to false. Not that it would be a great fix since you would then recover a broken armor (from the corpse) from a stunned soldier, even if he has only been hit by a stun bomb..

The other way of addressing this would be to prevent the corpse recovery if the soldier was just stunned. Then you get the pristine armor from your stunned soldier and no damaged armor from the corpse. But there is also nothing to do that..

Would it be possible, at the very end of missions (just before debriefing),  to reanimate all stunned soldiers? It doesn't change anything to the outcome, except that it replaces stunned soldier corpses with active soldiers, thus the corpses would not be there to be recovered.

Offline pkrcel

  • Colonel
  • ****
  • Posts: 192
    • View Profile
Re: Recoverable armors and stunned soldiers
« Reply #1 on: November 18, 2014, 10:21:11 pm »
Now this is interesting..... I never noticed myself.

It's kind if weird, I'll have a look at the item recovery code.


Offline Falko

  • Commander
  • *****
  • Posts: 802
    • View Profile
Re: Recoverable armors and stunned soldiers
« Reply #2 on: November 18, 2014, 10:22:21 pm »
sounds like a fix in the source would be needed

perhaps somebody is interested in making armor repair more "ethical"
you can use negative prices
Code: [Select]
items:
  - type: STR_SOMEITEM
    costSell: -10000
if you sell this item you loose money
so why would you do that

armor repair- manufacture
needs body+elerium/alloy/...
creates new armor + BODY
Code: [Select]
items:
  - type: STR_BODY
    size: 3
    costSell: -10000

that "simulates" that there is a body in that armor that needs a burial we are obliged to pay for
+ it makes the tactic of using rookies as scout/meatshield a bit more costly
it also gives a tradeoff do you want to pay 10000$ to freeup 3storageunits or make a morgue in a secondary base that has running costs? (price/size numbers are just an idea would need to be balanced)
the battletype needs to be 0 or 11 so its not possible to blow up the corpses in a base defense to save money and loose dignity/morals .. or perhaps it should be possible ..hey lets throw all the corpses in front of the elevator :D

Offline Arthanor

  • Commander
  • *****
  • Posts: 2488
  • XCom Armoury Quartermaster
    • View Profile
Re: Recoverable armors and stunned soldiers
« Reply #3 on: November 18, 2014, 11:12:53 pm »
Interesting fix Falko :P

It just occurred to me that OpenXCom extended has a feature where stunned units leave a different corpse than dead ones. Since they are different, the stunned corpse could have different properties, most importantly it could be set as non-recoverable and the issue would be solved.

Unfortunately, this is not possible in the regular version of OpenXCom. Maybe something that makes corpses of unconscious units unrecoverable regardless of their item definition?

There ought to be something in that object telling the game that it is unconscious, otherwise you wouldn't be able to use a medikit on them. The game could use that same flag to not recover the corpses.

Another thing: Is there something special done for aliens? I don't think you recover both an alien corpse and a stunned alien...

Offline pkrcel

  • Colonel
  • ****
  • Posts: 192
    • View Profile
Re: Recoverable armors and stunned soldiers
« Reply #4 on: November 19, 2014, 12:35:22 am »
Most probably the same thing that SHOULD be done for Xcom corpses but it is NOT done due to the corpeses being unrecoverable in Vanilla.

I understand most of Falko's argument, but selling the damaged armor should costs $0 IMO, why pay? I mean, if an unarmored soldier dies usually you don't get it's corpse and usually you do not have to pay for the burial  :P


Offline yrizoud

  • Commander
  • *****
  • Posts: 1014
    • View Profile
Re: Recoverable armors and stunned soldiers
« Reply #5 on: November 19, 2014, 01:47:44 am »
About paying for dead soldiers, a few days ago I considered making soldiers twice more costly, but sacking them gives you back half of it : It represents their "life insurance", you get it back when you let them go in one piece.
Unfortunately the engine doesn't allow it, there is no "sell value" for personal.

Offline Arthanor

  • Commander
  • *****
  • Posts: 2488
  • XCom Armoury Quartermaster
    • View Profile
Re: Recoverable armors and stunned soldiers
« Reply #6 on: November 19, 2014, 01:58:46 am »
In most mods that have armored soldiers, you get a corpse for every armor except I armored soldiers. It would be trivial to add that one, along with a certain cost to dispose of it. This way, you get a benefit from repairing armor (faster and cheaper than making one, especially regarding Elerium) and also a drawback (used up space in a morgue/cemetery or wasted money).

Still, that's at best a fluffy workaround and not a very serious solution. Having the same check as for aliens done for XCom units would be much better.

Offline TaxxiDriver

  • Captain
  • ***
  • Posts: 97
    • View Profile
Re: Recoverable armors and stunned soldiers
« Reply #7 on: November 19, 2014, 02:42:19 am »
So this was actually an innate problem of the current engine, not a problem of a single mod. Some good and stable features of the openXCOM extended really should start being incorporated to the mainstream: the opportunity cost we're losing is getting higher every day, really.

I couldn't understand Falko's suggestion though. Even though it is a 'corpse' technically, anyway we regard it as a 'broken armor' and represented as such in the game in most mods, right? (I haven't seen something like 'a corpse with flying suit' in the selling screen :P) So why such an 'ethical' concern should be considered? Maybe I didn't understand because I'm not fluent in English... Sorry for that in that case.

Offline Arthanor

  • Commander
  • *****
  • Posts: 2488
  • XCom Armoury Quartermaster
    • View Profile
Re: Recoverable armors and stunned soldiers
« Reply #8 on: November 19, 2014, 03:29:53 am »
It is indeed a problem that is inherent to OpenXCom. There is no way to make this work with the current engine (nightly or 1.0) that I know of. By opposition, the possibility to have a different corpse for stunned units in OpenXCom Extended solves this problem in a very elegant way. The corpse for stunned soldiers can simply be made non-recoverable since you recover the soldier himself.

Falko's suggestion was more of a joke :P The idea is to stop representing the recovered corpses as broken armor and to start thinking of them instead as a corpse in broken armor. Then an unarmored corpse would be an item too, and repairing an armor would also give you an unarmored corpse along with the repaired armor. You would then have to dispose of the corpse, which costs money (or waste space by keeping it).

This really isn't a solution, though, as a stunned soldier would then give you: live soldier + pristine armor + dead soldier + damaged armor; instead of the current situation where a stunned soldier gives you: live soldier + pristine armor + damaged armor. But since the dead soldier is a bad thing to have, it kinda compensates for getting a free damaged armor.

Anyhow! Would any of our coders be nice enough to look into a fix for this?

Offline TaxxiDriver

  • Captain
  • ***
  • Posts: 97
    • View Profile
Re: Recoverable armors and stunned soldiers
« Reply #9 on: November 19, 2014, 12:04:07 pm »
@Arthanor Thanks for the explanation! Yeah, it seems like a band-aid. By the way, this bug means that one can deliberately stun their soldiers and get a bunch of the armors for free :o Considering that the manufacturing of armors takes quite a lot of time and resources, this is quite tempting ::)

Offline Falko

  • Commander
  • *****
  • Posts: 802
    • View Profile
Re: Recoverable armors and stunned soldiers
« Reply #10 on: November 19, 2014, 02:24:23 pm »
my idea was not ment as an fix for the problem
it just haopoend that the idea of selling bodies popped in my head as i read the starting post
if you get bodies (by recovering or cutting them out of the armor) you also can  things like use the dead body to make a the heavy weapon platform STR_FRANKENSTEINSMONSTER
the idea was more just a way let the player "pay" for specific behaviour
here soldier death costs more money than firing
you also can do elerium-money trade
all ufos have a recoverable STR_WASTEPRODUCT placed in the map  (no use out of this item but expensive to get rid off)
if you collect them they are in the storage or you can blow them up before but the armor is so high only elerium based explosion can destroy this item .. so pay money or storage or blow up part of the ufo with explosion while on mission

Offline Arthanor

  • Commander
  • *****
  • Posts: 2488
  • XCom Armoury Quartermaster
    • View Profile
Re: Recoverable armors and stunned soldiers
« Reply #11 on: November 19, 2014, 04:12:47 pm »
Those kind of ideas would be interesting for late game, when a player usually sits comfortably on a few tens of millions. But it would have to be balanced in early game too (when most soldiers die). Giving scouts a low waste value could be one way. Interesting stuff Falko!

As for stunning a bunch of soldiers on purpose, that's called an exploit. If one is inclined to do that, I suggest they go edit their save, which is ASCII in OpenXCom and super easy to read. That's a much better "exploit" :P

I think we all play XCom for the challenge, so I'm not too worried about that kind of behavior. It will spoil their enjoyment quickly and, since the game is strictly single player, does nothing on mine. I think it is more likely we see players start reanimating their soldiers before the end of the battle. That's what you'd do IRL and that prevents a bug from occurring. It's a win/win.

Offline TaxxiDriver

  • Captain
  • ***
  • Posts: 97
    • View Profile
Re: Recoverable armors and stunned soldiers
« Reply #12 on: November 20, 2014, 07:23:41 am »
Yeah, I was just saying that it would be funny to actually see someone doing that :P Anyway I also hope this problem will be fixed soon.

Offline BlackLibrary

  • Colonel
  • ****
  • Posts: 133
    • View Profile
Re: Recoverable armors and stunned soldiers
« Reply #13 on: December 15, 2014, 06:36:25 pm »
Dead is dead. Parts is parts. Dead guys are parts.
-Gibson