Jump to content

Shot paths?


beb

Recommended Posts

Hi all! It's been a while since I posted. Just got back into play X-Com again.

It's so freaking addictive. I'm in my 6th month (in-game) playing Veteran and all I'm getting are floaters... lol.

 

Anyways I'm just curious if any of you know how exactly the shot paths are determined when you shoot...

I've looked through the Wiki but I don't think this topic's been covered.

 

I figure that the game first finds the path of a perfect shot from your unit to the target, then it applies the accuracy formula to determine the chance of a perfect shot. Random number is generated and if it falls within the perfect shot range (very small), the bullet/beam/missile takes the direct line to the target. If accuracy is not high enough then the ray is altered by a ray randomizer that changes the angle of the path depending on how much the shooter sucks. Magnitude of path change depends on firing accuracy.

 

I'm just speculating because I've always wondered how the game determines where the lead flies when you miss the thing you were shooting at... especially when I read the Wiki about unit heights, I'm sure the game makes a shot line and does some sort of collision testing with the line and the numeric representation of the battlefield.

 

I mean from what I can tell, the collision detection has to be somewhat complicated as it's 3D and there's directional modifiers for damage along with the factor of unit height. I don't suppose WHERE the shot hits on a target has any effect on damage though (ie. shot to the head of an alien facing you has the same effect as shot to the arm ).

 

Any insight on this would be really helpful; trying to make a similar game engine. :D

Link to comment
Share on other sites

That's roughly how I visualise firing accuracy to work. Works off a straight line (with destination being the bottom of the destination tile, and the source of the attack is up near the middle-ish of the source tile), then a random number is rolled weighted by your accuracy, then it offsets the line's destination +/- depending on what gets rolled. After that, it'll harm anything it is able to intersect with. It could do so with the original target even though the shot itself was a technical miss.

 

Throwing accuracy seems to follow a similar pattern. It gets a straight line to its target, then it offsets its X and Y coordinates depending on the throwing accuracy roll and then the object goes there.

 

- NKF

Link to comment
Share on other sites

Back when I was observing this carefully (scaling 320x200 up to 1440x900 with vertical chopping), it appeared that successful to-hit rolls were discernable by the perfect aim of the shot from the weapon to the center-of-mass of the target. Deviation for inaccurate shots...not really figured out, but it's plausibly proportional to the "degree of miss".
Link to comment
Share on other sites

Keep in mind that a units can and will be hit from multiple angles starting at the same source. Not sure if this affects where fatal wounds are distributed to.

 

There have been quite a few tests done around this type of thing, most of which are probably somewhere here in this forum section. I made up a specific scenario to log what sort of firing angles you should expect to see from a given firing accuracy stat. Can't for the life of me remember what the results looked like...

 

I assume you know about LofTemps? That is, the line of fire templates? All the scenary you see in the game is made up of a sandwich of these shapes, to create actual 3D models. Haven't seen anything to suggest that such models are used for units though we do know that some hover above the ground (civilians, for example).

Link to comment
Share on other sites

Nice, I didn't know about that file... That explains a lot of things. It's quite a clever solution to 3d hit testing.

But for entities like aliens / civs / soldiers, I don't suppose they use something different? Maybe they model it with a board; like so:

 

1. Get facing.

 

2. Project line of fire onto board, taking facing into account.

 

3. Depending on position of hit, assign damage to areas of body. ie.

 

***************************
*       *        *        *
* miss  *  head  *  miss  *
*       *        *        *
***************************
*       *        *        *
*       *        *        *
*  arm  *  body  *   arm  *
*       *        *        *
*       *        *        *
*       *        *        *
*       *        *        *
***************************
*       *        *        *
*       *        *        *
*  leg  *  miss  *  leg   *
*       *        *        *
*       *        *        *
*       *        *        *
***************************

 

(or maybe they just take into account height, and use a randomizer to set that damage to a random part of the body that is at that height...)

 

Hmmm this is interesting...

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
  • Create New...