Talk:Line of sight

From UFOpaedia
Jump to: navigation, search

I just noticed this page, thanks to the new mock main page... I had been thinking of making the same thing; thanks Eth! ...

It would also be useful to see an exact radius of visualization, so you can know e.g. exactly where you might stand and be out of sight of an alien exiting a UFO (or otherwise try to "time" how many TUs they'll have left when they do)... it's easy to count 20 straight laterally, but it's not so easy on a diagonal. I'm thinking a diagram sort of like the bomb-blast patterns... I wouldn't be surprised if it can simply be computed using the same walking TUs method. I'll test it soon.

Also, do you know if different elevations affect distance? If you're 20 away on the same level, then rise up one, are you still 20? (Can you still see them?) One would presume not. I can test that shortly, too.

Also TBD: Illumination distance of electroflares. I just checked the wiki and it doesn't seem to be anywhere. I can test that. Then there's e.g. city lights and a number of other light sources... checking MCD[58] vs. my MCD database, I see that there are 11 terrain entries that produce light: 7 alien base objects, 2 XCOM base ground tiles, and 2 city objects (street lamp and large standing room lamp). They all have an illumination rating which in theory could be tested. But the flare is most important.

So many little questions, so little time :P

---MikeTheRed 16:56, 1 June 2006 (PDT)


Sure thing. I made it to answer a question to myself: can I stand beside an alien and not be noticed? (Answer: yes.) Particularly important info when you're trying to use a Stun Rod.

As for being out of sight of an alien coming through a door, short of being around a corner, I'm not sure what works. I've been testing it a bit lately and I can stand outside a door (far to the side) and the alien can still sometimes turn and shoot me before I get off a reaction shot. I'm not sure how the code is written in this respect.

A pretty big mystery is visibility around corners: for some reason the aliens can see you coming, the bastards. I've done preliminary testing of "where not to stand", and if the corridor is narrow, the answer is "nowhere" -- they can see you when you can't see them.

Just today I noticed a strange situation where while climbing stairs I could see an alien about 8 squares away but it couldn't see me. I could shoot it with impunity. Go figure.

Another big one to test is the illumination radius of fire: a lot of players use IC rounds instead of electroflares.

-- Ethereal Cereal 19:51, 1 June 2006 (PDT)


Right, I just noticed when assaulting the second floor on an Abductor, the last alien was outside the UFO's control room by the door there... just like you say, he could shoot me when I could not see him. I tried it a bunch of times. This is before good armor and most every shot is lethal. Even worse, there also was no way I could get a prox grenade back near him. This was on a Superhuman mission early in the game and I had ONE GUY left, due to darkness and to psi attacks on a crew that was largely easily controlled.

I recently noticed that stair strangeness, with the farm cottage stairs. Coming down them, I did not see an alien to the left of the stairs that I really think I should've been able to see. I didn't see him until I got off the stairs. Is it possible that the game considers "eye level", and thinks your eyes are still "upstairs"? That could be tested. Maybe your eyes are upstairs but your body downstairs?? Could something weird like that explain what you saw?

Right, I've often noticed that, at least in the early game, aliens get shots at me coming out a UFO door, even though I'm laying in wait with full TUs. However, I haven't actually looked at each person's stats and worked out the reaction formula per se... maybe their stock reaction stats are much better than mine? I dunno.

I've got a game set up to test electroflare illumination, and should post that soon. I personally don't use IN rounds because they're not good weapons, cost money to use, and make obscuring smoke. I'll let somebody else test that :P

---MikeTheRed 15:20, 2 June 2006 (PDT)


For the record: In making the visual-range-20 map, I found that it follows this equation:

Distance = ROUNDUP( MAX(X,Y) + MIN(X,Y)/2 )
where X and Y are positive offsets from Ground Zero

which is slightly different from the walking TUs equation. Some tiles are 1 "closer" due to rounding up instead of truncating. This also means that visual range is slightly less than explosive range. Not that it makes much difference, though.

---MikeTheRed 15:02, 5 June 2006 (PDT)


I'm not sure I understand the new diagram, particularly why the diagonal goes 2 3 5 6 8 9 ...

Am I to understand that, for instance, all squares marked '9' represent the outer edge of a soldier's nighttime vision? (If so, you should add a second colored region to represent the outer edge of nighttime vision.)

--Ethereal Cereal 16:06, 5 June 2006 (PDT)


They're just the result of the equation shown above which gives me 20 at the right places, but they don't otherwise have significance. Maybe on the direct laterals (in yellow) but nothing much otherwise. They are used by my autoshader which grays in anything over 20. But I can make the numbers the same color as background so the numbers don't appear. What do you think is the best way to handle it... an explanatory note in the caption saying they don't mean much? Or take out the numbers? Or...? "9" here does not match the Nightvision 9, although borders could be put in for Nightvision (by hand) so the pic does double duty.

---MikeTheRed 16:18, 5 June 2006 (PDT)


My preference would be to take out the numbers, and add a shaded region which represents the nighttime radius.

Got a new puzzle to suggest while we're here: what's the game mechanism for smoke vs. visibility? It does seem as though there are multiple smoke densities (byte 8 in SMOKREF.DAT?).

I've recently been experimenting with smoke-based tactics. Like so much in X-COM, it can work really well if you know how it functions.

--Ethereal Cereal 16:42, 5 June 2006 (PDT)


Give the new map a look.

I don't know much at all about smoke. Others like NKF and Zombie may know a lot. It would be interesting to see tactics based on knowing how it works. FWIW MCD[51] might (or might not!) function similarly... amount of light blocked, with values 0-10.

---MikeTheRed 17:40, 5 June 2006 (PDT)


Looks good now.

--Ethereal Cereal 15:05, 6 June 2006 (PDT)


Eth, see my addition to the page. I noticed this while triple-checking my visual range map as I played more. This new info somewhat confuses the definition of "visual range" but I didn't want to re-write the whole page. (It also may be why some have stated the range as 21. However, enemies are only visible to 20. This includes the visual range of MC'd aliens.) Feel free to re-write, if you want.

---MikeTheRed 18:31, 7 June 2006 (PDT)


That is interesting. I think your note explains the discrepancy well enough, it doesn't warrant a rewrite.

It's definitely useful info, though: I assumed it was enough to "sweep the black" out of the corners, but now I see I'll have to go a couple of steps further, especially when flying. Nice find.

--Ethereal Cereal 20:18, 7 June 2006 (PDT)

Sectoids and Fences

While working on "augmented side swapping", I ran across a weird situation: being able to reaction-fire doesn't confer ability to see.

I was trying to get a sectoid to where it could shoot at one of my soldiers, but it took reaction fire without being able to see the soldier. Side-swapped...and the reaction-firing soldier couldn't see the sectoid either. But could fire at its square. The sectoid was incapable of targeting the soldier's exact square.

I'm guessing that the game has "eye level" and "weapon level" for each of the unit types, and is using a very simple "line to centroid" for determining both visibility LOS and firing LOS. Fences are capable of blocking only one of these LOS computations. Furthermore, reaction fire may be triggered only by entering firing LOS. [This may be too precise to correctly predict the known blind spots.]

Question: are "eye level", "weapon level", and "centroid" computed or explicitly stored in the game files, and which ones?

--Zaimoni 15:13, 15 August 2006 (CDT)


I have regularly found blind spots sighting sectiods and snakemen behind fences. These vary whether your soldier is standing or kneeling.

Another common blind spot is when spotting an alien that is at a different elevation. I suspect intervening terrain, such as the crest of a hill, is considered differently when LOS is calculated in each direction. For example, I've often found that a cyberdisc hovering on the 2nd level, hiding in a building where the 2nd level walls are present but the 1st floor walls/doors are gone, is in a blind spot.

- Egor


Line of Sight is not Line of Fire. I just verified this the hard way on a desert map/Sectoid Medium Scout.

Line of Sight takes into account the sighting unit's elevation. Line of Fire doesn't take into account the firing unit's elevation. The dune I was standing on, was blocking my line of fire. [No comment about the target's elevation.]

Also, the "during alien turn" vision rules are a bit different. In farm terrain, this allows abuse of those low stone walls -- when crouching, they block line of fire, and permit seeing aliens past them only during the alien turn at a variety of ranges. (Not thoroughly tested, so this abuse may fail at very close or very long range).

--Zaimoni 12:06, 23 Nov 2006 (CST)

Back testing side-swapping...and experimenting with "suppression fire". [Did a reinstall of XcomUtil without the SHP:CFG flag -- the viability of the extended Interceptor as a mini-troop transport is critically dependent on defective AI.] Beyond range 20, the targeting is weird: empty space is not (reliably) targetable, and even with an object to target an unsighted alien in the square will block LOF. Sighted aliens are valid targets.

--Zaimoni 11:03, 1 Jan 2007 (CST)

When unseen aliens block LOF towards an object you can use that to fire at the alien. It is a matter of trying to figure out the locatin of the alien and firing there. If there's a clear LOF you'll either manage to fire at it (although hitting is a different matter...) or miss altogether. Doesn't work all the time but if you have 2 or 3 rocket launchers it can make quite a difference...

Hobbes 15:41, 1 January 2007 (PST)


I'm starting to get frustrated. Aliens seem to partially ignore LOS. For example: I stepped in with a soldier to get the alien's attention. From then on, it continually faced my direction (remembering where I am, this is normal). However, when I moved in with a different guy to try to stun it from behind, it turned to face him (with the soldier hiding behind a wall), even though it didn't see him coming! So what I'm trying to tell you is that aliens seem to always know where the nearest soldier is and face him/her, regardless of LOS. This is the main reason why Stun Rods are ineffective: you can't sneak up on an alien without it knowing.--amitakartok 14:51, 14 November 2008 (CST)

I've been wondering about this. It seems to apply to some aliens and yet not to others. Must be depending on what they've been instructed to do at the moment (patrol or pursue, or whatever). In which case you could probably move a soldier up as close as possible while being hidden by a wall, and then have another soldier a little further away rush in and attack the distracted alien later. If it applied to every alien, you'd never have to worry about getting ambushed while entering a UFO bridge ever again, but as it doesn't every time so cannot be relied on.
Note, you might want to get some practice in TFTD with the power drills. Truly brilliant weapons that make in-door combat a breeze. UFO's stun rod is slower so might be harder to use, but nothing impossible to work with. By the way, consider using the mind probe to gauge the aliens' remaining TUs before you rush an alien with a stun rod. -NKF 17:18, 14 November 2008 (CST)

Question: did this behaviour happen before, or after, Turn 20? After Turn 20, the aliens know the positions of all your units, which might be the explanation of why you can't sneak up on them. Though I would not expect that information to be updated on XCOM's turn. But who knows. Spike 16:49, 15 November 2008 (CST)