aliens

Author Topic: Smarter Civilian AI?  (Read 34568 times)

Offline DoxaLogos (JG)

  • Colonel
  • ****
  • Posts: 358
  • Squaddie cautiously peering through the breach
    • View Profile
Smarter Civilian AI?
« on: April 07, 2015, 06:39:17 am »
Even though I'm thoroughly enjoying OpenXcom in so many wonderful ways, there is one thing that frustrates me: stupid civilians with no sense of self preservation :)

For one thing, it breaks the "immersiveness" of the game to the point you almost don't care that much about protecting them.  They're so unrealistically stupid or oblivious across the board that it annoys me partly because they're practically impossible to protect.  I could probably handle it better if a small percentage of the civilians in a terror site were clueless, but all them...ugh.  Maybe an algorithm as simple as look around and run away from any aliens they spot might be a good starting point :)

I think it would be cool if there was an option like "Sneaky AI" for civilians... maybe called "Smarter Civilian AI"?.

Until then, I'll do my best to keep them safe while I roll my eyes at them :)

Offline volutar

  • Colonel
  • ****
  • Posts: 351
  • Vanilla digger & Quality assistant
    • View Profile
Re: Smarter Civilian AI?
« Reply #1 on: April 07, 2015, 07:44:00 am »
Civilians are panicking, they faced terror and unnatural aliens, they simply can't think "smart" (at least 85% of them). Obviously they act chaotic way.
The most they can do, is to run away from the danger. And I think that kind of behaviour is already there.

Offline mrxian

  • Colonel
  • ****
  • Posts: 109
    • View Profile
Re: Smarter Civilian AI?
« Reply #2 on: April 07, 2015, 08:50:14 am »
Oh, no no  no.
They don't run away from danger. They run into my damn line of fire and block my path.

Ideally, Xcom should get control of any civilian that is within line of sight of any trooper (that isn't wearing power armor). A close second would be if they used some kind of sneaky AI that made them hide from the aliens (and perhaps Xcom) more effectively.
At the very least, they shouldn't recover from being stunned (and count as alive) so I can safely stun them.

Offline volutar

  • Colonel
  • ****
  • Posts: 351
  • Vanilla digger & Quality assistant
    • View Profile
Re: Smarter Civilian AI?
« Reply #3 on: April 07, 2015, 09:42:42 am »
Forget about controlling civilians without using MC. Thankfully they don't turn aliens, as in vanilla, after losing control (because it was a bug).
And surely, as living beings they are recovering from stun. Tho you can add some more stun.
You may want not to have civilians at terror missions at all, like, to make it easier to complete with positive score? You can make a MOD with no civilians.
But this kind of mission meant to cause almost 100% casualities.
Civilians can't control lines of fire. It's simply impossible. Why should they ease your life?

Offline mrxian

  • Colonel
  • ****
  • Posts: 109
    • View Profile
Re: Smarter Civilian AI?
« Reply #4 on: April 07, 2015, 12:15:56 pm »
Civilians can't control lines of fire. It's simply impossible. Why should they ease your life?
Civilians do a damn good job at making terror sites unique and terrifying. You hearing some plasma fire off in the distance, followed by a blood-curling scream really adds to the atmosphere of the mission.
They also do a damn good job of enticing different gameplay - you take a few more risks in order to save as many civilians as you can.
These two are very good effects of having civilians present.

But every once in a while, civilians just become a huge liability. They wander around, mess up your battle lines, get in the way of fighting and are just plain annoying. They don't break the game too much, they just add a random factor to the fight that really doesn't add anything - when a civilian is present, they may just mess up your plans and/or cause casualties.
This effect isn't good. I don't think that something that is little more than annoying has any place in a game, and as such I think this behavior is a prime candidate for some modification. Something like having spotted civilians run towards the skyranger (unless they panic, they are still civvies, after all) would be a great plan.

In short, they don't have to make my job easier. They just need to stop making my job more annoying.
(And honestly, there've been situations where I just shot a civilian because I didn't want to risk it messing up everything.)(That's bad.)

Offline Ridаn

  • Colonel
  • ****
  • Posts: 269
    • View Profile
Re: Smarter Civilian AI?
« Reply #5 on: April 07, 2015, 12:22:53 pm »
Civilians are hugging the aliens and block the doorways.
They make it damn impossible to save them.
They deny me liberate use of explosives to make sure terrain works in my favour.
First time I fired a OpenXcom and got a Terror Mission I tried to stun them - they all came up as killed by me in mission results.
The more civilians are shot - the less my operatives are shot.
Therefore a good civilian is a dead civilian.

Offline Dioxine

  • Commander
  • *****
  • Posts: 5455
  • punk not dead
    • View Profile
    • Nocturnal Productions
Re: Smarter Civilian AI?
« Reply #6 on: April 07, 2015, 12:26:56 pm »
Consider this: all the *smart* civilians are already long gone when you arrive :)
They do tend to escape from aliens, but then again, there is nowhere to run, as aliens are spawned everywhere (Hobbes' pack adds an extra thrill to it - like a Chryssalid spawned adjacent to 6 or 7 civilians :). And if the do escape from aliens, they're liable to run the only way there isn't any aliens - that is, right into your lines of fire. There is nowhere else for them to go.

All it really comes down if someone enjoys randomness and saving the helpless, or would prefer everything orderly, disciplined and predictable. Obviously, Terror Missions cannot cater to both crowds at the same time. That's my opinion.

Oh yeah and there is also this crowd who is using artillery to solve the Terror problem - the score should hit around 0 when everything and everyone is dead, which is much better than circa -250 for landing and fleeing, or flat -1000 for not showing up :) They probably don't care about civilian AI that much at all.

Oh and there is that notion of having armed civilians - just another great way to lose operatives :) (armed civilians must be affected by Morale, so inb4 a civilian with his beloved AR-15 berserking in the middle of your squad)
« Last Edit: April 07, 2015, 12:30:55 pm by Dioxine »

Offline Hobbes

  • Commander
  • *****
  • Posts: 2102
  • Infiltration subroutine in progress
    • View Profile
Re: Smarter Civilian AI?
« Reply #7 on: April 07, 2015, 05:13:26 pm »
Something just popped into my mind. The safest place for the civilians to run to would be... into the Skyranger! The area around it should be clear of aliens, has nice walls for protection from shots and there's plenty of room to fit nearly all civilians that can be spawned in a map.

However, if you needed to retreat from the mission, it would be funny to find all the spots inside the Skyranger occupied by civilians, preventing some of your soldiers from escaping. How's that for frustration?  ;D

Offline DoxaLogos (JG)

  • Colonel
  • ****
  • Posts: 358
  • Squaddie cautiously peering through the breach
    • View Profile
Re: Smarter Civilian AI?
« Reply #8 on: April 07, 2015, 08:22:48 pm »
Civilians are panicking, they faced terror and unnatural aliens, they simply can't think "smart" (at least 85% of them). Obviously they act chaotic way.
The most they can do, is to run away from the danger. And I think that kind of behaviour is already there.

If that behaviour is there, it doesn't "appear" to be there based on my observations.  It just looks like random walking around oblivious to everything going on around them and consistent across the population.  I don't know how many times, I've watched civilians almost walk up to aliens, and I don't recall seeing them run from aliens behind them.  Seems like some of them should just be hanging out inside of buildings instead of blissfully walking out into the danger. So if they are hardcoded to run from danger, it just doesn't look like it and isn't very believable to my eyes :)

Quote from: volutar
Civilians can't control lines of fire. It's simply impossible. Why should they ease your life?
I agree about the lines of fire.  It's not my interest for this suggestion, and I'm okay with it not completely easing my life on a terror mission.  It's more about "believability" and immersing yourself into the theme and environment of what is happening around you in this chaotic mission.


Quote from: Dioxine
Consider this: all the *smart* civilians are already long gone when you arrive :)

Okay, I might be able to swallow that, but it's really really stretching it.  The more you have to explain things away, the harder it is to swallow it.

Quote from: Dioxine
All it really comes down if someone enjoys randomness and saving the helpless, or would prefer everything orderly, disciplined and predictable. Obviously, Terror Missions cannot cater to both crowds at the same time. That's my opinion.


Nope. I politely disagree, at least in the sense that is not where I'm coming from and have no desire to please "both crowds".   I really have no problem with random and chaos of terror missions, because I think it enhances the theme of the game and adds variety.  It's the modeling of the civilian behavior that just makes it hard to believe the random and chaos that is happening.  Yes, the aliens aren't that smart compared to us, but at least their behavior is a tad more believable in comparison to civilians. For instance, aliens seem to target civilians more than they do my operatives in terror missions.  That makes perfect sense, because that is their top mission priority.  Civilian AI behavior just seems "pasted on" to add randomness with other things thrown in to try to make you care about them -> extreme point loss for not responding.  Would it be better to give a bigger point bonus for saved civilians (i.e. positive reinforcement instead)?  That's probably a work around though again, not changing their behavior.  I digress, I just think more thought could be put into it then it's current state of civilian behavior in the AI department (again, no arguments about vanilla please and I'm not advocating getting rid of vanilla).

Quote from: Dioxine
Oh yeah and there is also this crowd who is using artillery to solve the Terror problem - the score should hit around 0 when everything and everyone is dead, which is much better than circa -250 for landing and fleeing, or flat -1000 for not showing up :) They probably don't care about civilian AI that much at all.

Yeah, you always have those people.  However, I wonder if some of that crowd would treat it differently if the civilians were a little more "believable"?  Or maybe the scoring system was different to encourage them to save the civilians?


Quote from: Dioxine
Oh and there is that notion of having armed civilians - just another great way to lose operatives :) (armed civilians must be affected by Morale, so inb4 a civilian with his beloved AR-15 berserking in the middle of your squad)

Now, I could buy all of that as well.  I don't mind having civilians with weapons (just not all of them) with Morale effects and berserking into my squad :)

Quote from: Ridan
First time I fired a OpenXcom and got a Terror Mission I tried to stun them - they all came up as killed by me in mission results.
The more civilians are shot - the less my operatives are shot.
Therefore a good civilian is a dead civilian.

I think that's the crux of the issue.  Because the civilians are so whacked, you'd rather kill them rather than save them which almost defeats the purpose of the mission at least when it comes to "caring" about their lives. So, if their behavior was a little more realistic, would it make anyone care more about their lives instead of writing them off?

As far as stun goes, at least the game could give you negative points for stunning, but still say they're alive at the end:)

Quote from: Hobbes

Something just popped into my mind. The safest place for the civilians to run to would be... into the Skyranger! The area around it should be clear of aliens, has nice walls for protection from shots and there's plenty of room to fit nearly all civilians that can be spawned in a map.

However, if you needed to retreat from the mission, it would be funny to find all the spots inside the Skyranger occupied by civilians, preventing some of your soldiers from escaping. How's that for frustration?  ;D

Yep, I thought of that too.  How frustrating would it be if they also blocked your exit from the Skyranger to get to the aliens :)

I guess to summarize what I would like is not to sacrifice the randomness and chaos, just make civilian behavior a little more believable in the midst of the chaos. Maybe the answer is just to mix up the behavior (civilian AI behavior modes?) among the civilians. Besides, people handle panic differently.

Examples:

1. Have some civilians crouching in a closet or behind chairs and not budge, because they're too terrified to move.  Sure it probably gets them killed, but I could believe that.
2. Other civilians spot you and the aliens and choose to get your operatives between them and the aliens... and might get killed the process, but at least they tried to get behind the good guys in presumed safety.
3. Other civilians run for the Skyranger in sheer relief throwing all caution to the wind (Hobbes suggestion), and probably get zapped along the way.
4. Other civilians pick up a gun and start shooting anything they see not human (even operatives in power suits).
5. Some civilians actually come under your control when they spot you, and you can order them to safety.
6. Any civilians spawned outside a building, make it their priority to find a building to camp out inside.
7. Civilians that always try to maneuver terrain between them and the aliens.

I guess when I look back over this, these examples would make terror missions even more chaotic :)  However, I would personally be a little less frustrated and annoyed with them, because they would behave more realistically. 
« Last Edit: April 08, 2015, 05:45:52 am by jgatkinsn »

Offline yrizoud

  • Commander
  • *****
  • Posts: 1014
    • View Profile
Re: Smarter Civilian AI?
« Reply #9 on: April 07, 2015, 08:31:53 pm »
The civilian "artificial stupidity" has never bothered me, but if it bothers someone, it justifies looking for a way around it.
For example a megaphone which lets you control the target civilian for a turn.

Offline volutar

  • Colonel
  • ****
  • Posts: 351
  • Vanilla digger & Quality assistant
    • View Profile
Re: Smarter Civilian AI?
« Reply #10 on: April 07, 2015, 09:16:03 pm »
There will be no change for civilian AI.
[/thread]

Offline Hobbes

  • Commander
  • *****
  • Posts: 2102
  • Infiltration subroutine in progress
    • View Profile
Re: Smarter Civilian AI?
« Reply #11 on: April 08, 2015, 12:12:24 am »
There will be no change for civilian AI.
[/thread]

A suggestion has posted on the appropriate subforum for analyzing its benefits and shortfalls.

We already know that you disagree with the idea but if people want to discuss it anymore just ignore the thread.

Personally, I agree with you that changes to the civilian AI aren't necessary at this point but I still like to read the views of others since this is also an exercise of creativity and you might get ideas to use elsewhere.
« Last Edit: April 08, 2015, 12:24:21 am by Hobbes »

Offline Dioxine

  • Commander
  • *****
  • Posts: 5455
  • punk not dead
    • View Profile
    • Nocturnal Productions
Re: Smarter Civilian AI?
« Reply #12 on: April 08, 2015, 02:26:01 am »
@jgatkinsn:
Even though Volutar Locuti (locutes? darn my Latin is horrible), I just want to say that the 7 examples, or 'panic modes' you've given at the end is something I really like (ex. I didn't GENERALLY like the notion of controlling civilians directly - but if say, one in 20 is pre-determined to come under your complete control once he has any of your soldiers in his LOS - hell, that's really sweet. After all, good things should happen too, if very rarely!)  - an advanced solution of the problem which avoids all the shortfalls of half-solutions... but is also very complex :)

And I agree with Hobbes that the thread could be held open even if just as an academic discussion (since really, I understand that coding complex civilian AI would be a huge investment and it will go a long way apart from XCom... not even mentioning that gain-for-effort ratio would be low).

EDIT: This "enhanced civilian AI" goes nicely hand-in-hand with cool ideas such as "Save  the Pilot" or "Help Local Forces" or "Extract VIP" missions... And these kinds of missions were implemented in Aftermath/Aftershock games, to great effect.
« Last Edit: April 08, 2015, 02:31:59 am by Dioxine »

Offline DoxaLogos (JG)

  • Colonel
  • ****
  • Posts: 358
  • Squaddie cautiously peering through the breach
    • View Profile
Re: Smarter Civilian AI?
« Reply #13 on: April 08, 2015, 04:51:37 am »
@Dioxine

Yes, I agree with what your thinking as well.  The modes should be random across the population and the ones with civilian control should be very rare. 

I expected my suggestion would be a very complex programming effort, but I don't think we should fear to discuss it even if it is complex.  It might inspire someone to attempt to pull it off and support it, and maybe something better might come out of it.  Heck, I'm considering doing it myself having never done AI programming, and I think it would be enjoyable to attempt even if it doesn't get officially accepted :)  I find the whole OpenXcom project very inspiring which is a testament to what has been accomplished, and we shouldn't fear new ideas in game development.  In my view, a healthy "open" source community, should also be about being "open" to new ideas.

Overall, I think you mentioned two terms I like better with what I'm trying to express: "panic modes" and "Enhanced Civilian AI" rather than "Smarter Civilian AI". 
« Last Edit: April 08, 2015, 05:38:58 am by jgatkinsn »

Offline Dioxine

  • Commander
  • *****
  • Posts: 5455
  • punk not dead
    • View Profile
    • Nocturnal Productions
Re: Smarter Civilian AI?
« Reply #14 on: April 08, 2015, 05:04:08 am »
I might try to interest one of my friends with the idea... he's specialty is programming, or should I say, husbandry of neural networks. "Survive an alien attack being a civilian" would be a good problem for a neural network. Naturally, using neural networks (specifically, evolutional algorithms) in homegrown programming, instead of the sacred art of scripting, is high heresy. It is really unfair to call his AIs "unfriendly". They are quite friendly indeed. But only as long as you're showing good manners :)
« Last Edit: April 08, 2015, 05:06:20 am by Dioxine »