UFO:Alien Invasion

General => Discussion => Topic started by: BigBonsai on January 16, 2008, 10:53:03 pm

Title: Civilians... those little buggers.
Post by: BigBonsai on January 16, 2008, 10:53:03 pm
Now, I thought we could talk about those civilian nuts in a separate thread (kind of a continuation from here (http://ufoai.ninex.info/forum/index.php?topic=688.msg11990#msg11990)).

If the statement that was made in an earlier thread - that only those civ casualties count which occurred in abandoned or ignored missions - is correct, then why bother having civilians at all? Everybody who completes the missions can ignore the civilians, because they won't be counted anyways. The only thing that would make me want to save them is my morality. But after restarting a mission for the 10th time, morality gets lost...

With the current stupidity of these guys I hope the "civ body count policy" doesn't change, because saving them is nigh impossible. While I like a bit of naive stupidity in the world, these folks are a bit extreme - they run toward the gut-sucking aliens, hoping they will get a hug. But, of course - BOOM! ;D

As suggested in another thread, could some mechanic be implemented to make them at least run from the enemy instead of walking toward him? Or better - get close to one and give the civilian a command to exit to the dropship or or or...

Any ideas?

If the civs are supposed to be retarded, I'm fine with that. But it would be so much more fun if their IQ would exceed that of a bucket of sand. ;)

This game's fun! :) The characters tell their story without a word.


BiB
Title: Re: Civilians... those little buggers.
Post by: Sectoid on January 18, 2008, 07:21:30 pm

As suggested in another thread, could some mechanic be implemented to make them at least run from the enemy instead of walking toward him? Or better - get close to one and give the civilian a command to exit to the dropship or or or...

Yeah. I know writing AI is tricky, but the civis should be smart enough to at least be able to run away from aliens and toward soldiers in their line of sight. Maybe they should also run away from gunfire/explosions.
Title: Re: Civilians... those little buggers.
Post by: BTAxis on January 18, 2008, 07:43:12 pm
Let's get one thing straight, though. Civilians should NOT be able to get themselves to safety, as seems to be what these comments seem to be trying to accomplish. Saving civilians is PHALANX' job, and it's not going to be possible for them to save all civilians on every mission almost per definition.
Title: Re: Civilians... those little buggers.
Post by: BigBonsai on January 18, 2008, 11:59:57 pm
Let's get one thing straight, though. Civilians should NOT be able to get themselves to safety, as seems to be what these comments seem to be trying to accomplish. Saving civilians is PHALANX' job, and it's not going to be possible for them to save all civilians on every mission almost per definition.
I agree in parts. A civilian should be able to flee for instance to the dropship and wait there. How/If the dropshop is protected is the players choice. PHALANX should be able to tell the civs where to go to. That's also part of the mission.

And why shouldn't a civilian be able to get himself to safety? To a certain extent he should be. At least, as already mentioned before, they should run into a safer direction and not aimlessly proving the total absence of their brains. When there is a safe spot - who wouldn't head there?


BiB
Title: Re: Civilians... those little buggers.
Post by: BTAxis on January 19, 2008, 12:05:48 am
My point is that you kind of destroy the premise of a terror attack when you provide the civilians with the AI to evade the aliens. Of course, you could compensate that by making civilians slower than aliens, but even then if a civilian is smart enough to retreat inside PHALANX' area of control from the get-go, then the aliens will almost never be able to get that civilian. In other words, it'll be too easy to save him/her. Extrapolate this to all civilians on the map, and all PHALANX needs to do to save the civilians is stand around and wait for them to show up.
Title: Re: Civilians... those little buggers.
Post by: Ruminant on January 19, 2008, 04:03:50 am
What if soldiers could direct civilians to "safe areas", rather than the civilians running to those areas automatically?  A soldier could either "verbally" point a civilian in the right direction or else physically escort that civilian back to the safe area.  This would mostly preserve the nature of terror attacks while providing the player with better options that just watching them die or stunning them.
Title: Re: Civilians... those little buggers.
Post by: BTAxis on January 19, 2008, 01:08:43 pm
Great ideas. Anyone up for coding it?

Form orderly queues, please...
Title: Re: Civilians... those little buggers.
Post by: SpaceWombat on January 19, 2008, 07:01:37 pm
I think most "realistic" would be a variation between hiding in some corner, running into the open in panic and -most likely- running to the direction the soldiers come from because if that ugly alien freak is after you it would be rational to seek help from the human guys with the big guns who are after the alien thugs. Maybe this would add some dufficulty since you need to watch while fireing through the herd of civs running out of the buildings in your direction. That could be combined with the ability of giving orders to them if the civs are in range. Whether they obey or not depends on character and panic level.

Would give a challenge in tactics and as well would make the civilians more than obstacles. If you cannot do anything about them or they are just randomly stupid I consider them just nerds who stand in my way while i'm in a good shooting position. If they are really seeking my help and it is less depending on luck I feel more like it is my duty to actually shield them.  :)
Title: Re: Civilians... those little buggers.
Post by: Surrealistik on January 20, 2008, 12:21:53 am
I feel Wombat's initial idea is the best, featuring the three AI types.

The first impels the civilian to panic and flee at random away from any spotted alien.

The second has the civilian actively attempt to hide, never ending his turn in any tile in an alien's LoS. The AI for this type can probably be derived from existing alien AI.

The third, the most rational and common, causes the civilian to run from spotted aliens, and as a higher priority, run towards PHALANX soldiers.

Even with these self-preservational AIs in place, it will still prove difficult to rescue many civilians, especially as so many typically end up being a signifigant distance from the dropship, are unarmoured and thus take full damage from all weaponry.
Title: Re: Civilians... those little buggers.
Post by: SpaceWombat on January 20, 2008, 02:12:56 am
By the way I have a question regarding the AI dependence of aliens and civilians.
Right now I have the feeling that aliens always try to hunt down a civilian not taking into account what trouble this might bring them into considering tactical issues like the element of surprise.

For instance I had an alien on the roof and I wouldn't have noticed it until 3 turns in the future when I would have tried to place my sniper on that roof. That stupid alien gave a long range shoot with a plasma rifle on the civilian right next to my soldiers not hiting anything but a tree 5 tiles away.
That gave me the exact position to place a timed grenade for a one shot kill.

For a rational subject the tactical analysis would have prevented such stupidity as a no gain but all loss action and lead to a more stealthy sneaking-around-the-corner behaviour.


Is such kind of situation analysis part of the AI or planned in the future and furthermore can this be transfered to civ AI? If only one character setting like "hide" would be tagged to a civ on lets say a football field this might result in not finding a corner to hide an run around in circles which in a turn based game structure would be as bad as standing still and face the inevitable.  :'(

I have heard about a study on mass panics in sports arenas recently and it said that "the stupid crowd" seems to be rather smart when running away. The only obvious problem was that in mass panic many people are blocking each other. But we are just talking about 3-10 people scattered over the map. So I would consider their behaviour as rather smart and responsive to the actual situation of every single civ if that can be coded.  ;D

There is of course a need for trial and error of such a complex AI. It would definitely strengthen the excitement for tactical missions for the players. The less luck it takes to make a mission the better.
Title: Re: Civilians... those little buggers.
Post by: BTAxis on January 20, 2008, 12:51:20 pm
Nobody really understands the AI, I think. If there's someone who can make a better one, by all means.
Title: Re: Civilians... those little buggers.
Post by: Mustang on January 20, 2008, 04:32:26 pm
Let's get one thing straight, though. Civilians should NOT be able to get themselves to safety, as seems to be what these comments seem to be trying to accomplish. Saving civilians is PHALANX' job, and it's not going to be possible for them to save all civilians on every mission almost per definition.

Sorry, but I completely disagree with this.  Civilians should at least be able to follow orders and get to secure ground.  I can understand the occasional hysterical civilian, but if this is the way you intend it, then let me jump on those idiots and cart their butts back to the drop ship.  As it is now, they will run from the areas I've secured and right into the enemy.  That doesn't make sense.  If I know my planet is going to be destroyed because 20-50 idiot civilians can't follow orders, I'm going to pop them in the arse and drag them to safety.  Since the AI does not support that, this limit just won't work.
Title: Re: Civilians... those little buggers.
Post by: SpaceWombat on January 20, 2008, 04:59:50 pm
Right.
If it is indeed more or less based on luck whether you can save all or nearly all civilians the casualty maximum and the negative impact on funding, moral etc. must take this into account. Then civs are just an obstacle to deal with.
That would be no fun in my opinion.  :-\

Civilians are never save unless you finish the mission. There is no "hostage save zone" where they disappear when reached. But after you commenced your search & destroy mission there should be a much better chance for them to survive.
The 5 civs on the map do in no way represent all civilians attacked by the ufos. They are just who is left after the alien raid went on for a few hours when your troops finally arrive.
Protecting them with your soldiers lifes should be a gain and absolutely possible.
Aliens can attack them while they have successfully reached dropship/squad to seek shelter though! It does not affect your s&d mission objectives to have a herd of civs in one spot of the map.

I say let's make them a bit smarter and let them try to reach savety in form of a good hiding place or the player's squad. And we will see how that works and how it can be improved when it is implemented. I would say this is huge gain for the game while it is obviously also a huge task.  :)

Maybe I can find a way to contribute to that issue though i'm not a good coder right now.
Title: Re: Civilians... those little buggers.
Post by: BlakeD on January 20, 2008, 10:10:08 pm
First, I think the civ-limit mechanism is definately in need of refinement / rethinking.

BUT (You know it was coming) - humans, especially panicced, untrained civilians, are STUPID animals.  They DO run into danger.  They do stuff that is illogical.  When the nice big soldiers appear, unless the civilian has seen and knows it's aliens attacking, may very well think it's a military attack.  If they do recognize the soldiers as the "good guys" - and the good guys with the big protective guns are moving in the direction opposite of the "safe place" they've just been instructed to go to, they may not go there.  After all, who is there to protect them?  What makes THAT place safe?

Humans are stupid, illogical, panicy, ANIMALS.  I'd like to give us more credit than that, but honestly, I don't think history would support it.
Title: Re: Civilians... those little buggers.
Post by: SpaceWombat on January 21, 2008, 04:15:17 am
While it is true that panic makes you run faster and think slower and humans are of course animals since they are neither plants nor funghi I think it is not true that our behaviour is unlogic or "stupid" while trying to get away from danger. If that would be the case no predator could predict and estimate what his prey will do next.
In fact the behaviour under stress and panic becomes mostly more simple but you do not put your second hand on a heat source while you realize the first one is melting on it!
And because humans are social/group animals -which is critical for our survival- they will stick to people of the same group (humans instead of aliens) and most of them will follow orders of someone who takes initiative on solving the problem.
That is reality according to my experience and knowledge.

That said I also want to mention that this behaviour does not necessarily mean it is the most tactical advanced decision to run straight to the soldiers! Maybe that brings you into the line of fire of the alien sniper on the roof and the optimal runaway strategy under given information might still lead into loss of civis in one concrete situation or another...
We are not talking about skynet super AI. We just want to simulate more common sense behaviour to make it more plausible as wells as provide a more tactical advanced gameplay.
Title: Re: Civilians... those little buggers.
Post by: Mustang on January 23, 2008, 01:30:37 pm
I can agree with the hysterical aspects of civies running wild, but even animals will attempt to run to safe areas.  Most civilians would run to the drop ship once they saw it because it would represent their only safe area, even if it meant exposing themselves to worse danger than than hiding.  Once inside they would start to calm down and think better and maybe react a little better.  The AI in the game doesn't take any of that into account, (nor do I think it should bother with that kind of detail) so a civilian could wander inside my drop ship and then wander right back out into open territory and get killed. 

Having some way to stun them and carry them back might be cool too.  ;)

Anyway, the developers do seem to be listening on this topic and I did follow their suggestion to remove this limit from the game making it a non issue.  I remember in XCOM always having good scores even when there were high civilian deaths and that never seemed right.  I could see increasing the penalties for them here to take this into account.  Losing more than saving could also carry additional penalties.  It's just the game over aspect of a few casualties that seems to need rethinking.
Title: Re: Civilians... those little buggers.
Post by: BTAxis on January 24, 2008, 05:11:17 pm
About that, version 2.2.1, which will mainly be a bugfix release, will have the civilian death limit removed. Instead you will lose if you make too many nations unhappy, which happens if you let too many civilians die.
Title: Re: Civilians... those little buggers.
Post by: EuchreJack on January 26, 2008, 10:38:17 pm
Mustang said:
Quote
Most civilians would run to the drop ship once they saw it because it would represent their only safe area, even if it meant exposing themselves to worse danger than than hiding.

However, Phalanx is a covert operation, so it's unlikely that most civilians would recognize the drop ship as a safe area.  In fact, the dropship of Phalanx might be mistaken by less knowledgable civilians as belonging to the alien invaders (but this is unlikely since the Phalanx dropship started life as a civilian transport).  I guess in some cases, the civilians might see the dropship as human in origin, and hope that they can hitch a ride out to the battlezone.  Also, while I like the idea of subduing hysterical humans and putting them in a safe place, the idea of taking them away in the dropship is unsound.  After all, wouldn't the dropship be taking the maximum number of soldiers into combat?  I'm certain most players don't take less than 8 soldiers on a mission unless they have no choice (which is common considering the shortage of soldiers).  Still, it would be cool if a battle could be resolved by just fleeing with the civilians instead of fighting to the death.   ;D
Title: Re: Civilians... those little buggers.
Post by: eleazar on January 26, 2008, 11:43:22 pm
About that, version 2.2.1, which will mainly be a bugfix release, will have the civilian death limit removed. Instead you will lose if you make too many nations unhappy, which happens if you let too many civilians die.

Makes sense.
Title: Re: Civilians... those little buggers.
Post by: TumbleWeed on February 02, 2008, 11:29:45 am
Stun the civilians.
Title: Re: Civilians... those little buggers.
Post by: Cro on February 05, 2008, 06:07:35 pm
You should just make something like rally point for civs because dropship is not always on map.
So, civs will gather on one place and it will be easier to keep them safe.
Title: Re: Civilians... those little buggers.
Post by: BTAxis on February 05, 2008, 06:18:48 pm
We should also make the AI attack the rally point with explosive weapons so they can kill all the civvies at once, then.
Title: Re: Civilians... those little buggers.
Post by: SpaceWombat on February 05, 2008, 07:31:47 pm
I'm not sure about the rally points. This would look like the civs have a tactical plan. Certain points could be set as relative save positions for the civi AI to identify (one of them the dropship/starting position of your team).

If there is always one rally point the missions would look even more identical as they look now na dit would be more of a shoot out in front of the saloon than a tactical mission imho.  8)
There is no tactical advance in this as I guess.

There could be several characters attached to each civilian by random. Some will try to hide in "save positions", others flee to the dropship and some will run around trying to make as much feet between aliens and themselves as possible (they would probably be the first victims and hard to save).
Title: Re: Civilians... those little buggers.
Post by: EuchreJack on February 05, 2008, 08:32:51 pm
It would be cool if there was an item that a soldier could use to attract civilians, like Super-Cologne!
Seriously, it would be nice if the soldiers could at least direct the civilians somewhat, so they don't run into the arms of the aliens.
Title: Re: Civilians... those little buggers.
Post by: Styxarius on February 05, 2008, 09:42:06 pm
How about civs run chaotically from any alien they see - they might get stuck in some building and hide or get close to the edge of the map where some sort of escape algorithm will kick in and they will proceed to a designated escape point.
Title: Re: Civilians... those little buggers.
Post by: btfx on February 06, 2008, 05:17:03 am
Here's a proposal (since we know this isn't going to be changed any time soon we might as well aim high): The civilians are stupid and scared, so it makes sense how they would run at the soldiers screaming. But when three of them surround my best sniper and stand there oogling at him, the logic breaks down.

The idea for several meta AIs is a good one:
1. Civvie is clueless, he wanders at a leisurely pace until seeing an alien, a soldier, or a panicked civvie.
2. Civvie panics! He will run away from aliens he can see, though he might run into one without the TUs to turn around. If very close to an alien and with very low TUs he might crouch and make a mess in his pants, if he sees a soldier he will run towards him and bug him for a turn or two, something we all hate, but it is partly realistic.
3. If the civvie can't find help he may seek other civvies, this will actually make it harder for the player, and easier for alien AIs.
4. The civvie (or the small group they may have become) eventually gives up and hides in a corner, preferring 3 wall corners, in smaller rooms, and with fewer doors.

Now, while the civvie is bugging the soldier the soldier could use up TUs to direct the civvie to an area (as I understand the maps are already split into "areas"). Naturally the more complex the directions the more TUs spent. Civvies with weak mind attributes may make mistakes in their extra-stupid panicky state.
To keep things simple, the civvie restarts his stupidity process when he arrives, this means that their actions are not very deterministic, but the frustration factor is removed. They no longer suicide and block you do death, but you still get the feeling you're herding cats. Some may wander back into danger while others will stick around long enough to get to stage 4 and hide in a slightly safer corner.

Well, that's as overcomplex as I can make it =)
Title: Re: Civilians... those little buggers.
Post by: BTAxis on February 06, 2008, 12:03:27 pm
as I understand the maps are already split into "areas"

Unfortunately, this is only the case for random maps. Regular maps are a one-piece, so there are no such areas. It would probably be possible to define an area with a special brush, though, if support for it was added.
Title: Re: Civilians... those little buggers.
Post by: btfx on February 06, 2008, 03:42:21 pm
Hmm I hadn't thought of that. Also, has anyone ever thought of reaction shots to civvies? It's somewhat realistic, and would limit those silly camping strategies. Of course the probability should be low, otherwise it would be quite frustrating. It should be rare enough so that the player has time to forget the previous such incident.
Title: Re: Civilians... those little buggers.
Post by: Cro on February 06, 2008, 03:51:35 pm
Ok, no rally points, but they should react somehow when hey see aliens instead of ignoring them.

Title: Re: Civilians... those little buggers.
Post by: Psawhn on February 06, 2008, 06:56:44 pm
I'd also like to point out that, in later stages of the game, PHALANX soldiers are likely to be wearing more advanced powered armour and may be just as unrecognizable/inhuman as the aliens are.

To the civvie AI rules, I'd add that they would remember where the latest seen alien was for one or two turns, so it will run away just a little farther. I'd also add that they hide upon hearing weapons fire nearby (any gun or grenade discharge within 5-10 tiles) and wait a turn or two before roaming again.

I remember reading a proposal in the wiki about a new waypointing system: The existing pathing algorithm does not work well for longer distances (like aliens invading a base), so a network of nodes would be used by the AI for long-distance movement. Something like this would be good for civilians: If running away from an alien, it will choose the farthest node from the alien such that the path to the node does not take it any closer to the alien. If no such path exists, then the waypointing will simply try to find the furthest location from the alien (with existing pathing system), such that the path does not come closer to the alien and the endpoint is in a place with 2 or more walls.
Title: Re: Civilians... those little buggers.
Post by: florian on March 04, 2008, 06:15:09 pm
I wrote down some thoughts I had about a civilian ai system:

Each civilian has a mood, which changes dynamically and which has a value between 0 to 100.
This mood could be roughly divided into panic (<20), afraid (20-60) and cool (>60).

Events happening around the civilian can change his mood:
- If he sees an alien his mood decreases
- If he sees an alien being shot at or killed his mood increases
- If he sees a phalanx member or another civilian his mood increases
- If he sees a phalanx member or another civilian being shot at or killed his mood decreases
- If he gets shot or hears shots or explosions, but doesn't see anything his mood decreases
- If he's at the dropship or a phalanx meber talks to him his mood increases
- Every round the mood increases very slightly (this way the person slowly calms down)

How strongly the mood increases or decreases depends on the civilian itself. Every civilian has an increase factor and a decrease factor which get multiplied with the increase or decrease of that particalur event and added to the characters mood. A high increase factor and low decrease factor means the person stays cool most of the time. A high decrease factor and low increase factor, on the other hand, means that the person panics easily and is hard to calm down. If a civilian has picked up a gun his decrease factor will be even lower.

A soldier at a military base will have a low decrease factor and a high increase factor. A male civilian could have a medium decrease factor and a low increase factor, while a female civilian could have a high decrease and a medium increase factor. Of course these factors differ individually and could also depend on the place. An urban area might have noticeably higher decrease factors than a rural area.

The mood of a civilian influences his behavior. If he panics he will choose a random direction and try to walk that way. If he is afraid he will try to find a good hiding place behind a grate, desk, tree or inside an empty room. Finally, if he is cool he will try to get to the phalanx team or the dropship as quickly as possible (if he knows where that is). If a civilian sees a dropped gun and knows how to use it (all soldiers and a few other civilians should know), then he might pick it up. If he's cool he might use it to shoo at the aliens, but if he panics he might shoot around wildly and even hurt other civilians or phalanx members.

If a civilian panics, a phalanx member could talk to him and thereby increase his mood until he calms down to being afraid and hides somewhere. If a civilian is afraid a phalanx member could talk to him and so make him walk to the dropship.

If a civilian sees something negative (an alien, maybe even a dead civilian, ...) this place will be marked as a fear point. He can remember a small number of those fear points at the same time. If he is afraid he will search a hiding place away from the fear points. If he panics he will ignore those fear points completely. If he is cool and armed he might even go to those fear points and try to shoot the aliens. If he is cool he will try to get away from the fear point and to a phalanx member. If he sees a phalanx member he will try position himself so that the phalanx member is between him and the fear point.

The mood of a civilian also changes his speed. A civilian in panic is faster than an afraid or a cool civilian. This makes sure that a afraid civilian who has been hiding runs away quickly once he has been discovered and panics.

Finally each civilian has a property which indicates if he feels safest where he is right now. An afraid civilian who has found a hiding place won't move more than a step away from a safe place until he has calmed down to being cool or until he is found. A cool civilian, on the other hand, stays roughly where he is once he has found a quiet place behind a phalanx member, but he will search for a better hiding place once he has been discovered, gets afraid and doesn't feel save anymore. This last property is supposed to make sure that civilians don't run around unnecessarily and get in the way of the phalanx team.

The initial mood is influenced by the civilian's character and the distance to the aliens and should be either cool or afraid, but not panic. Additionally a first fear point for every civilian should be place over the initial position of the aliens. The distance is included because civilians who are far away from the aliens should be relatively cool and walk towards the phalanx team, while civilians close to the aliens should better hide somewhere and wait for the phalanx team.

With some fine tuning this could result in quite believable civilian behavior.
Title: Re: Civilians... those little buggers.
Post by: Panthera Leo on March 04, 2008, 11:26:03 pm
Great ideas. Anyone up for coding it?

Form orderly queues, please...

 LOL, An appeal to my dark side!  ;D

 I think that's my new favored quote! Do we have a FAQ or chart laying out how the source code is built. I don't have the time now, or in the foreseeable future, but it's definitely on my list of things that "might be fun". After finishing my bloody NWN Mod to get units to march in formation. It's almost done, just classes take too much time for me to sit down and get the work done.(Damnable script restrictions! The project is nearing it's err another birthday.)

The wiki (http://en.wikipedia.org/wiki/AIwiki) on the subject is not directly useful, but branches out to all manner of useful links.

The approach I would use?  First, in either method, make the absolutely huge data file. Running though every map, I would have each side (PHALANX, VXI, and Civi) have side move though every possible unit combination in every valid place to stand.

Then maybe make a second data file. Give every unit the ability to use any valid item available to it's side, move one square, or be shot at from any given enemy unit able to see it in a given senario. Seeing this is the AI I'll ignore PHALANX for the most part, and assume that the AI's stats are not totally random. I'll then automate some process to either make a formula, or do another loop for each set of stats. What this will do is give a expected outcome for any of the actions the unit does or has done to it(get shot at).

We'd then make a list. This list would look at the above, being just single actions, and string them together based on the expected outcome of that action. For example, I need to move up to enemies position to fire at "them". The above list would just have the 'move up'  or 'fire at "them"' actions, but they wouldn't be directly connected. It would just have a entrie saying, given this goal this is the most desirable action to meet that goal. In this case(not being able to desirable to fire at them now.) the entry for the current unit deployment to fire at "them" would list "move up" as the desired action.

So what this pass would do is string like entries together by looking at the above data file and following each entries, from entry to entry, of desired actions until it found a action that directly met it's goal(SHOOT THEM!). In this case it would link move left, move left, and FIRE! into a list. Each list would then be given a set of goals it was design to meet("I want to shoot this guy!") So the AI could then see what it wanted to do and have the actions need to meet that goal already laid out for it. Of course, we'd only make lists of actions that where longer then one action long :)  However, this too would be a massive, maybe even bigger, file and only marginally useful, thankfully it just happens to be useful, it's not the end goal!

Plan A:

Also, thankfully I happen to know a trick that should cut that down to size, and layer that into a easy to use format tied into the map file.  Each square on the map a unit can occupy is given a blank node(class object) containing a list of all possible actions. Then use the above file and list to populate each action in the node with how well each action will work to the desired goal. This node could also be altered to each AI unit on the map, with each AI keeping a list of the last it use from the last turn or two, then update the weight on each action based on what really happened to the AI. This way the AI could "learn" as the game progresses. Making each install, if not game, unique the more it's played. If you do that though I suggest a short term, that degrades over time, and long term weights. The AI using the sum of both, and only affecting the short term weight. Then a fraction of the short term changing the long term to keep freak accidents from wrecking the AI.

Plan B:

Each square on the would have a node(read as class object). This node would then be given a list of goals you can accomplish here, and actions that accomplish that goal, taken directly from the first data file. Not very useful for much. This is where the lists we just made comes into play, and gets narrowed down.

We'd go though the above lists starting with the first action of each list. We'd start at the node the first action was based off off. Then instead of giving a single action to do, we'd give a pointer to the first action in this list, and tell the AI to "hop to buddy!". We'd then move down to the second action in the list, and add a pointer from the node the first action leads us to to the second action in the list. and so forth. Associating each pointer we make with the outcome the list is to accomplish.

To keep the from accessing the map nodes every time it so much as moved, could be made to only look at the node network when it needs to. Looking ahead from node to node, storing a list of each action each node stores. Then either only accessing the network again when it's done or something changes enough it needs new instructions.

A CO:

Up to now the AI has been basically "every (man) for himself!" The CO would be a script that doesn't look at each unit as a single unit, but looks at each unit as one single "unit". Then looks what action(s) would most benefit the squad or best meet the squads goals. Then enforces those actions on the squad. So each unit doesn't have a AI per say. The "CO" script in the background is the one calling the shots, the units just look at the best way to follow the given orders. It also has the advantage of off loading the work into a central point that only has to be run once each turn, instead of over and over by each unit in turn.

Edit: Maybe even preloading plans of attack, or save passed successful actions.
Title: Re: Civilians... those little buggers.
Post by: NQue on March 21, 2008, 12:59:09 am
Hey all,

Wouldnt something simpler like the following work better? (And easier to code.):

When a civilian sees an alien, have it remember the square where the alien was seen, and move away from the block, towards an enclosed space (like a room in a house for example) for x turns, or until it (being dumb, that's all they deserve) sees another alien, in which case it moves as far away from the two aliens as possible, once again for x turns. That way, the civilians won't all end up in the corners of maps, but rather in, well, rooms. Also, if seeing a second alien reminds it of the first (i.e. the x turn count resets for both alien 1 and 2), then it wont just run back to the 1st alien. Unless of course, the alien has moved...

I like the earlier post about moving so that a PHALANX soldier is between the civilian and alien as well. It would make sense to me if I somehow found myself amidst alien-soldier gunfire.

This way, it wont be as easy for aliens to kill civilians (as is the case currently), but it is still not impossible.

In the case of self-arming and attacking civilians, it might be great to see happen, but I'm thinking it'll end up as a negative outcome. (Maybe that's a good thing for the game?)
Title: Re: Civilians... those little buggers.
Post by: Silveressa on March 28, 2008, 03:39:22 pm
Greats so far, but I'm sure I like the ideas of regular civvies arming themselves, since they're already terribly vulnerable, having them try and stand and fight is very likely to just rack up more civ deaths than them retreating.

However, maybe having a few extra civs thrown into the mix that don't count towards the civs lost limit (randomly appearing on some maps, not on every single one) that are capable of rudimentary defense and have a fair amount of armor/weapons. (Such as police officers with body armor and smg's or national guards men with rifles) After all, among the ones left alive by the time phalanx gets there, attrition should have killed off all but the most sneaky, capable, or plain lucky.

This would help add diversity to a maps a little, and maybe slow down the aliens a hair on exterminating the meat bags, since it would take them a few turns to nail the ones with guns and armor.

For now though just a simple alteration for the civvies to move away from sighted aliens would be helpful, until something more complex can be coded.
Title: Re: Civilians... those little buggers.
Post by: Robb77 on April 05, 2008, 02:48:00 am
About that, version 2.2.1, which will mainly be a bugfix release, will have the civilian death limit removed. Instead you will lose if you make too many nations unhappy, which happens if you let too many civilians die.

thank god ;D
Title: Re: Civilians... those little buggers.
Post by: Doctor J on April 05, 2008, 06:18:37 am
I just recently tried a multiplayer against the AI, which also included civvies.  These guys seem to behave different from those in the campaign game: rather than wandering towards danger they tend to stay in the corners of the map and crouch down a lot.  Am i just imagining this, or can somebody familiar with the AI code clue us in?
Title: Re: Civilians... those little buggers.
Post by: blondandy on April 05, 2008, 06:52:05 pm
In trunk?

I think it is only very recently (ie not 2.2) that the AI made anyone crouch.
Title: Re: Civilians... those little buggers.
Post by: Doctor J on April 06, 2008, 02:06:29 am
I just saw it again on 2.2-Jan 15-OSX build: started a non-public coop2 multiplay, and forced start.  After the bodies start hitting the floor, the remaining civvies cower down with their hands over their heads.  If there is anything else i can do to get to the bottom of this mystery, let me know.
Title: Re: Civilians... those little buggers.
Post by: mutant on April 06, 2008, 05:15:12 am
Civilians have always done this since the first released demo as far as I'm aware.
(Once saw a civilian crouch and pickup a kerrblade as well!)
Title: Re: Civilians... those little buggers.
Post by: BTAxis on April 06, 2008, 12:41:01 pm
I'm not sure how useful it would be to investigate this in detail. bobbens is working on a complete rewrite of the AI. It's anyone's guess when it'll be done, though.
Title: Re: Civilians... those little buggers.
Post by: Doctor J on April 06, 2008, 06:01:23 pm
Civilians have always done this since the first released demo as far as I'm aware.
(Once saw a civilian crouch and pickup a kerrblade as well!)

This whole thread got started because civilians in the campaign game make absolutely no effort to hide, but instead are magnetically attracted [animal magnetism?] towards the aliens.  It seems weird that civilians in multiplay are so much smarter.  Maybe they can set up some classes for the others?
Title: Re: Civilians... those little buggers.
Post by: mutant on April 06, 2008, 11:05:01 pm
I haven't tried the multiplayer so I wouldn't know but I don't see why they should act any differently.
Title: Re: Civilians... those little buggers.
Post by: Falion on April 17, 2008, 10:05:58 pm
Now that I've played for a bit, I can say the Civies are morons much of the time as well :) They either go right towards the aliens to be slaughtered like lemmings, or they somehow attach themselves to one of my soldiers hips and follow him/her around like a puppy...quite irritating little guys they can be at times.

I can somewhat understand the second one...if big bad aliens were looking to give "me" a dirt nap, I'd be hanging close to the guy with the big gun as well. But honestly...if I had the choice...I'd be making tracks for places unknown and getting out of dodge and away from the firefights if at all possible.

Now as to the first...and why they just seem at times to march towards their own destruction...that kind of baffles me...have they been drinking some type of AI adult beverages or something? ;D

The game itself is really on it's way to being something really great IMO once it's finished, so not really moaning about the civilians, but in all they could stand a little "awareness" improvement :)
Title: Re: Civilians... those little buggers.
Post by: Silveressa on April 17, 2008, 11:05:48 pm
Hmm, I can think of one reason why they're so stupid. Usually Phalanx responds  after a good 12 hours  (or more) have passed right? By then all the smart ones have probably already left and the aliens are experimenting with the left overs to see if they make good pets or not.  ;)

Perhaps the simplest "hot fix' for them is to make a civilian move in the opposite direction their being shot at from for 2-3 turns? It would alleviate the lemming syndrome and them aimlessly wandering back and forth in the same path like a tin duck at a shooting gallery.
Title: Re: Civilians... those little buggers.
Post by: Doctor J on April 18, 2008, 08:40:10 am
Hmm, I can think of one reason why they're so stupid. Usually Phalanx responds  after a good 12 hours  (or more) have passed right? By then all the smart ones have probably already left and the aliens are experimenting with the left overs to see if they make good pets or not.  ;)

ROTFL!
Title: Re: Civilians... those little buggers.
Post by: Smig on September 22, 2008, 05:36:56 pm
I think you're aiming too high. I don't think so much work should be put into civies AI, all that complex behaviour would take forever to code but some basic improvements should be done.

More important than improving them and making them act as if they'd actually want to preserve their existence, I'd be happy if those things that break the game could be eliminated. I'm talking about 2 things, the most obvious has been talked a lot in this thread: civies should be coded to run in the oposite direction of aliens they can see. This should be fairly simple and would do a lot for game imersion and gameplay. If you're worried this would make it too hard for aliens, difficulty should be raised through other mechanisms instead.

The other is probably even more frustrating and I see no one talking about it but it's perhaps more dificult to fix. I'm new to the game but on 2 missions already, civilians have blocked my way in ways that made me shot them down out of frustration. In the convoy map, there's a tile to the right of the first truck, where movement is blocked in all ways because of the hill and is only possible to the left onto the road. I took cover there with a soldier when a civilian decided to end the turn on the only tile I could exit to. Ok, I thought that that was bad luck... before that vegetable decided to plant on that tile for 3 consecutive turns! The other mission where that happened was a military bunker map where one of the lower entry points is only 1 tile wide at one place and 2 civilians kept fighting for that particular spot for some reason. My soldiers were at one end of that corridor while an alien was at the other end, I couldn't do anything else other than wait the 3 turns it took for the aliens to kill them.

It would probably be easier to modify the maps to minimize those situations but it would be great if an algorythm would be developed to make the civies avoid tiles that would potentially block pathways... or at least avoid tiles they've ended their turns before so that if you're unlucky enough to be stuck, you'll only be stuck for one turn.
Title: Re: Civilians... those little buggers.
Post by: El Zoido on September 22, 2008, 09:50:56 pm
on 2 missions already, civilians have blocked my way in ways that made me shot them down out of frustration.

The military installation map nearly made me cry out for that.
Every time one of my soldiers tried to go up a stairway or through a door, a civilian came, blocked it and wouldn't move anymore.
Only if none of my soldiers were close to any such obstacle, the civilians instead opted for suicide and ran to the closest alien.

Title: Re: Civilians... those little buggers.
Post by: Kiashu on November 10, 2008, 06:09:41 am
if a civilian is smart enough to retreat inside PHALANX' area of control from the get-go, then the aliens will almost never be able to get that civilian. In other words, it'll be too easy to save him/her. Extrapolate this to all civilians on the map, and all PHALANX needs to do to save the civilians is stand around and wait for them to show up.
Not really. Because if all the civilians cluster around the dropship then the soldiers must stay there, and then a good solid zap with something explosive can let the aliens take out all the civilians and the soldiers in one go... and if they stay to protect the civilians, how will the soldiers hunt down all the aliens?

The civilians should at least not run towards the aliens...
Title: Re: Civilians... those little buggers.
Post by: Sophisanmus on November 10, 2008, 09:46:50 am
Perhaps civilians could prioritize running, and perhaps hiding, from aliens they have seen.  A second priority could be moving away from the hotter zones (i.e. areas where there has been shooting) could make them seem a little more scared and panic-y, and a little less overtly suicidal or zombie. 
Title: Re: Civilians... those little buggers.
Post by: TrashMan on November 18, 2008, 12:38:14 am
The Good Old Jagged Alliance 2 had a simple way to solve this:

1. you could click on the milita/civilian blocking your way  (telling him to bug out), and he would move next turn

2. Holding X and clicking on him, if you were on the adjecent tile, made you switch places with him. 8)
Title: Re: Civilians... those little buggers.
Post by: Duke on November 18, 2008, 01:27:10 am
2. Holding X and clicking on him, if you were on the adjecent tile, made you switch places with him. 8)
Haven't looked at the code, but that sounds like a quick solution to that annoying problem to me. At least much easier than developing AI strategies for civilians to 'not stand in the way'.
Oh, and maybe make it cost twice the normal TU.
Title: Re: Civilians... those little buggers.
Post by: BrimstoneVomit on February 07, 2009, 12:56:55 am
Hm, a lot of great ideas floating around in here, hard to add anything of my own since the civilians have been my only source of grief while playing the 2.2.1 build. Most mentions, I think, could really wait right up until the final build seeing as how there are vastly more critical elements to concentrate on before civilian behavior.

In the short term, aside from giving civilians more TU's to act on, the only fix I see necessary to make the universe wonderful again would occur in two prioritized parts:

1. Civilians will try their best to remove themselves from alien Line of Sight.

2. Each generated map should contain at least one structure coded to be recognized as a "safehouse" by civilians, who would in turn flock to it regardless of the contents* provided it does not conflict with #1.

*I only say "regardless of the contents" because naturally aliens could be skulking around inside without being seen.

In this sense, #2 could provide more of a challenge in protecting civilians at first; Civs may have already run too short of TU's to react if/when suddenly spotting an alien in a window, and even if nothing is spotted from outside, an alien lurking further in the interior could have it as easy as waltzing into the next room and say "boo!" But through the player's deduction (spotting civilians rushing toward/inside said building(s)), it could also help the player if they can secure the building(s) early and set up a defensive while other agents hunt down the aliens outside.

Sure it could be a little more refined. If a civilian starts in an enclosed room, regardless if within the "safehouse," they ought to stay put. Perhaps this idea is best suited for those out in the open. It's a thought, though.

In the long term, I'd be happy to see many of the ideas here incorporated, including:

- Civ "Mood"/Morale affects.
- Phalanx commands and sedation/retrieval methods.
- Self-defense abilities, albeit primitive. For instance, in the time it takes Phalanx to respond, any armed officials should already have given it a shot and died (e.g. police), leaving unarmored civilians with kitchen knives or the occasional handgun wetting themselves in their homes.
- The option to escape maps with survivors for Terror Attacks only. Otherwise, let's say for Military Bunker or Excavation Site attacks, it should remain mandatory to kill all aliens to preserve these tactical locations and not just the civilians.

These rascals could in many ways be a great device to enhance gameplay... When this project is pronounced "done." But immediately? I'd just be happy if they weren't blatantly suicidal.

Brimmy V.
Title: Re: Civilians... those little buggers.
Post by: blueberrypirate on February 12, 2009, 01:29:57 pm
Stun the civilians.

*lol*  does that work?  Does it count as a death for them?
Title: Re: Civilians... those little buggers.
Post by: BTAxis on February 12, 2009, 01:31:35 pm
No, stunning civilians is, at the moment, a prime method of getting them out of the way. Obviously this is something that needs to be improved.
Title: Re: Civilians... those little buggers.
Post by: geever on February 12, 2009, 01:44:47 pm
No, stunning civilians is, at the moment, a prime method of getting them out of the way. Obviously this is something that needs to be improved.

That was the method in XCOM either. Aand a method to save them in terror missions. :)

-geever
Title: Re: Civilians... those little buggers.
Post by: Coconut Jonlan on February 16, 2009, 12:52:25 am
The Good Old Jagged Alliance 2 had a simple way to solve this:

1. you could click on the milita/civilian blocking your way  (telling him to bug out), and he would move next turn

2. Holding X and clicking on him, if you were on the adjecent tile, made you switch places with him. 8)

nice solution - gets my vote
Title: Re: Civilians... those little buggers.
Post by: vedrit on February 16, 2009, 03:04:25 am
I vote for being able to knock out the civ by hitting them. Walk up to them and smack them till they are KO
Title: Re: Civilians... those little buggers.
Post by: Coconut Jonlan on February 17, 2009, 12:52:57 am
I vote for being able to knock out the civ by hitting them. Walk up to them and smack them till they are KO

Funnily enough I feel like doing that in real life sometimes - but to keep an element of realism in the game I think either have the civs run away from everyone or have a simple "Bug Out!" command - at least that way they don't end up blocking doorways and corridors for multiple turns.
Title: Re: Civilians... those little buggers.
Post by: vedrit on February 17, 2009, 02:22:40 am
I meant my suggestion both seriously and jokatively. If I hit you hard enough, I could knock you out. Surly the soldiers are strong enough to KO a civ (Though aliens would be another matter)
This could be a very simple and effective means to...temporarily remove living obstacles
Title: Re: Civilians... those little buggers.
Post by: Coconut Jonlan on February 17, 2009, 01:26:42 pm
I meant my suggestion both seriously and jokatively. If I hit you hard enough, I could knock you out. Surly the soldiers are strong enough to KO a civ (Though aliens would be another matter)
This could be a very simple and effective means to...temporarily remove living obstacles

Its not the case that the soldiers wouldn't be capable - its more that they are under orders to protect civs - not harm them - so they woud have neither the orders nor the inclination to throw punches at them.
you don't see UN peacekeepers delivering left hooks to civs in order to keep them out of harms way
Title: Re: Civilians... those little buggers.
Post by: vedrit on February 17, 2009, 10:45:31 pm
Its not the case that the soldiers wouldn't be capable - its more that they are under orders to protect civs - not harm them - so they woud have neither the orders nor the inclination to throw punches at them.
you don't see UN peacekeepers delivering left hooks to civs in order to keep them out of harms way

Pfft, thats because the UN is supposed to be perfect, and the media doesnt want to portray anything that doesnt show them as bad.
Irritation and anger cause people to do things they ordinarily wouldnt do, such as KO some one in their way. Besides, what harm is there but a few bruises? Their lives were saved, right?
Title: Re: Civilians... those little buggers.
Post by: Captain Bipto on March 02, 2009, 09:35:24 pm
How would one modify civvie behavior, which faction they are and equipment?

p.s. I did check the wiki but I could not find anything.
Title: Re: Civilians... those little buggers.
Post by: BTAxis on March 02, 2009, 09:38:17 pm
Faction? They're civilians. Equipment? They don't have any. Behavior? You can code LUA AI scripts for them.
Title: Re: Civilians... those little buggers.
Post by: Captain Bipto on March 03, 2009, 07:31:08 am
I know that they do not start with equipment and that they are a seperate faction (some other post mentioned this as a possible reason for civvies shooting at the human player's team). My question was which files would be responsible for determining their equipment and faction (to get them to stop shooting at me).
Title: Re: Civilians... those little buggers.
Post by: BTAxis on March 03, 2009, 01:42:04 pm
You keep talking about factions, but we don't have any. Civilians are humans, if that's what you mean. They're AI controlled, so they're on a different team, but they're not a "faction".
You can't edit their equipment, because they don't have any. All civilians start unarmed (though infected ones will start with alien weaponry - but this isn't finished yet).
Their behavior is dictated by the AI. If you change the AI so civilians will never shoot at you, you're set.
Title: Re: Civilians... those little buggers.
Post by: MachineGun on March 08, 2009, 12:25:00 am
Ha ha! Those civilians are brainless!

Now, if you could just tell them to hold still, they'd make great body shields.
Title: Re: Civilians... those little buggers.
Post by: Captain Bipto on March 08, 2009, 05:12:37 am
Evil evil.
Title: Re: Civilians... those little buggers.
Post by: keybounce on March 08, 2009, 08:02:29 am
That was the method in XCOM either. Aand a method to save them in terror missions. :)

-geever
Naaarrgh! Now you tell me :-).

OK, stun bombs on civies to keep them from being killed. I bet it doesn't work if a cyberdisk blows up :-).
Title: Re: Civilians... those little buggers.
Post by: Captain Bipto on March 08, 2009, 08:29:27 am
Okay I am sorry but IMHO there should be a small chance of having a civilian who does not just run away from the aliens, instead trying to *defend* themself from the alien scum. Having one gung ho civvie on the map would present the player with an option of trying to get to rambo's location if not just to make sure he or she doesn't provide an easy kill to the aliens.

I understand the premise of the game is that PHALANX are the hardy protectors of Humanity, but surely there are non-PHALANX members who would be willing to put up a fight against the aliens.

I am not saying that there should be paramilitary forces on every map played but that including one or two every once in a while could add something to the game.

Title: Re: Civilians... those little buggers.
Post by: Silveressa on March 08, 2009, 09:13:07 am
Perhaps making these few "brave defenders" appear as police officers would work well? (Logically they would be the people most likely to confront the enemy rather than cower in fear)
Title: Re: Civilians... those little buggers.
Post by: Captain Bipto on March 08, 2009, 09:35:41 am
Remember Humanity is full of unbalanced people (wow alien scum have invaded my hood, screw running ...lets go gunning mofos!)...Policemen may flee a scene (do you blame them!)  while a brave few form a last stand, and vice versa.



 
Title: Re: Civilians... those little buggers.
Post by: Kaz on March 09, 2009, 06:26:39 pm
There is also the issue with the military personnel in the convoy mission.

Cheers!
Title: Re: Civilians... those little buggers.
Post by: Captain Bipto on March 09, 2009, 07:30:54 pm
Yeah well who knows exactly how convoy will turn out (except the devs of course) seeing as they are still working on the game so cut 'em some slack.
Title: Re: Civilians... those little buggers.
Post by: BTAxis on March 09, 2009, 07:35:32 pm
I don't know if "military civilians" will ever happen on convoy. It's just a map like any other, and the game doesn't treat it differently. that means the civilians will probably always wear plainclothes, and they will probably never be armed (unless siding with the aliens).
Title: Re: Civilians... those little buggers.
Post by: bolter on March 15, 2009, 08:34:13 pm
I think the best possible fix to the Civ AI in the near term is to add an attack to all primary weapons: "Riflebutt," which costs 8 TUs and does enough damage to stun an unarmed human of average health.

Forcing us to waste our soldier's TUs on loading up a stun rod because a civ is humping his/her leg is just cruel.

Title: Re: Civilians... those little buggers.
Post by: val on October 08, 2010, 05:27:55 am
Waitaminute.  Why isn't anyone talking about the other effects an alien invasion?

To give a couple:

When a riot happens, there are some people that benefit from it.  Probably there's going to be some thieves or thugs or other such stuff about.  Which can be a real pain in the **s if one of them takes an interest to you, or even more so if points are deducted when theft is committed right in front of a soldier and he doesn't interfere.

Old wounds run deep.  There might be civilians shooting or fighting each other for vengeance during the chaos.

At least some civilians are going to be armed.  They might either make a stand against the aliens, or use the chaos to settle some grudges.

And finally, once word gets around, there's going to be militia groups.  You'll want a commanding AI for those.  They'll also be better armed on average than the regular civilian.

Title: Re: Civilians... those little buggers.
Post by: Thrashard96 on October 08, 2010, 09:44:07 pm
well, the civs might steal some alien tech
Title: Re: Civilians... those little buggers.
Post by: Hertzila on October 08, 2010, 11:06:16 pm
well, the civs might steal some alien tech

And then proceeding to either being incapable of using it or shooting themselves in the foot with it.
Title: Re: Civilians... those little buggers.
Post by: Sarin on October 08, 2010, 11:59:04 pm
That'd be an entirely new can of worms. Scenarios like civvie hiding in ruined building, sees an armored figure, shoots at it...turns out to be PHALANX soldier who automatically returns fire...whoops. Civvie dead.
Title: Re: Civilians... those little buggers.
Post by: val on October 10, 2010, 05:20:18 am
Well, he asked for it....
Title: Re: Civilians... those little buggers.
Post by: Thrashard96 on October 10, 2010, 08:12:18 am
true.
Title: Re: Civilians... those little buggers.
Post by: ManicMiner on October 12, 2010, 10:21:09 pm
Just a thought:

1. When a terror mission raid begins, generate a random value of, say, 30 citizens (+ random modifier according to map size).

Drop one for every 1 hour that passes between the notification of the terror raid, and the arrival of the dropship. At the end of the mission, reimburse one citizen for each hour the dropship was in the air (after all, it's not like the grunts can teleport to the mission site so in-flight deaths shouldn't be held against them).

So you get something like this after the mission

N civilians saved

X civilians killed by aliens
Y civilians killed by friendly fire
Z civilians killed before we responded

Success of mission = N / (X*Y*Z) * (modifier based on nation's happiness rating)

It wouldn't involve AI changes but would incentivise you to respond as fast as possible to terror missions.
Title: Re: Civilians... those little buggers.
Post by: Hertzila on October 12, 2010, 11:47:52 pm
So you get something like this after the mission

N civilians saved

X civilians killed by aliens
Y civilians killed by friendly fire
Z civilians killed before we responded

Success of mission = N / (X*Y*Z) * (modifier based on nation's happiness rating)

While that could work as a new way to calculate how much a nation's happiness (and in which way) changes, I'd think those values should be weighted, like:

N / (0.5X+2Y+Z)note1

Otherwise it would mean that a civvie killed by PHALANX weights just as much as a kill by aliens in the different supranation's support for PHALANX.

note1 = You might have wanted to multiply them on purpose but, in that case, in the event that the player didn't shoot a single civilian (quite normal) you'd had divided by zero, which would not have worked.