OpenXcom Forum
OpenXcom => Suggestions => Topic started by: psyHoTik 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? :)
-
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
-
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.
-
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.
-
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.
-
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.
-
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 ;)
-
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 :)
-
*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. :)
-
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.
-
Hobbes, have you ever been told you are insane? :D
Yes, but there's a method behind my insanity. ;)
-
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?
-
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.
-
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 :(
-
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?
-
no, turnsSinceSpotted isn't used for aliens, it measures how long since an xcom unit was spotted by aliens.
civilians can see 20 tiles, but this is offset by their lack of ability to share information between units. (whereas the aliens communicate via turnsSinceSpotted, and the player can see and target any revealed unit, no matter who's selected or how far away they are)
-
Thanks for explanation, Warboy :)
no, turnsSinceSpotted isn't used for aliens, it measures how long since an xcom unit was spotted by aliens.
So, theoretically, if I add a routine in TileEngine.cpp that set it to 0 for alien unit every time it's spotted by civilian (FACTION_NEUTRAL) it should work without corrupting anything? Then I can refer to it in CivilianBAIState.cpp in similar way as in alien AI?
civilians can see 20 tiles, but this is offset by their lack of ability to share information between units. (whereas the aliens communicate via turnsSinceSpotted, and the player can see and target any revealed unit, no matter who's selected or how far away they are)
Well, even if in game reality civilians don't have means of communication between them (X-com probably have radios and aliens - some psionic link) they could hear screams and alien howls, which should be enough to run like hell from it's source :) I wonder if implementing this could increase their chances - still their low TU and health won't make things easy. I also wonder if there will be some difference if I increase the number of tries civilian take to calculate route (besides making hidden movement longer of course)
Also, if you don't mind teaching a noob - is there any function that could return position of X-com craft? My be useful for making civilians run to Skyranger by modifing setupEscape to favor tiles closer the craft.
-
Well, even if in game reality civilians don't have means of communication between them (X-com probably have radios and aliens - some psionic link) they could hear screams and alien howls, which should be enough to run like hell from it's source :) I wonder if implementing this could increase their chances - still their low TU and health won't make things easy. I also wonder if there will be some difference if I increase the number of tries civilian take to calculate route (besides making hidden movement longer of course)
I personally think it'd be superfluous; the observable changes wouldn't be worth all that work.
Unless you're thinking ahead of making armed civilians... :)
-
Ohh, the routine of "go to the Skyranger" would be immensely useful... but to implement for the aliens, not civilians :) After all, any sane commander would try to kill the intruders before they'll leave the landing craft (so eg. aliens could use first turns to converge towards the landing craft, and, say, after taking 50% casaulties, towards their own ship to take defensive positions).
-
hm.. civilians moving towards x-com craft.
hm... Chryssalids in pursuits of civilians.
hm.... chryssalids creating a fucking ton of zombies near x-com craft.
hm..... im am all for it!
-
I personally think it'd be superfluous; the observable changes wouldn't be worth all that work.
Not to mention it'll probably use CPU to the point of hindering the gameplay, may cause crashes and will break mod compatibility... Let's do it :)
-
If the changes aren't observable from player's point of view, it makes the game "play with itself" which is pointless.
-
If the changes aren't observable from player's point of view, it makes the game "play with itself" which is pointless.
I totally agree. All I want to do is to try to make my own build to test it. Nothing official.
-
I totally agree. All I want to do is to try to make my own build to test it. Nothing official.
That's great and fun if you intend to code it yourself.
We have preciously few coders interested in adding new features, so they shouldn't be asked to add something just for one person's amusement. Let's focus on changes that can benefit possibly the largest percentage of people, OK? :)
-
That's great and fun if you intend to code it yourself.
I do :) When I started this thread I thought that coding a game is totally out of my reach but now I see it may be actually fun to try ;)
-
I do :) When I started this thread I thought that coding a game is totally out of my reach but now I see it may be actually fun to try ;)
Cool! Good luck then! :)
-
now that all the opinions are out of the way...
no, there is no such function.
you could iterate tiles looking for a floor marked as "entrance" but this is far from foolproof
-
I think that can be implemented without mush of code rewrite if we don't need to write fight functions completely for civilians. Civilians don't have sprite when holding weapons so they look weird when you give a gun. But they can throw something, like kitchen knife that actually an instant grenade with invisible explosion and one tile distance blast. Technically when they tries to escape, calculate a chance to throw knife, give a knife to his hand, find nearest visible target and throw knife.