Author Topic: [OLD] Old OXCE discussion thread  (Read 674861 times)

Offline Dioxine

  • Commander
  • *****
  • Posts: 5412
  • punk not dead
    • View Profile
    • Nocturnal Productions
Re: OpenXcom Extended
« Reply #75 on: September 20, 2014, 10:56:54 am »
Yeah it'd be best for the AI formula to simulate player's line of thought, meaning it'd usually go for a maximum overall chance to hit (hence range calculations are crucial), with a random factor added.

Offline Yankes

  • Moderator
  • Commander
  • ***
  • Posts: 3209
    • View Profile
Re: OpenXcom Extended
« Reply #76 on: September 22, 2014, 08:24:00 pm »
Small update with two changes:
`fix fixed weapon (should always placed into "hands")` by redv
`Support for fire and smoke for any damage type`

And recent fix form nightly.

Offline Yankes

  • Moderator
  • Commander
  • ***
  • Posts: 3209
    • View Profile
Re: OpenXcom Extended
« Reply #77 on: September 28, 2014, 03:03:28 am »
new build,

I added bit more depth to craft combat. Now craft & ufo can have armor that reduce damage, better hit chance and better avoidance.
New hit formula:
Code: [Select]
newHitChance = oldHitChance + attacker->hitBonus - target->avoidBonusAdditional craft weapon can now buff overall damage form all weapons.
Ufo can have different stats based on race that use it.


Items now can be available in shop if you research require technologies (change for Solarius Scorch's FMP+).

« Last Edit: September 28, 2014, 03:07:06 am by Yankes »

Offline Solarius Scorch

  • Global Moderator
  • Commander
  • *****
  • Posts: 11461
  • WE MUST DISSENT
    • View Profile
    • Nocturmal Productions modding studio website
Re: OpenXcom Extended
« Reply #78 on: September 28, 2014, 08:30:50 am »
Awesome. I'm obviously happy for my request being granted, and the new air combat mechanics are very exciting.

Offline Dioxine

  • Commander
  • *****
  • Posts: 5412
  • punk not dead
    • View Profile
    • Nocturnal Productions
Re: OpenXcom Extended
« Reply #79 on: September 28, 2014, 09:38:06 am »
Seems that Warboy has double-backed on the Limited Psi Weapon Range formula; from about two dozens test battles however I am pretty sure that was the exact thing  needed to finally balance Psi. Can we count on a (working) version of limited range (OR extarnalizing the Psi formulas so one could affect a similar effect by increasing range penalty for psi power usage - ideally tied to psi items and working like "dropoff" works for firearms)?

Offline redv

  • Colonel
  • ****
  • Posts: 335
    • View Profile
Re: OpenXcom Extended
« Reply #80 on: September 28, 2014, 11:34:13 am »
Seems that Warboy has double-backed on the Limited Psi Weapon Range formula; from about two dozens test battles however I am pretty sure that was the exact thing  needed to finally balance Psi. Can we count on a (working) version of limited range (OR extarnalizing the Psi formulas so one could affect a similar effect by increasing range penalty for psi power usage - ideally tied to psi items and working like "dropoff" works for firearms)?

Increased range does penalty for PSI attack. It is vanilla behavior. https://www.ufopaedia.org/index.php?title=Psionics

Attack Strength (AS) = INT( Psi Strength * Psi Skill / 50 )        Attacker stats
Defense Strength (DS) = INT( Psi Strength + ( Psi Skill / 5 ) )     Defender stats
Constant = 25 for Mind Control; 45 for Panic

Attack Success (A%) = 100/56 * ( Constant + AS - DS - Distance )

Therefore psi abilities limited by distance "by design".

Offline Dioxine

  • Commander
  • *****
  • Posts: 5412
  • punk not dead
    • View Profile
    • Nocturnal Productions
Re: OpenXcom Extended
« Reply #81 on: September 28, 2014, 11:47:04 am »
Note that I wrote "INCREASING range penalty" not "INTRODUCING range penalty" and I am well aware of psionic equations, I was using them extensively to balance psi interactions in my mod. I meant extarnalizing the *exact* "dropoff" value for psi weapons associated with distance, because the vanilla value has (in my subjective opinion) a rather slim effect, as AS tops at about 200, DS can be over a 100, and the distance of above 25 is basically "everywhere", so there's about 5:1 domination of power factor over the distance factor.
« Last Edit: September 28, 2014, 11:52:35 am by Dioxine »

Offline redv

  • Colonel
  • ****
  • Posts: 335
    • View Profile
Re: OpenXcom Extended
« Reply #82 on: September 28, 2014, 12:26:00 pm »
"Dropoff" of firearms (different by type of shots) is just a silly workaround instead of using true "range based accuracy" formula.
Artificial "dropoff" of psi abilities will be the same workaround. You can balance psi-interactions by increasing psi-strength of aliens (for instance +30 or +40 psi str works well).

Offline Solarius Scorch

  • Global Moderator
  • Commander
  • *****
  • Posts: 11461
  • WE MUST DISSENT
    • View Profile
    • Nocturmal Productions modding studio website
Re: OpenXcom Extended
« Reply #83 on: September 28, 2014, 01:32:16 pm »
"Dropoff" of firearms (different by type of shots) is just a silly workaround instead of using true "range based accuracy" formula.

Not exactly. The FMP modpack is balanced for UFO Extender Accuracy, but still I'm using dropoff to increase weapon versatility. (It was actually Dioxine's idea.) The basis being dropoff is not equal to accuracy; for example pistols and shotguns are quite accurate, but only on short distances.

Offline redv

  • Colonel
  • ****
  • Posts: 335
    • View Profile
Re: OpenXcom Extended
« Reply #84 on: September 28, 2014, 03:00:20 pm »
"Dropoff" introduced in UFO Extender. I mean UFO Extender Accuracy is a silly workaround. For instance, you see that your chance to hit 50%. In attached picture you can see a difference among different models of shooting. So, UFO Extender accuracy looks very strange.

Offline Arthanor

  • Commander
  • *****
  • Posts: 2488
  • XCom Armoury Quartermaster
    • View Profile
Re: OpenXcom Extended
« Reply #85 on: September 28, 2014, 07:45:54 pm »
Shouldn't your graph look more like " -< " for the UFOExtender Accuracy? There is no big loss in accuracy at a certain point (your horizontals), just that you start losing some in a linear fashion after a certain distance.

If you want weapons that behave like your graph on the left, just give them high accuracy and an optimal range of 1, then the dropoff will kick in and reduce your accuracy linearly with distance starting 2 tiles away. The system is there.

I agree with Dioxine that adding a "DistanceFactor" that can be modded would be a good thing for mods. Changing the equation to:

Attack Success (A%) = 100/56 * ( Constant + AS - DS - DistanceFactor*Distance )

would allow to give more or less impact to distance depending on what the modder intends, which is not the same as just a flat increase in alien psi strength.

With that, you could make the psi system more complex, with XCom's first psiamp having a huge distance factor so it is really short range, then later version diminishing that to represent better understanding of psi-tech. Or.. I'm not sure if it is possible to give different psi-weapons to the aliens, but sectoids could have a larger factor, representing that they are not as adept mind controllers as Ethereals (who themselves could have various versions by ranks, some which need LoS, some which don't).

There's a lot that could be done with the psi-system. Externalizing the parameters would be great.

Offline redv

  • Colonel
  • ****
  • Posts: 335
    • View Profile
Re: OpenXcom Extended
« Reply #86 on: September 28, 2014, 08:12:49 pm »
If you want weapons that behave like your graph on the left, just give them high accuracy and an optimal range of 1, then the dropoff will kick in and reduce your accuracy linearly with distance starting 2 tiles away. The system is there.

It's wrong.
Angle in range based accuracy depends on accuracy. But angle in UFO extender will be always the same (~pi/2) even if you set 100% accuracy.

Quote
I agree with Dioxine that adding a "DistanceFactor" that can be modded would be a good thing for mods. Changing the equation to:
Attack Success (A%) = 100/56 * ( Constant + AS - DS - DistanceFactor*Distance )
would allow to give more or less impact to distance depending on what the modder intends, which is not the same as just a flat increase in alien psi strength.

I suggested increase psiStr, then will be increased DS. Therefore Attack Success will be decreased.
You suggested increase Distance by increasing DistanceFactor. Therefore Attack Success will be decreased.
The result will be the same: Attack Success will be decreased.
If there is no difference, why need write new code?

Offline Yankes

  • Moderator
  • Commander
  • ***
  • Posts: 3209
    • View Profile
Re: OpenXcom Extended
« Reply #87 on: September 28, 2014, 08:21:10 pm »
Note that I wrote "INCREASING range penalty" not "INTRODUCING range penalty" and I am well aware of psionic equations, I was using them extensively to balance psi interactions in my mod. I meant extarnalizing the *exact* "dropoff" value for psi weapons associated with distance, because the vanilla value has (in my subjective opinion) a rather slim effect, as AS tops at about 200, DS can be over a 100, and the distance of above 25 is basically "everywhere", so there's about 5:1 domination of power factor over the distance factor.
I think that will be easy to do.  I will look for things that can be externalized. One thing I will try do is apply same code to AS like in power bonus from normal weapons. This will allow creating psi-amp that is great for solder with big psi skill or only with psi strength (or normal strength or throw, but this is only side effect :D)

Offline Arthanor

  • Commander
  • *****
  • Posts: 2488
  • XCom Armoury Quartermaster
    • View Profile
Re: OpenXcom Extended
« Reply #88 on: September 28, 2014, 08:30:35 pm »
It's wrong.
Angle in range based accuracy depends on accuracy. But angle in UFO extender will be always the same (~pi/2) even if you set 100% accuracy.
That's true, the accuracy loss is always the same for a given weapon, range & shot combination. It might be better if it depended on the soldier as well. But given that the initial accuracy does depend on the soldier, the accuracy at range does too. A better marksman will have better odds of hitting at long range, just by virtue of having a greater chance to hit from which to substract the range adjustment.

You can control the angle by setting the "dropoff" properties of weapons, the increment by which accuracy is reduced for a tile (default = 2, but you can set a shotgun to, say, 5 so it becomes useless quickly at range, and a marksman or laser rifle to 1, to represent that range has little impact).

Quote
I suggested increase psiStr, then will be increased DS. Therefore Attack Success will be decreased.
You suggested increase Distance by increasing DistanceFactor. Therefore Attack Success will be decreased.
The result will be the same: Attack Success will be decreased.
If there is no difference, why need write new code?

Because your way makes it more difficult to use psi at all distances, whereas adding a factor there can make it more difficult only when the target is far away? Both might make it more difficult, but they're really not the same thing... With a factor, controlling a sectoid standing right next to you may be easy, but one far away won't be. With increased psi-strength, both will be as easy/hard to control. In fact, increasing psi-strength decreases the relative importance of distance even further...

The idea here is to add a similar but different mechanic from weapons where psi do not need LoS (so they are different), but also do not work at all distances (because then it's too powerful and becomes boring). I will be experimenting with setting a maxrange on psi weapons (and maybe giving ethereals a better weapon than sectoids, to allow them to use psi from farther away). You can do that in vanilla, right?

Then I'll wait for warboy to triple back and put in a moddable modifier..! ;)

Offline redv

  • Colonel
  • ****
  • Posts: 335
    • View Profile
Re: OpenXcom Extended
« Reply #89 on: September 28, 2014, 08:56:41 pm »
That's true, the accuracy loss is always the same for a given weapon, range & shot combination. It might be better if it depended on the soldier as well. But given that the initial accuracy does depend on the soldier, the accuracy at range does too. A better marksman will have better odds of hitting at long range, just by virtue of having a greater chance to hit from which to substract the range adjustment.

You can control the angle by setting the "dropoff" properties of weapons, the increment by which accuracy is reduced for a tile (default = 2, but you can set a shotgun to, say, 5 so it becomes useless quickly at range, and a marksman or laser rifle to 1, to represent that range has little impact).

It's wrong. Look at the code:
Start of calculate "modifier": https://github.com/SupSuper/OpenXcom/blob/master/src/Battlescape/Projectile.cpp#L264
Result: https://github.com/SupSuper/OpenXcom/blob/master/src/Battlescape/Projectile.cpp#L283

Therefore before some threshold probability to hit depends on accuracy. After threshold probability always set to 0. Therefore after threshold angle will be always the same. You cannot control this angle, because the angle is hardcoded: https://github.com/SupSuper/OpenXcom/blob/master/src/Battlescape/Projectile.cpp#L304