Author Topic: Civilians fighting back  (Read 15459 times)

Offline psyHoTik

  • Sergeant
  • **
  • Posts: 38
    • View Profile
Civilians fighting back
« on: January 28, 2016, 03:21:13 pm »
Hi!

At first I must say I'm no programmer or moder and I don't know anything about game AI and inner mechanics, so please consider this rather an open question than suggestion or request :)

I always wondered, is it possible to give civilians some simple AI (or just use Alien AI with swapped IFF flags) to let at least some of them to fight Aliens during terror missions? Some Police or Security officers, firing pistols, some low-morale soldiers with rifles and grenades (survivors from military squad sent to contain situation, beaten up before X-com arrived)? Of course they shouldn't be very effective and probably all will be dead at the end of the mission but with some luck they should be able to wound or even kill some of the weaker Aliens.

What do you think? :)

Offline yrizoud

  • Commander
  • *****
  • Posts: 1014
    • View Profile
Re: Civilians fighting back
« Reply #1 on: January 28, 2016, 04:31:59 pm »
You're not the first to wonder :) from the following thread, the AI civilians don't try to use any equipment.
Note, it would still raise questions about scoring : Do you get or lose points when civilian kills aliens/civilians/xcom, and how is it presented in the debriefing screen (more messages = more translations)
https://openxcom.org/forum/index.php/topic,4122.msg55231.html#msg55231

Offline Dioxine

  • Commander
  • *****
  • Posts: 5458
  • punk not dead
    • View Profile
    • Nocturnal Productions
Re: Civilians fighting back
« Reply #2 on: January 28, 2016, 04:58:25 pm »
The last question is easy to answer - treat civilians just like any other 'enviro hazard', eg. exploding UFO Power Source. So, no score for kills made by them, but points for alien corpses recovered. Same with red-on-red kills (civilian x civilian) - they count as killed by aliens (as they caused the whole mess) unless it was XCom who killed them.

Offline psyHoTik

  • Sergeant
  • **
  • Posts: 38
    • View Profile
Re: Civilians fighting back
« Reply #3 on: January 29, 2016, 09:35:53 am »
Nice to know, I'm not the only one suggesting it :)

If enabling civilians to shoot requires too much coding, then maybe start with something easier - update their movement patterns. Theoretically, saving civilians should be X-com first priority during terror mission. As we all know, it is not - civilians are dumb, they just run around and typically are gunned down regardless of player actions. Some strategy guides even suggest completely ignoring them ("the penalty is not big enough") or kill them to prevent zombiefing - while effective strategy, it's unacceptable for ethical reasons :) It would be much more interesting if player could actually do something to save them. Therefore, civilians should:

1. Run away and hide from spotted Aliens - openXcom has "sneaky AI" option, so I assume that some routines for such behavior already exist.
2. Try to get to X-com craft - they saw some military aircraft landing, so they logically assume that reaching it is their only chance for rescue. They could even try to board the craft and if they do they should count as saved in case of aborting.

This may encourage player to plan his actions with civilians in mind - cover escape routes with smoke screen, create safe zones, act fast to secure area etc.

If at some point coders make civilians able to shoot weapons, there will be another thing to consider:

3. enable them to pick up weapons - again, there is "Alien pick up weapons" option, so some work with AI is probably done. This may introduce interesting actions as throwing weapons to civilians to increase overall firepower. This however, while interesting to see, may be considered too unrealistic - while firing a gun should be obvious and intuitive for average person, proper handling, aiming and reloading requires training. However I wouldn't be surprised to see a berserk housewife spraying Mutons with auto-fire if her children lives were at stake.

The last question is easy to answer - treat civilians just like any other 'enviro hazard', eg. exploding UFO Power Source. So, no score for kills made by them, but points for alien corpses recovered.
I disagree here. It may promote silly actions as "stun or kill civilians so they won't take your points" or "block their line of fire so they won't make the killing shot". Aliens killed by civilians should be counted for X-com. Such cases would be too rare to became some serious exploit.
Same with red-on-red kills (civilian x civilian) - they count as killed by aliens (as they caused the whole mess) unless it was XCom who killed them.
Agreed here.

Offline Dioxine

  • Commander
  • *****
  • Posts: 5458
  • punk not dead
    • View Profile
    • Nocturnal Productions
Re: Civilians fighting back
« Reply #4 on: January 29, 2016, 10:36:58 am »
I disagree here. It may promote silly actions as "stun or kill civilians so they won't take your points" or "block their line of fire so they won't make the killing shot". Aliens killed by civilians should be counted for X-com. Such cases would be too rare to became some serious exploit.

You're thinking right when we simply assume that "civilians" will only be what they are now - a few scared, unskilled guys in a Terror mission. But this option enables scenarios like fighting side-by-side with military forces and many, many more, where crediting red-on-blue kills to X-Com would encourage player to hunker down and sit the battle out, instead of actually doing anything, and still get all the rewards. I think this is a more un-fun situation than civvies stealing a few kills. Besides you get much more negative points for killing a civvie than positive for killing an alien. There can even be a rule to get some negative points every time you stun or wound a civvie.

Offline Boltgun

  • Colonel
  • ****
  • Posts: 257
  • [UTTERANCES]
    • View Profile
    • Piratez let's play
Re: Civilians fighting back
« Reply #5 on: January 29, 2016, 10:41:08 am »
The most difficult would be to design it in a way that tells the player who is who. I already got confused in UFO redux when the agents who shot me were the civilians of the next terror mission.

Offline Hobbes

  • Commander
  • *****
  • Posts: 2102
  • Infiltration subroutine in progress
    • View Profile
Re: Civilians fighting back
« Reply #6 on: January 29, 2016, 03:40:36 pm »
I already got confused in UFO redux when the agents who shot me were the civilians of the next terror mission.

*thumbs up* :D

Actually, IIRC you can tell the suit civilians/hostiles apart by the color of their suits/ties. The hostiles are the only ones with black ties and suits ;)
« Last Edit: January 29, 2016, 04:50:19 pm by Hobbes »

Offline yrizoud

  • Commander
  • *****
  • Posts: 1014
    • View Profile
Re: Civilians fighting back
« Reply #7 on: January 29, 2016, 06:53:30 pm »
It would be much more interesting if player could actually do something to save them.
If you're interested, there is this older thread
https://openxcom.org/forum/index.php/topic,3553.0.html
After mrxian and redv's suggestion, I provided a test build where you play the turn of civilians which are close enough to your troops. I found it very fun to have scouts reach survivors and escort them to the back, and have somebody "guard" them so they don't wander away.

But this option enables scenarios like fighting side-by-side with military forces and many, many more
A giant battle of three armies (50-alien, 50-army, and xcom in the middle) can seem a fun idea, until you realize the HIDDEN MOVEMENT lasts ten minutes :)

Offline Solarius Scorch

  • Global Moderator
  • Commander
  • *****
  • Posts: 11730
  • WE MUST DISSENT
    • View Profile
    • Nocturmal Productions modding studio website
Re: Civilians fighting back
« Reply #8 on: January 29, 2016, 07:24:06 pm »
*thumbs up* :D

Actually, IIRC you can tell the suit civilians/hostiles apart by the color of their suits/ties. The hostiles are the only ones with black ties and suits ;)

Hobbes, have you ever been told you are insane? :D

Anyway, I think it'd be easier to check the minimap... Assuming you already know what's going on.

A giant battle of three armies (50-alien, 50-army, and xcom in the middle) can seem a fun idea, until you realize the HIDDEN MOVEMENT lasts ten minutes :)

I don't think it'd be that bad, but sure, it's something to be taken into consideration. Adjusting numbers of combatants is an easy thing though. :)

Offline Dioxine

  • Commander
  • *****
  • Posts: 5458
  • punk not dead
    • View Profile
    • Nocturnal Productions
Re: Civilians fighting back
« Reply #9 on: January 30, 2016, 02:17:33 pm »
A giant battle of three armies (50-alien, 50-army, and xcom in the middle) can seem a fun idea, until you realize the HIDDEN MOVEMENT lasts ten minutes :)

What of it? :) I already have battles in my mod with enemy numbers approaching 100, it ain't so bad, performance-wise :) But I was rather thinking "help 10 soldiers defend an outpost against 30 floaters", that scale.

Offline Hobbes

  • Commander
  • *****
  • Posts: 2102
  • Infiltration subroutine in progress
    • View Profile
Re: Civilians fighting back
« Reply #10 on: January 31, 2016, 08:29:41 pm »
Hobbes, have you ever been told you are insane? :D

Yes, but there's a method behind my insanity. ;)

Offline psyHoTik

  • Sergeant
  • **
  • Posts: 38
    • View Profile
Re: Civilians fighting back
« Reply #11 on: February 01, 2016, 08:38:08 pm »
If you're interested, there is this older thread
https://openxcom.org/forum/index.php/topic,3553.0.html
After mrxian and redv's suggestion, I provided a test build where you play the turn of civilians which are close enough to your troops. I found it very fun to have scouts reach survivors and escort them to the back, and have somebody "guard" them so they don't wander away.
Sounds interesting :) I'll give it a try when I find some time (and need to finish UFO:Redux first ;) ).

Also, I've looked in CivilianBAIState.cpp and I see that civilians actually do have routines for escaping and hiding. Why they get themselves killed so easy then?

Offline Warboy1982

  • Administrator
  • Commander
  • *****
  • Posts: 2333
  • Developer
    • View Profile
Re: Civilians fighting back
« Reply #12 on: February 02, 2016, 05:43:04 am »
Also, I've looked in CivilianBAIState.cpp and I see that civilians actually do have routines for escaping and hiding. Why they get themselves killed so easy then?

aliens are better at seeking than civilians are at hiding.

Offline psyHoTik

  • Sergeant
  • **
  • Posts: 38
    • View Profile
Re: Civilians fighting back
« Reply #13 on: February 02, 2016, 09:54:45 am »
aliens are better at seeking than civilians are at hiding.
:)

Also, if civilian line of sight is reduced during the night, most of this routines will never work. Poor guys will never know what hit them :(

Offline psyHoTik

  • Sergeant
  • **
  • Posts: 38
    • View Profile
Re: Civilians fighting back
« Reply #14 on: February 05, 2016, 11:56:56 am »
An interesting find :) If I understand the code correctly (I may not - please correct if I'm wrong) the Civilian AI may be in one aspect superior to the Alien AI - when calculating escape destination it always knows how many Aliens are observing given tile, while Alien AI can account only previously spotted units and only for number of turns equal to unit intelligence parameter. Civilians however have different problem - a seriously advanced Alzheimer's disease, which causes them to forget what they were running from when they lose visual contact with the enemy.

I'm thinking about giving them the "intelligence" ability used by Alien AI - intelligence parameter is defined for civilian units - so they can run for a few turns since seeing Alien. Question to developers - is _turnsSinceSpotted used for Alien Units? I see not but I may be wrong. Would it be safe to use it to store turns since spotting Alien unit by civilian? Also, how is sight radius at night defined? Civilians seems to be using the same functions for LOS as Aliens - do they also have 20 tiles sight no matter of the time of the day?