aliens

Author Topic: "Realistic accuracy and cover system" option  (Read 18126 times)

Offline jnarical

  • Colonel
  • ****
  • Posts: 107
    • View Profile
Re: "Realistic accuracy and cover system" option
« Reply #60 on: April 07, 2025, 10:25:51 am »
What setting should I play on?
It's up to your liking, honestly. RA settings affect both you and the enemy. As far as I know, aliens are aware of cover effects and use cover-modified hit-chance numbers to evaluate their actions. If you want something close to original game, you should use 50% setting, 30% will be (kinda) closer to OXC/E, and 0% will be brutal in terms of sheer number of successfull hits for both sides. Bear in mind, that for 0% it won't include even 10% "hidden" cover efficiency which presented in OXCE - you'll get accuracy number directly converted to hit-chance. And tight shooting spread on top of that, which makes explosive shots far more effective.

More cover efficiency gives (in general) longer fights and increases the role for throwable explosives.
« Last Edit: April 07, 2025, 10:31:34 am by jnarical »

Offline Stormtrooper

  • Sergeant
  • **
  • Posts: 41
    • View Profile
Re: "Realistic accuracy and cover system" option
« Reply #61 on: April 07, 2025, 10:08:15 pm »
I started with default 70%, then went for 100%, now I don't want to go back. It's awesome and if not 100% realistic (pun intended) since it's just a game with many simplifications compared to IRL firefights and whatnot, at least it's very immersive, standing in the open is a deathwish but solid cover often requires different approach than bullet spam. And makes aimed shots useful once again for my x-files veterans with 120+ accuracy and stuff.

Offline jnarical

  • Colonel
  • ****
  • Posts: 107
    • View Profile
Re: "Realistic accuracy and cover system" option
« Reply #62 on: April 09, 2025, 12:40:43 pm »
I'm gradually closing issues, the next targets are:
  • update the description for RA
  • check and fix off-center shooting for reaction fire
  • add minimal chance-to-hit option for reaction fire, now units just waste TUs and ammo shooting with <10% chance to hit from across the map
  • return to idea of adding arcing shots under RA mechanics

UPD:
I've got an idea recently. I could change the original accuracy formula to get tighter and more realistic spread, by implementing gauss distribution to original algorithm. This won't have any common code with current RA implementation. As I see it - it will be clean and short solution, and could be added to base OXC/E as an option, without touching existing code. That was my initial goal when I started to dive into OXC code, but I didn't have needed knowledge back then.

Meridian, is there any chance such PR will be accepted? We're talking about additional (and conditional - under new option) single block of code inside Projectile::applyAccuracy()
« Last Edit: April 09, 2025, 12:52:25 pm by jnarical »

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9508
    • View Profile
Re: "Realistic accuracy and cover system" option
« Reply #63 on: April 09, 2025, 01:33:47 pm »
UPD:
I've got an idea recently. I could change the original accuracy formula to get tighter and more realistic spread, by implementing gauss distribution to original algorithm. This won't have any common code with current RA implementation. As I see it - it will be clean and short solution, and could be added to base OXC/E as an option, without touching existing code. That was my initial goal when I started to dive into OXC code, but I didn't have needed knowledge back then.

Meridian, is there any chance such PR will be accepted? We're talking about additional (and conditional - under new option) single block of code inside Projectile::applyAccuracy()

That sounds ok to me.

Offline jnarical

  • Colonel
  • ****
  • Posts: 107
    • View Profile
Re: "Realistic accuracy and cover system" option
« Reply #64 on: April 09, 2025, 02:01:12 pm »
That sounds ok to me.
I miss the ability to give likes/reactions here on forum...
To clarify, the goal is to copy current deviation algorithm and tune it from #1 to #2 distribution, preserving chance to hit.
« Last Edit: April 09, 2025, 02:02:53 pm by jnarical »

Offline Yankes

  • Commander
  • Global Moderator
  • Commander
  • *****
  • Posts: 3475
  • Posts: 421
    • View Profile
Re: "Realistic accuracy and cover system" option
« Reply #65 on: April 09, 2025, 09:46:36 pm »
This will be distribution of trajectory "hit points" or distribution of trajectory angles (see ballistic minute of angle)?
Depending on implementation it could be big difference between them.

[ps]

We should too remember to preserve this behavior:
https://openxcom.org/forum/index.php?topic=7699.msg121039#msg121039
:>
« Last Edit: April 09, 2025, 09:57:53 pm by Yankes »

Offline jnarical

  • Colonel
  • ****
  • Posts: 107
    • View Profile
Re: "Realistic accuracy and cover system" option
« Reply #66 on: April 10, 2025, 10:34:35 pm »
This will be distribution of trajectory "hit points" or distribution of trajectory angles (see ballistic minute of angle)?
Hard to tell. No simple solution, it seems. I've just made (vibe-coded) accuracy simulator, and now I could experiment with different deviation functions to get same hit-chances with better (more natural) shots' distribution

Attached my python tool, in case someone wants to tinker.
« Last Edit: April 10, 2025, 10:36:54 pm by jnarical »

Offline Yankes

  • Commander
  • Global Moderator
  • Commander
  • *****
  • Posts: 3475
  • Posts: 421
    • View Profile
Re: "Realistic accuracy and cover system" option
« Reply #67 on: April 10, 2025, 10:49:38 pm »
Maybe I can simplify question, when you target couple tiles before unit or couple tiles behind it, but all this points are in straight line, then hitting this target chance will do not change?

Offline Yankes

  • Commander
  • Global Moderator
  • Commander
  • *****
  • Posts: 3475
  • Posts: 421
    • View Profile
Re: "Realistic accuracy and cover system" option
« Reply #68 on: April 11, 2025, 12:05:55 am »
https://quuxplusone.github.io/blog/2019/10/22/psa-stateful-distributions/
Its look that using `std::normal_distribution` make some testing impossible.

Offline jnarical

  • Colonel
  • ****
  • Posts: 107
    • View Profile
Re: &quot;Realistic accuracy and cover system&quot; option
« Reply #69 on: April 11, 2025, 07:34:45 am »
Maybe I can simplify question, when you target couple tiles before unit or couple tiles behind it, but all this points are in straight line, then hitting this target chance will do not change?
Still don’t know. After a couple of hours of thinking about possible solution, I’ve got that making normal distribution and keeping old chances to hit at different distances at the same time would be impossible. For now, my plan is to play with some arbitrary magic numbers and try to get chances-to-hit close enough to original algorithm. It won’t work, most probably.

Offline xenoroyal

  • Sergeant
  • **
  • Posts: 18
    • View Profile
Re: "Realistic accuracy and cover system" option
« Reply #70 on: April 11, 2025, 10:18:06 pm »
Noob question. Still haven't taken out my first landed ufo.

I'm using everything on and cover 100%.
So every time I aim my rifle at someone I get a red 3% and can't hit shit.  Holding control gives me a gold number.

When I have heavy plasma, is that 3% just my chance to hit through cover, but my plasma will take out the cover on first shot and it gets easier?  Obv my rifle doesn't do shit to cover, and aimed shot doesn't seem to be helping.

I'm thinking prelaser I go in with as many autocannons as possible and light these guys in cover up

Is there something I'm missing or do I have right idea?

Offline jnarical

  • Colonel
  • ****
  • Posts: 107
    • View Profile
Re: "Realistic accuracy and cover system" option
« Reply #71 on: April 12, 2025, 12:18:57 am »
So every time I aim my rifle at someone I get a red 3% and can't hit shit.
If you're using UFO Extender accuracy option - your shots lose accuracy with distance, with auto being the most affected, snap is less and aimed the least (or not affected at all). For long distances, auto isn't that useful in that case.

Holding control gives me a gold number.
That's strange. Could you provide screenshot or video, or maybe savefile and instruction how to replicate? If there's a visibility - there should be non-zero chance-to-hit number on targeting, and if you press Ctrl - it should show you how much the target is exposed (100% for fully exposed). If target has good cover, low visibility number shows in red. I have no idea how visible target could give gold numbers with Ctrl.

When I have heavy plasma, is that 3% just my chance to hit through cover, but my plasma will take out the cover on first shot and it gets easier?
Yes, especially for "realistic" spread - first shot have good chances to destroy a target, and then consequent shots will have better chances to hit the target. You could see them in log if you enable showing rolls.

Obv my rifle doesn't do shit to cover, and aimed shot doesn't seem to be helping.
If you're using 100% cover effect you should use all you can to improve your aim - soldiers with high accuracy, aimed shots and kneeling

I'm thinking prelaser I go in with as many autocannons as possible and light these guys in cover up
Is there something I'm missing or do I have right idea?
I don't know)) You should experiment)) It seems that "realistic" spread combined with HE autocannons could beat the shit out of those pesky aliens, but I didn't tested that for all settings combinations
« Last Edit: April 12, 2025, 03:18:49 am by jnarical »

Offline xenoroyal

  • Sergeant
  • **
  • Posts: 18
    • View Profile
Re: "Realistic accuracy and cover system" option
« Reply #72 on: April 12, 2025, 07:55:27 am »
If I wanted to use RA-50% cover to make it more like OG where developers wanted cover to wrok, does that only work if the main Ra cover and accuracy option is yes?   or are all the options that start with RA- become disregardedif the accuracy and cover opton is disabled

Offline jnarical

  • Colonel
  • ****
  • Posts: 107
    • View Profile
Re: &quot;Realistic accuracy and cover system&quot; option
« Reply #73 on: April 12, 2025, 09:42:29 am »
If I wanted to use RA-50% cover to make it more like OG where developers wanted cover to wrok, does that only work if the main Ra cover and accuracy option is yes?   or are all the options that start with RA- become disregardedif the accuracy and cover opton is disabled
Yes, all RA options work only if top RA option is enabled.