# Talk:Why civilians go rogue

## Brief

This section is actually intended to be a technical explanation on why they go rogue after being mind controlled - not just a brief on how it's done. I cannot explain why stunning them does this at this time, but it'll come eventually.

All units in the Battlescape have an ownership flag (i.e. belongs to Alien, X-Com, Civilian), and a flag that tells the game that the unit is currently under mind control (which is a binary flag and contains Yes/No, True/False or if you prefer, zero or non-zero values only).

When a unit is mind controlled, the ownership flag is automatically set to the mind controller's side and the temporary mind control flag is set to true. At the end of the turn, the game checks all units to se if they've got the temporary mind control flag set to true. If found, it is set to false, and then the ownership flag is flipped to the other team's side.

The ownership flags look like the following:

X-Com = 0 Alien = 1 Civilian = 2

On the computer, true/false statements are done with 1's and 0's. 1's are actually meant to be non-zero valus, and can be be any number except 0's.

So, when you mind control a civilian, their flag changes to Owner = 0, Under Mind Control = 1

At the end of the turn, the game finds that the civilian is under mind control, it sets this to 0 and flips the ownership flag from a 0 to a non-zero. This is done by a simply binary NOT function (or a set of conditional statements that effectively achieve the same thing).

A NOT function simply inverts a zero into non-zeroes, and non-zeroes into zeroes. On the computer a non-zero value is often simply expressed as a 1.

Notice what's going wrong here? It's flipping a 0 into a 1, which is the value for an alien unit instead of remembering what faction the unit originally belonged to. In fact, the game does not store this information at all.

It's almost as if civilians were either added in as an afterthought, or the programmers never ever expected players were going to use mind control on the civilians (aliens don't do it on civilians as a general rule - not that they possibly could not, they just don't have any instructions to do so).

For scoring purposes, civilians killed when they are under civilian control will deduct a certain amount of points from your final score. However, a civilian under alien control (or your control, if you manage to fudge things a bit with Zombie's stun/Mind Control combination) will only add or subtract their 'unit value' to the score. Because their unit value is 0, they cost nothing.

A unit value is a number all your units get that tells the game how much to add or subtract when soldiers or aliens are killed. Civilians have this too. However scores are also awarded in other ways.

That's it in an overly elaborate nutshell.

- NKF

Good job, NKF! This should all be moved to the article itself --MikeTheRed 18:13, 1 Nov 2005 (PST)

Uhhem....Uhhem...NKF, move cough, the article! EsTeR

## Patience

Yes, patience little rhinocerous beetle. It's far too crude to be used as-is, but I'll make it available in the main section anyway, spelling errors and everything. It's just too - well, I'll borrow a phrase - head-hurty to read the way it is. Even to me, and I wrote it!

- NKF

"Yes, patience little rhinocerous beetle." ehehhehehe!!! EsTeR

Regarding spelling errors: I don't know if NKF needs it, but but the google toolbar, which is available for IE and Firefox, does spell-checking for Web forms-- including Wiki editing panels. I've used it on several of my longer posts, and it's pretty good. It does, of course, point out every bit of Wiki markup or Xcom-specific word, but it at least tells me when I mispell "their." --Papa Legba 13:41, 26 December 2005 (PST)

## Bug or feature?

OK, yes, this almost certainly a bug in the sense that it was unintended behaviour caused by a programming logic error. But... maybe it's actually realistic, appropriate. I have a feeling that if X-Com showed up in the middle of some really hairy situation when my life was on the line, and they mind controlled me, when I came back to my senses I may well see them as the enemy and start shooting at them with whatever was in my hand at the time. Spike 17:40, 6 September 2012 (EDT).

## Do stunned civilians go rogue too?

Does a similar thing happen if i stun a civilian? The Stun Rod page says "If they wake up, they will appear as aliens" (linking here), but i'm wondering what's going on behind the scenes. -- Jokes_Free4Me (talk) 09:53, 9 April 2015 (EDT)