aliens

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

Offline Juku121

  • Commander
  • *****
  • Posts: 1659
  • We're all mad here.
    • View Profile
Re: "Realistic accuracy and cover system" option
« Reply #15 on: April 13, 2024, 11:43:45 pm »
So, I'm not only planning to "put that behind RA", but hope to fix it to reasonable state first.
Fair enogh. I quite liked the ability to see the 'hit roll' when I last tried. Perhaps too much PF WotR. :-[

In other words, 100% hit with good enough explosive, or 83,5% (good) hit with weak grenades
Yep, one of my problems with grenades in general. I seem to be somewhat in a minority, though.

Offline jnarical

  • Captain
  • ***
  • Posts: 54
    • View Profile
Re: "Realistic accuracy and cover system" option
« Reply #16 on: April 14, 2024, 11:14:15 am »
I seem to be somewhat in a minority, though.
I've heard a significant number of complaints about this issue from different people, throwable explosives are just much more efficient overall. I'm not sure for 100% but I think mods' developers (I recall XCF in particular) try to mitigate that advantage somehow.

UPD:
Tried original DOS version... What should I say? OXCE perfectly represents old algorithm :)
« Last Edit: April 14, 2024, 02:39:54 pm by jnarical »

Offline jnarical

  • Captain
  • ***
  • Posts: 54
    • View Profile
Re: "Realistic accuracy and cover system" option
« Reply #17 on: May 04, 2024, 11:38:04 pm »
Latest changes in RA part (not that much)


1) There's a kind of old bug where unit is elevated, target point belongs to the upper tile, and my code wasn't detecting that unit in one function, but detected in another, so there was discrepancy (50% no-LoS penalty was incorrectly applying in applyAccuracy, but not in drawTerrain). Yes, that's a part of that known bug with tank in XPZ, seems like its fix wasn't complete

2) All arcing shots now work with classic accuracy code, so no "precise" chance to hit or checking % target visibility. It immediately fixed related bugs (I've closed two issues in github). It is temporary solution ofc, I just want to narrow down all other bugs before starting to write "arcing RA" part. This could be confusing so I'll repeat)) RA is disabled for all arcing shots!

3) Two bugs - one in RA part in applyAccuracy, setting target voxel for missing trajectory outside of the map. I didn't think that would be a bug, as any voxel outside of the map still could be used as a valid target for a shot... but the issue comes when this voxel is used to get a tile from it, somewhere in code, and gives invalid tile. So I've restricted search for missing trajectroies only inside map boundaries. Second one - there's 100-times cycle which don't do anything useful, if target voxel belongs to invalid tile. I've added early break from the cycle in that regard.

4) Rollback that unlucky grenades accuracy commit that Meridian told about

My real life takes over one more time, so I cannot have as much time dedicated to OXC development as I want, but hope it'll change.

Offline aziza

  • Captain
  • ***
  • Posts: 98
    • View Profile
Re: "Realistic accuracy and cover system" option
« Reply #18 on: May 08, 2024, 07:03:33 am »
brown accuracy digits are a cheat
it will show you exactly where the alien is, even if you can't see it, just move the crosshair from your ship over the UFO



Offline jnarical

  • Captain
  • ***
  • Posts: 54
    • View Profile
Re: "Realistic accuracy and cover system" option
« Reply #19 on: May 08, 2024, 07:07:55 am »
brown accuracy digits are a cheat
it will show you exactly where the alien is, even if you can't see it, just move the crosshair from your ship over the UFO
Thanks, I’ll look what could be done here.

Offline jnarical

  • Captain
  • ***
  • Posts: 54
    • View Profile
Re: "Realistic accuracy and cover system" option
« Reply #20 on: May 10, 2024, 12:51:44 am »
brown accuracy digits are a cheat
it will show you exactly where the alien is, even if you can't see it, just move the crosshair from your ship over the UFO
Fixed, It was trivial.

Offline Xilmi

  • Moderator
  • Commander
  • ***
  • Posts: 613
    • View Profile
Re: "Realistic accuracy and cover system" option
« Reply #21 on: May 11, 2024, 06:56:37 pm »
Fix is available in 8.5.0.

Offline jnarical

  • Captain
  • ***
  • Posts: 54
    • View Profile
Re: "Realistic accuracy and cover system" option
« Reply #22 on: May 12, 2024, 04:48:50 pm »
After I've got a couple of positive opinions about my version of throwing accuracy code, I've decided to return it back to game, under new option (independent from RA) - "Alternative throwing mechanics".

Here's the reasoning behind it.

There is applyAccuracy function, which applies unit's accuracy, adding deviation to target voxel, and there're several issues here.

1) Resulting deviation for successful rolls is not enough to make grenade fall to tiles, adjanced to target. It always falls to target tile in that regard.
That feels unnatural.

2) Resulting deviation for unsuccessful rolls feels unnatural too - grenade could fall too far away from target

3) Accuracy for direct shots counted the same way as for throwable explosives. Throwing accuracy of 70% means that roughtly 70% of the time that highly explosive thing will hit the ground right under the target unit, demolishing both the target and surroundings. This is the main issue - although there's a distance modifier, it doesn't affect "successful" rolls. So, no matter how low your accuracy is, if you get a succesful roll - your grenades turn to a "sniper" ones. There's no significant difference between high and low throwing accuracy.

For successful hit with explosives - you doesn't need a precise hit to a voxel inside target's body, hitting any tile around it can be considered as success, to a different degree depending on a distance from target to explosion.

As a quick and dirty solution, for "Alternative throwing" option

1) I've added additional deviation so grenades could fall around the a target more naturally

2) Decreased deviation for "missed" rolls (again, to make them look more natural)

3) I've changed the formula, introducing accuracy additional penalty based on accuracy and distance. Distance without penalty is equal to square root from unit's accuracy multiplied by 3. All numbers are arbitrary and are subject to change of course, now I consider them as pretty conservative.

That way, a unit with T.Accuracy=36 could throw to 6 * 3 = 18 tiles without a penalty, and then it gets additional 16 voxels of deviation for every additional tile of distance.

T.Acc=49 gives 21 tile of "aimed" throwing
T.Acc=64 gives 24 tiles
T.Acc=81 gives 27 tiles
T.Acc=100 gives 30 tiles

With these changes, grenades are much less precise and powerful, you couldn't throw them across the whole map straight to target's feet anymore. But they are still powerful enough in hands of people with good throwing accuracy. Different accuracy and strength now matters more - there could be situation, when you got a soldier with good strength but poor accuracy.. so he could throw anything across the map, but without any precision, On the other hand, another soldier with poor strength never gets a penalty, as he just couldn't throw far enough, so he always hit target OR one ot its nearest tiles.
« Last Edit: May 12, 2024, 04:50:44 pm by jnarical »

Offline Abyss

  • Colonel
  • ****
  • Posts: 331
    • View Profile
Re: "Realistic accuracy and cover system" option
« Reply #23 on: May 12, 2024, 07:20:09 pm »
1) I've added additional deviation so grenades could fall around the a target more naturally
2) Decreased deviation for "missed" rolls (again, to make them look more natural)
3) I've changed the formula, introducing accuracy additional penalty based on accuracy and distance. Distance without penalty is equal to square root from unit's accuracy multiplied by 3.

Hey Mister) thank you for the new tossing mechanics. Could be a gamechanger.
- Can you share the exact formula? Is it bell engine or flat random around the target?
- What's the penalty per tile past optimal distance?
- I would like you to consider adding critical success toss too (i will share insights below in text, FYI)

For discussion:
1) Considering major mods, ordinary throwing skill is 40-50 for majority of troops in the beginning. THR skill cap is usually 80-90 (w/o commendations, which give additional +5 after many battles) 
According to lore, throwing 35 is somewhere ordinary man skill, while 50 is beyond that. 85 THR should be human olympic champion

2) Besides, there's one more sufficient parameter: STR. In OXCE, STR is the limiter of THR distance (and it should be), but what I feel is: to a lower degree, it can influence THR preciseness as well. Say, THR skill should have weight of 75% and STR should have weight of 25%. Some armors effectively reduces weight (like, weight= -40) and will not provide any bonuses, while armors, that boosts soldiers' strength (like, +50 STR) will have additional 12,5% hitchance.

3) The critical THR success possibility should be incrementally higher to apply on closer targets. For example, the low-skill trooper (40 THR skill) throws grenade:
- 2 tiles away should have at least 90% underfeet chance,
- 5 tiles away should have, like, 65%
- 10 tiles away - your penalties and deviations come into full power

For example, high-skiller trooper (80 THR) should be able to toss grenade well across the map. It is rather rare to find out such units in your rooster, but some mods present you units better (and stronger), than humans.
For these units, critical THR success chance should proliferate to a longer distances.