Jump to content
TSan98

How do I change the shooting logic?

Recommended Posts

Posted (edited)

By this I mean how do I change how the game determines what a shot hits.

For those who don't know, XCE makes it so that, when a weapon is fired, the game first checks if the shot hits any obstacles between the shooter and the target, then it checks if the shot hits the target.

This is the opposite of vanilla behavior where the game first checks if the shot hits, then, if it misses, it checks if the shot hits any obstacles.

I want to know how to revert this change because I modded my game so that it's possible to get 100% hit chance, and it frustrates me that, in XCE, I don't actually have 100% hit chance when it says I do.

Edited by TSan98

Share this post


Link to post
Share on other sites

How did you test that vanilla doesnt have that kind of behaviour ?

Share this post


Link to post
Share on other sites

I applied the same modification of making it possible to get 100% hit chance to vanilla, and made shots that state that they have 100% hit chance.

Never had a single shot that had 100% hit chance hit anything other than the target in vanilla.

Share this post


Link to post
Share on other sites

Regardless of my knowledge of Xenonauts' code, there's still the problem in Community Edition where a 100% hit chance is not an automatic guarantee that a shot will hit the intended target.

Share this post


Link to post
Share on other sites

Worst case scenario you have to change the binary, but the XCE team announced their last version will very most likely be the final version released, and best case scenario you would find something in the moddable files, but i dont know anything about that.

Share this post


Link to post
Share on other sites

Interesting, given how the lambda player is only informed that hit chances resulting from accuracy, weapon and distance (e.g. 100% or 68%) are decreased relatively to a cover's percentage (e.g. 25%), as displayed during the aiming animation (e.g. (100-25)x1 = 75% or (100-25)x0.68 = 51%).

So, if I understand well, you are saying that:

  • with Community Edition, a 100% chance shot through a 25% cover:
  1. Hits cover 25% of the time (first test);
  2. Hits target (100-25)x1 = 75% of the time (a 1:3 ratio);
  3. Misses the target (100-25-75) = 0% of the time.
  • with vanilla Xenonauts, a 100% chance shot through a 25% cover:
  1. Hits target 100% of the time (a 1:1 ratio);
  2. Hits cover (100-100) = 0% of the time.
  • with Community Edition, a 68% chance shot through a 25% cover:
  1. Hits cover 25% of the time;
  2. Hits target (100-25)x0.68 = 51% of the time (a 1:2 ratio);
  3. Misses the target by a few squares (100-25-51) = 24% of the time.
  • with vanilla Xenonauts, a 68% chance shot through a 25% cover:
  1. Hits target 68% of the time (a 2:3 ratio);
  2. Hits cover (100-68)x0.25 = 8% of the time;
  3. Misses the target by a few squares (100-68-8) = 24% of the time.

These ratios are both different and simple to test enough to assess whether the shooting logic in vanilla and XCE are different.

Are the info displayed during aiming in vanilla Xenonauts also different?

Share this post


Link to post
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

×