Author Topic: Accuracy problem?  (Read 8548 times)

Offline xxbbcc

  • Squaddie
  • *
  • Posts: 8
    • View Profile
Accuracy problem?
« on: May 28, 2016, 10:38:46 pm »
I'm not sure if this counts as a bug or not but I think I may have found something funny regarding shooting accuracy. I had this feeling for a while now - ever since I downloaded OpenXcom a few months back) that the actual accuracy of my soldiers is much lower than shown. Until now I only had a few cases of fully reproducible setups, though - it's very hard to tell if a soldier misses because of chance or because of a bug that lowers the accuracy (well, hard without a debugger, anyway).

I'm using the openxcom_git_master_2016_05_11_1842.zip nightly build on Windows 8.1 64-bit with 32 GB RAM. There are 2 mods: UFO Redux 0.8 and my personal mod that tweaks UFO and UFO Redux. I have the "UFO Extender Accuracy" and "Save scumming" options enabled.

In the attached save game, the currently selected soldier (Fredrik Eklund) spotted a Sectopod about `5 tiles away. The Sectopod is in shadow but I tried lighting it up and the outcome hasn't changed.

The soldier has a 116% hit chance with the laser rifle (40 TUs) but every single time the shot misses - the soldier (for my tests) invariably fires into the wall just to the right of the Sectopod. I tried this 50+ times (reloading each time), exactly with the same results each time. The angle of fire is always away from the line of sight to the Sectopod by a few degrees upwards.

With a 116% hit chance, I'd expect that I would've hit the Sectopod almost every single time I tried. I realize that my manual reloading & retrying the shot is not terribly scientific but having tried 50+ times, I think there's something wrong.

Am I misunderstanding the meaning of the 116% hit chance? Or is this a line-of-sight bug? (It's arguable whether the soldier should even be able to see the Sectopod.) Or, is this an accuracy bug where one accuracy is displayed but a different value is used for shots?

Note: I removed / replaced some resources in the attached file to keep the file size down - the game should be loadable anyway but if it fails, just get the release of UFO Redux 0.8.

Offline Warboy1982

  • Administrator
  • Commander
  • *****
  • Posts: 2333
  • Developer
    • View Profile
Re: Accuracy problem?
« Reply #1 on: May 29, 2016, 06:47:06 am »
here's what your soldier can see, the yellow blob is the friendly soldier, the purple pixels are the sectopod. this is not exactly a "clear shot".
as for the displayed accuracy: that's a rough indication only, and very rough at that. even with 120%, there's a chance you'll miss the shot, just as with 0% displayed accuracy, there's a chance you'll hit.

Offline 7Saturn

  • Colonel
  • ****
  • Posts: 457
    • View Profile
Re: Accuracy problem?
« Reply #2 on: May 29, 2016, 11:14:37 am »
And this problem has been reported numerous times, like here.

Offline xxbbcc

  • Squaddie
  • *
  • Posts: 8
    • View Profile
Re: Accuracy problem?
« Reply #3 on: June 05, 2016, 06:57:45 am »
Thank you fot the responses. I understand the problem (and the explanation) but I think the behavior of the game - especially with UFO Extender Accuracy - is very confusing.

Having the accuracy update per tile (as the target moves with the mouse) definitely gives the impression that at a certain tile, the accuracy is what's displayed. The shown accuracy, however, is nothing but an upper bound (this would be fine if the value wouldn't update with mouse movement).

It may be worth considering some alternatives to this - the suggestion in the linked thread to use the visible part of the target could be a good start.

As is, I would still consider this a bug - regardless if the explanation makes sense for the observed behavior. The UI shows (and actively updates) a value that eventually has very little to do with the outcome.

Offline Solarius Scorch

  • Global Moderator
  • Commander
  • *****
  • Posts: 11730
  • WE MUST DISSENT
    • View Profile
    • Nocturmal Productions modding studio website
Re: Accuracy problem?
« Reply #4 on: June 05, 2016, 01:39:16 pm »
I'm not sure what you mean. Do you mean the % indicator should include obstacles? So if the target is behind a wall, it should always be 0% for bullets travelling in straight lines?
If so, I am against it. The percentage meter is very useful for calculating effective distance for a given weapon. I wouldn't like being unable to check the meter because of some terrain which I know perfectly well that it will stop the bullet.

Offline xxbbcc

  • Squaddie
  • *
  • Posts: 8
    • View Profile
Re: Accuracy problem?
« Reply #5 on: June 06, 2016, 03:00:42 am »
I'm not sure what would be a good solution - I need to think of this a bit more. Clearly it's not a trivial problem to solve as the other linked thread shows.

I very much like the target indicator and I wouldn't want it to go away but I also don't want it to show misleading information. Maybe instead of showing an accuracy percentage, it could show a drop in accuracy as distance from the soldier grows. So if the soldier has a base accuracy (with the current weapon) at 70%, the target indicator would show at first -0%, then - as the distance grows - the penalty grows as well: -5%, -10%, etc.

This way the UI never displays an up-to-date accuracy on the target crosshair so it's harder to assume that you have an actual 60% hit chance on an enemy when in reality it'll be closer to 5% at shot time. The player only sees the accuracy penalty going up with distance and the initial 70% base accuracy (that's shown when one pick the fire mode of the weapon). At this point, the real accuracy is only in the player's mind - you know you start with an optimal-case 70% and it gets lower with distance. The end number is the same but I believe mentally it's very different to see 60% vs -10%.

Maybe a trivial check for obstacles along the line of sight could be made to warn the player of additional loss of accuracy (without actually calculating this additional loss). I don't know if this is feasible, though.

Offline yrizoud

  • Commander
  • *****
  • Posts: 1014
    • View Profile
Re: Accuracy problem?
« Reply #6 on: June 06, 2016, 04:05:29 am »
The issue is not with the displayed %. It's that the algorithm which determines if you can fire (The message about no line of fire) is not the same that determines the ideal trajectory. The first one can say 'go on, it's clear', while the second makes the shot pass through a wall.

Offline 7Saturn

  • Colonel
  • ****
  • Posts: 457
    • View Profile
Re: Accuracy problem?
« Reply #7 on: June 06, 2016, 11:11:03 am »
Exactly. And therefore, especially the latter should aim at the part that obviously must be aimable at, when the former says »The way is clear (enough), go ahead!«. In case of a successful dice roll it should aim perfectly, in case of a negative dice roll it should deviate at least as much, that it doesn't hit the target. Which in these close calls can be that little... At least that's my understanding of the basic principles. Everything else is just difficult to place.

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9101
    • View Profile
Re: Accuracy problem?
« Reply #8 on: June 06, 2016, 11:46:35 am »
The goal of OpenXcom is to replicate the functionality of the 1994 version. Plus maybe add some QoL. But definitely not change any core mechanics.

As far as I can say the aiming works exactly the same as in 1994.

Please note that:
- "accuracy" indicator is optional; and was not present in 1994 version either, it was a fan-made patch
- if you don't agree with the game's assessment of LoS/LoF, the DEVs were kind enough to implement Ctrl+click to override LoF... so you can make your soldier shoot even if the game doesn't want you to

In my opinion, it is pointless to ask DEVs to change this, they just won't, because it goes against the goal of the project!!

On the other hand, this is open source, anyone is free to make a fork and change this for themselves...

Offline Solarius Scorch

  • Global Moderator
  • Commander
  • *****
  • Posts: 11730
  • WE MUST DISSENT
    • View Profile
    • Nocturmal Productions modding studio website
Re: Accuracy problem?
« Reply #9 on: June 06, 2016, 12:06:59 pm »
I am very open towards an alternative, enhanced accuracy system, with Meridian's arguments in mind - so it'd be a fan mod at best.
But if we were to go there, it would be a huge thing, as it would require redesigning the entire accuracy core. And I can't see anyone both willing and able to do that since Volutar left.

Offline 7Saturn

  • Colonel
  • ****
  • Posts: 457
    • View Profile
Re: Accuracy problem?
« Reply #10 on: June 06, 2016, 12:20:14 pm »
The goal of OpenXcom is to replicate the functionality of the 1994 version. Plus maybe add some QoL. But definitely not change any core mechanics.
This is, why there are so many slight differences? Don't get me wrong, the very most I really like. But the answer »we like to keep it vanilla« isn't exactly reasonable any more, once one had a look at the game and it's original and noticed the already existing differences out of the box. And I don't mean the many mod-features, OXC brings by itself, you can switch on, if you like them. Let's take the path finding algorithm: Was improved a lot, however obviously works different than the original. Just try to send your man down a straight but not 90°-angle to the map boundaries and you will see. Or the places aliens spawn or how they act. If such minor deviations from vanilla behavior are the price to pay for a game, that actually does the job intuitively right (also when shooting), I want it! =)
As far as I can say the aiming works exactly the same as in 1994.
I'm not entirely sure about that. But even so, there are a lot of things that have been changed, slightly, to make the game more playable.
- "accuracy" indicator is optional; and was not present in 1994 version either, it was a fan-made patch
I never played the DOS version actively. In the Collector's Edition it was present from the start.
- if you don't agree with the game's assessment of LoS/LoF, the DEVs were kind enough to implement Ctrl+click to override LoF... so you can make your soldier shoot even if the game doesn't want you to
But the exact opposite is the problem: The game let's you fire at something, you simply can't hit. Either make it aim properly or don't fool the player by letting him fire at something he can't aim at, properly. If the player then decides to use CTRL, that's his prerogative...
In my opinion, it is pointless to ask DEVs to change this, they just won't, because it goes against the goal of the project!!
Which is what exactly? Letting the player override the LOF-prevention? Not vanilla! Making tanks rotate their turret without having to fire with them? Not vanilla! Letting the player sort his soldiers with the small arrows in the craft soldier display? Not vanilla. As I said, I like those changes. And there are a lot more. They improved the gameplay heavily. And that's really good, I like what you people did there. So why not improve the obviously flawed aiming algorithm as well? At least prevent players from targeting impossible-to-hit-targets without CTRL. That'd be all that's necessary and would be understood by every player. I can't imagine even one player saying »Oh, I found it far better to waste my bullets, just like in vanilla X-COM, just to find out, that the target indeed could't be hit!«.
« Last Edit: June 06, 2016, 12:22:07 pm by 7Saturn »

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9101
    • View Profile
Re: Accuracy problem?
« Reply #11 on: June 06, 2016, 12:45:03 pm »
@7Saturn:
I don't have the strength to continue this discussion... go ahead, feel free to change it.

@Solarius:
For the playability, there are no issues I think, the game is perfectly playable as it is.

For newcomers, 2 things might be confusing:
1. something they think is a "chance-to-hit" indicator is actually an "accuracy" indicator
2. game says they can't shoot even if they can see

If somebody is interested in removing this confusion (without rewriting the whole engine), I could try to make the following options:

1a. when indicator goes below 10%, the user would just see "<10%" instead of e.g. 6% or 0%
1b. when indicator goes above 90%, the user would just see ">90%" instead of e.g. 95% or 110% or 230%

2. not sure how hard it is, but I guess I could make the firing check and execution be done from the same point (=eyes) as the LoS check, i.e. "if you can see, you can fire"

But I'm really not convinced, that any workaround for this point would make the situation better... there would just be other questions and issues instead. And as I said in the beginning, the playability is not affected by this in any way in my opinion. Yes, sometimes you swear at the screen, but then you just use a different soldier from different angle and the game goes on. That's xcom we love.

Offline yrizoud

  • Commander
  • *****
  • Posts: 1014
    • View Profile
Re: Accuracy problem?
« Reply #12 on: June 06, 2016, 02:59:21 pm »
I think everybody cares only about 2.
What's 100% wrong is that in the attached case :
- The shot is allowed
- The more accurate you are, the less likely you will hit.

Offline clownagent

  • Colonel
  • ****
  • Posts: 380
    • View Profile
Re: Accuracy problem?
« Reply #13 on: June 06, 2016, 09:12:21 pm »

2. not sure how hard it is, but I guess I could make the firing check and execution be done from the same point (=eyes) as the LoS check, i.e. "if you can see, you can fire"


That would certainly be an improvement  :D