Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - jnarical

Pages: [1] 2 3 ... 6
1
Brutal AI / Re: Realistic accuracy without brutal AI?
« on: March 21, 2025, 01:23:11 am »
Horizontal vs vertical spread - another suggestion of mine is to have the latter lowered compared to the former
Done, now fire cone is elliptical, I added to horizontal spread a little (x1.2) and reduced vertical (x0.65)
I'll do my best to test it better tomorrow. Next release should be in a couple of days, and if I won't be too lazy and slow - I'll expose all RA-related variables to yaml file, so modders could edit them. And tuning them will be up to you  :)

100%+ shots...  but 95% cap is something I guess
Done. I moved RA config to ruleset, you can either edit it directly (openxcom/standart/xcom1/realisticAccuracy.rul) or create small mod.

Upd:
Revamped spread calculation, made the whole set of parameters and algorithm itself much more clear for understanding and editing. Now testing it.

2
Brutal AI / Re: Realistic accuracy without brutal AI?
« on: March 18, 2025, 01:26:00 am »
One of the selling points of this feature is "if you can see it you can shoot it"
Done. Will be added in next release.
Also, changed wording for RA options, to make them shorter / clearer.

3
Brutal AI / Re: Realistic accuracy without brutal AI?
« on: March 15, 2025, 06:09:28 pm »
Good point and I'm not going to argue further. I guess I just miss the implementation from UFO: Alien Invasion open source game, if I remember correctly this game didn't roll chance to hit but rather used accuracy to compute cone of fire and the displayed chance to hit was a matter of deviating visible target surface by total surface of cone cross-section.
That's how I initially tried to implement that. But either close-combat is broken (cone inside a target) or long-range shots have huge spread and low accuracy... And also I haven't my math good enough to code cross-sectioning voxel object with plane in 3D. Or, to be precise - check if a shot hits that cross-section.

Wait what? I always thought it was about accuracy of a soldier/gun, not the percentage chance to hit in a particular situation!
I'm not sure about details, just been told about it.

For "100% accuracy", I think (in perfect game) split accuracy of shooter and accuracy of weapon. Each barrel could have inherent minimal angle of spread that can't be overcome by shooter accuracy. Image that you put weapon on bench and shoot from fixed position, it still should miss target in some conditions.
Even more precise, it's weapon+ammo which gives minimal accuracy. I'm sure there are games where such things as recoil etc. are simulated, but we love xcom not for that )

4
Brutal AI / Re: Realistic accuracy without brutal AI?
« on: March 15, 2025, 03:09:14 pm »
One of the selling points of this feature is "if you can see it you can shoot it", however for some weird reason it only works with aimed shot or when kneeling down... why limit it to only certain conditions?
Realism in games is controversial topic. One should mark a line somewhere, and we're talking about the game where enemies take turns, and collision models for units are cylinders. I conceive the idea of different LoS/LoF for auto/snap fire both as a game convention and gameplay element, and a little bit as tribute to original game. It's kind of tradeoff: you have better cover, peeking out safely - but you can't open rapid fire as easy as someone staying in the open field with his finger on the trigger. I fired up the game just to make sure and can say it still looks justified.

Your opinion makes sense, I just wanted to elaborate mine. If needed, menu option could be easily implemented ))

Quote
Spread being affected by type of shot - maybe it'd be better to have it affected by chance to hit?.. my personal preference would be to have chance to hit dictate the spread
It does, to extent. Overall, the whole topic is extremely complicated. I spent weeks figuring it out, and had numerous heated discussions with people)) Imagine being me, trying to make accuracy mod for 30 years old game. What should it looks like? First of all, people who would possibly want to play mod are the same people who played OG and OXC and they are used to "old" accuracy. You couldn't change numbers arbitrarily. But the worst part is "realism" - in real life, distances of typical XCom gunfight are too short to miss. Be sure, first iterations of RA design were based on calculating realistic probabilities - but that didn't work well for close-range combat. So, after a while I came to current RA where bullets whizz around the target with (I hope so) "realistic" feel, for a price of fire spread cone changing with distance.

In a nutshell, spread depends on weapon 1/2-hand type, shot type, and distance. Chance to hit doesn't affect it 'cause for similar mentioned conditions, 100% visible target should get the same spread as almost fully covered, albeit chance to hit would be absolutly different.

Quote
100%+ shots... was brought back because mods and stuff, but well, I do play modded (x-files) and I don't like these guaranteed shots... 95% cap is something I guess.
Yes, I changed that back and forth... Firstly there was no cap, then I made it 95%, then I removed it again. 100%+ accuracy in mods like XCF sometimes affects damage so it's crucial to keep. If I recall right I was trying to add cap option to menu but decided to ditch the idea 'cause the algorith was already buggy and overcomplicated at the moment. I mean, I spent days and weeks in debugger. I could consider adding that option but it gives me flashbacks ))

Quote
Horizontal vs vertical spread
It should be less in vertical I guess, but maybe the rate is insufficient? OK, I've checked the code, basic (unmodified) vertical deviation is equal to unit's radius (except for big units, where it's radius/2). I could change it to 3/4 or 2/3 of radius, so spread shape will be elliptical. Statistically, round shape should've been working good, due the way it's used. When there's a rolled miss in accuracy - the game looks for valid missing trajectory. For round spread shape with center on the unit and radius equal to 1/2 of its size - most missing shots go to the sides, even after increasing spread - it's much more likely to miss to the side than to narrow areas above and below the unit.

===

As for bugs - I must confess there are known ones, but I didn't have time, will and energy to fix them. For example, suicide protection fails sometimes when shooting from Skyranger ramp, and off-center shooting is broken for a good amound of cases, including reaction fire. It feels in narrow passages.

I have long overdue obligation to make video tutorial for Freecad on YT, and couldn't devote myself to RA support until it's done, but I could at least make small updates. I guess it's time. I should say, positive feedback is encouraging. It's really is. Thank you)

5
Brutal AI / Re: Realistic accuracy without brutal AI?
« on: February 19, 2025, 01:27:20 pm »
Well, what can I tell? As soon as I switched to brutal ai version saving and loading became faster. Not gonna complain about that... ::)
Could you report ANY accuracy-related inconveniences? Most players most of the time just ignore bugs (until they're game-breaking), there's not enough feedback. Better create an issue at "Realistic Accuracy" github but I wouldn't mind any other ways to get it

6
The temporal solution I found for it is to use a script that increases the overall accuracy stat for each unit. It's quite crude, but still works.
...
When I'll learn more advanced coding/scripting, there may be an option to multiply firing stats, like multiply twice for each unit.
That way, you can change either base or final RA-modified accuracy, but not any internal numbers for intermediate calculations.

7
Brutal AI / Re: "Realistic accuracy and cover system" option
« on: December 24, 2024, 01:40:38 am »
Hi! i've heard a lot of good things about your Realistic Accuracy Cover System, (RACS), and wanted to give it a try, but I'm not interested ATM on Brutal AI, Fog of War and other features at BOXCE (no offense, perhaps in the future). So, I'm trying to port just parts related to RACS to the "vanilla" OXCE, identifying and adding just your commits in BOXCE git history. I've some questions related to this, and I'd like to ask you about if you don't mind.
I call it "RA" for short.  If you just want to play with RA without BrutalAI, Fog of War etc. - you could just turn them off, and have (mostly) OXCE experience. It's MUCH easier if all you want is to play with RA, than backporting RA to OXCE... I'd like to do that, but it's not that simple, as accuracy, targeting, los/lof code is tightly coupled. I had to touch different parts of code to make RA work as I wanted too. If you want to implement it on top of OXCE as entirely togglable, you'll get significant overhead and overcomplication... that's why I decided to move away from OXCE - it's too much of a work for me alone. As far as I know, some fixes for RA was commited by Xilmi too, so taking only my commits into consideration isn't enough...

- Are your changes at "AIModule.cpp" (AIModule::BrutalThink and AIModule::BrutalScoreFiringMode) needed for porting RACS? Or are they a "help" to the Brutal AI part of BOXCE?
If you're talking about my commit changing that code, most probably I commited some fix for AI-related code, after discussing it with Xilmi. If something is inside "Brutal"-named code, it's not needed for "vanilla" OXCE. Most probably)

- Also, changes at TileEngine::calculateUnitsInFOV, related to check visibility of units at your own unit FOV, are a BUG/enhancement of original  calculateUnitsInFOV function? To me, they seem unrelated to RACS feature, but for snipper/spotter feature and Brutal AI (unit->checkForReactivation() and similar)
It seems to me atm, that function was checking all four tiles for big units even after discovering it's in FOV, which is unnecessary. But I could be wrong (And could've been wrong understanding that code right). As I remember, that change is related to something else, for example new version of canTargetUnit. Need to double-check.

- Finally: changes at Map::drawTerrain about "// Draw motion scanner arrows" are part of RACS? What does it change about Motion Scanner Arrows on screen? I (think I) recognize elements related to FOW, but others - "offset.y" changed if "myUnit->isKneeled()" - could be related to adjusting arrows position?
I don't get anything from me in that part of code, checked with "git blame", found nothing. Please elaborate which line numbers we're talking here.

To better compare vanilla OXCE and OXCE+RACS, I've chosen to duplicate some functions you heavily modified, so you can call the original one or RACS version depending on Options::battlerealisticaccuracy value. It's the case of TileEngine::canTargetUnit  or Projectile::applyAccuracy, where it was  very difficult for me to "separate/protect" original to changed code using a Options::battlerealisticaccuracy "guard". It's possible some of the changes are related to "bugs" in original code - AIRC I read something in openxcom forum - but as these possible bugs are not identified, I can't know.
The most difficult part is separating it in all other places, like Map.cpp and ProjectileFlyBState.cpp. For me it took months of sitting and looking at code, to get an idea how all that works, at least to some extent. But I'm not the "real" programmer, after all ))

I found that original  TileEngine::checkVoxelExposure was not used anywhere in OXCE (??). So it was easy to replace it by yours.
That's right. It's just unused (and bugged to the core if someone decided to use it) piece of code, at least in OXC. For OXCE, maybe something changed in that regard, didn't look at)

So, if you don't see any cover number when you press CTRL, and icon is gold, it means the enemy is fully covered and accuracy number is lying (you cannot hit a fully covered enemy)
It's always a challenge to add some new mechanics to the game and don't have players (too) confused. "Extender accuracy" (or relatively "new" separate option to display accuracy numbers at cursor) shows numbers without considering LoF, except no-LoS penalty of course. So, cursor on enemy behind dozen of walls still displays non-zero numbers with Extender accuracy "On" - and players are used to it. So, it's not "lying" in RA - it gives some useful info instead of just plain "you couldn't hit target behind a wall so your accuracy is zero". It's not, and you could force-fire to that target with more or less success.

How can you activate this function? Is there any key to save this screenshot?
F10 in Battlescape
https://www.ufopaedia.org/index.php/Controls_(OpenXcom)
https://www.ufopaedia.org/index.php/Hidden_Features_(OpenXcom)

Thanks a lot for your work. Is a wonderful feature, which IMHO would have been a huge improvement to official OXCE; for me, current OXCE shown accuracy is not very useful beyond knowing that the higher the better accuracy.
I'd like to see RA in "generic" OXCE but that doesn't seem to happen. I posted a PR to OXC more than a year ago, with targeting-related fixes - haven't got any luck still. No chances to something more serious, sadly. The best I could do (in theory) is to make RA-fork based on OXCE rather than BrutalOXCE, but that won't be necessary until Xilmi drops the development.
(the PR in question: https://github.com/OpenXcom/OpenXcom/pull/1431)

8
Hello everyone! I'm new to BOXCE modding.
Recently I found this (github.) /Xilmi/OpenXcom/blob/oxce-plus/src/Battlescape/Projectile.cpp, this file (along with OpenXcom/src/Battlescape/Projectile.h) contains variables (From line 38 in projectile.cpp) used to configure accuracy for RA. Is it possible to modify them in some way? I have already tried to change them by creating scripts but have failed (Mostly copied existing scripts and tried to implement changes in this variables).
Can anyone help me and point out how to change accuracy in the game (If it's possible)?

I wasn't checking the forum for quite a while, as like as participating in BOXCE development - real life takes its toll...
As for your question - it wasn't meant to be changed by users, but it would be useful to make those values available for modding... I just don't know how, this idea never came to my mind, honestly. I'll look into it.

9
Brutal AI / Re: "Realistic accuracy and cover system" option
« on: October 23, 2024, 12:10:58 am »
It may be worth testing by disabling this option.
It does nothing in case there's a line of sight fire

10
Brutal AI / Re: "Realistic accuracy and cover system" option
« on: October 18, 2024, 09:30:17 pm »
I should admit I was wrong. Covers in OG work, seems I got used to OXC and forgot how OG feels... Which is not surprising, considering i haven't played it for decades.
I repeated experiments once again, 100 shots for each, twice for OG.  Well, "works as intended", and seems like the intention was to avoid OG behaviour altogether.

To clarify, this is the percentage of hits, blocked by cover, for similar battlefield state but for different game versions
Original game #1 — 55,6% - I call this "cover works"
Original game #2 — 57,1%
BAI / RA On — 36,8%
OXCE — 11,8% - and this is "doesn't work" to me
BAI / RA Off — 8,8% - ...this is my version in "OXCE mode", which is similar to OXCE at least in theory (doesn't work either)

11
Brutal AI / Re: "Realistic accuracy and cover system" option
« on: October 16, 2024, 10:02:46 pm »
You probably meant "no LOS" check?
Nope. I checked that in debugger - there was no penalty.

12
Brutal AI / Re: "Realistic accuracy and cover system" option
« on: October 16, 2024, 08:51:09 pm »
Of course, cover does work in OG, OXC and OXCE.
As an OXCE dev, I can 100% confirm that cover works as designed and as expected.
It's all just definitions and terminology.

There's an old joke
Quote
Two Jewish ask Rabbi to resolve their argument.
First guy: "Rabbi, is black a color?"
"Well, sure..." - said the confused Rabbi.
First guy: "See, I told you! Rabbi, is white a color?
Rabbi: "Well, yes, white is a color."
First guy: "See? I told you Moishe, I sold you a Color TV!"

When I show you how accuracy is just the same to half-covered target as like as for fully exposed, you call that "cover works as expected"
When I show how 95% covered target reduces accuracy from 90% to 45%, and missing shots don't hit any cover and just fly by - you call that "cover works as expected"
There's nothing to argue about, other than definitions. Cause right, black and white are still colors ))

13
Brutal AI / Re: "Realistic accuracy and cover system" option
« on: October 16, 2024, 01:04:51 am »
All tests were made in standart OXCE (not BAI/RA).Visibility/Cover percentages were measured in BAI/RA afterwards.

One could think that cover works at least sometimes, at least to some extent. Actually, it doesn't. Cover works, when shot hits it instead of target, in front of it.  That's when cover works as, well, COVER. That wasn't true for almost 80% misses - most of them flew by. Unfortunately, i haven't count them, but they are way more than half of all the misses.

There is a correlation between cover percentage and missed shots, sure, especially for high objects density. But those shots not only don't hit any cover, they are incredibly insufficient to use them to a tactical advantage. Even extremely 95% covered unit will be hit with every seconds aimed shot.

UPD:
Flipbard, I'm not interested to continue this discussion. I jsut don't care.

14
Brutal AI / Re: "Realistic accuracy and cover system" option
« on: October 06, 2024, 01:04:50 am »
But would it matter in the open without cover?
No and yes. At the  early stage of development I've made a decision not to take unit size into account (excluding 2x2 units), for a couple reasons. First one is their size differs A LOT, for example muton is x1.5 or even x2 larger than sectoid. This could've changed accuracy numbers a lot too, and I've considered that was too big of a change, especially for old xcom playerbase.

But. Cover is much more beneficial for smaller units, cause of its relative size. Even small grass counts as cover, and for muton it could reduce its visibility to 97%, but for something as small as rats, it could be 80-85% And grass is everywhere, you could even consider it as "totally open field")) Small sectoids could hide behind small covers more effective than mutons, too.

15
Brutal AI / Re: "Realistic accuracy and cover system" option
« on: October 02, 2024, 03:07:17 pm »
smaller targets like the rats
RA scans target's hitbox, which differs for enemies. For example, there could be situation where you could see muton behind a stone wall but couldn't see sectoid which stands next to it. Their width differs too. But the issue with small creatures is their hitboxes could be much larger then sprite image. I couldn't help with this, it's up to mod makers.

Well could it be added back as a toggable option?
I could return it back relatively easily, but I'd rather fix huge technical debt which prevents further development. And that's much easier said than done.

Pages: [1] 2 3 ... 6