OpenXcom Forum

Modding => OpenXcom Extended => OXCE Support => Topic started by: Juku121 on February 20, 2023, 01:21:18 am

Title: [Answered][Question] Should the soldier bonuses stack?
Post by: Juku121 on February 20, 2023, 01:21:18 am
2. Same tier "Master of %weapon%" and "Bane of %race%" commendations do not stack
I would like to re-raise this issue. Doesn't seem to have been answered, at least not in public.
Title: Re: [Question] Should the soldier bonuses stack?
Post by: Meridian on February 20, 2023, 05:41:54 pm

I would like to re-raise this issue. Doesn't seem to have been answered, at least not in public.

Soldier bonuses of the same type (regardless whether from transformations or from commendations) currently don't stack.

Not exactly sure if that's a feature or a bug. (I'll need to dig deeper in history)

Opinions?
Title: Re: [Question] Should the soldier bonuses stack?
Post by: The Martian on February 20, 2023, 05:58:28 pm
Soldier bonuses of the same type (regardless whether from transformations or from commendations) currently don't stack.

Not exactly sure if that's a feature or a bug. (I'll need to dig deeper in history)

Opinions?

I would like them to stack if possible.

Although to keep support for mods that already are using this feature and count on them not stacking, perhaps there could be a toggle for how they operate?
Title: Re: [Question] Should the soldier bonuses stack?
Post by: Mathel on February 20, 2023, 06:02:15 pm
Soldier bonuses of the same type (regardless whether from transformations or from commendations) currently don't stack.

Not exactly sure if that's a feature or a bug. (I'll need to dig deeper in history)

Opinions?
The current situation is rather confusing.
They do not stack when they are the same level, but do stack when different levels.

I think they should always stack, and it should be up to the mod maker if they include the option of having several commendations of the type.
But never stacking would still be better than the current mess.
Title: Re: [Question] Should the soldier bonuses stack?
Post by: The Martian on February 20, 2023, 06:13:34 pm
They do not stack when they are the same level, but do stack when different levels.

Do you mean that a bonus of 2 will not stack with another bonus of 2, but a bonus of 2 will stack with a bonus of 4?

If so I'll take any stacking I can get so that is welcome.
Title: Re: [Question] Should the soldier bonuses stack?
Post by: Meridian on February 20, 2023, 06:20:38 pm
They do not stack when they are the same level, but do stack when different levels.

Soldier bonuses don't have any levels.
And they never stack.

What you see just looks like stacking. But it's different soldier bonuses corresponding to various levels of soldier commendations.

The current situation is rather confusing.

I can definitely agree with that.
Title: Re: [Question] Should the soldier bonuses stack?
Post by: Juku121 on February 20, 2023, 06:36:41 pm
Well, right now we have what's essentially certain commendations sometimes stacking and sometimes not stacking, depending on whether they reference the same bonus or different bonuses (due to being the same/different level of a "multi-commendation", for lack of a better term).

Personally, I would prefer that bonuses remain generally unstackable, but this specific case where you can define a whole family of commendations in one go would also automagically create a corresponding family of no-longer-identical sets of soldier bonuses.
Title: Re: [Question] Should the soldier bonuses stack?
Post by: DoxaLogos (JG) on February 20, 2023, 06:47:45 pm
Would it be better to add a rule to a commendation that can specify which commendation it supercedes (i.e. Commendation B supercedes Commendation A, so don't stack A+B)? 

If no rule is specified then commendations stack by default.


Title: Re: [Question] Should the soldier bonuses stack?
Post by: Meridian on February 20, 2023, 06:49:19 pm
but this specific case where you can define a whole family of commendations in one go would also automagically create a corresponding family of no-longer-identical sets of soldier bonuses.

Yeah, we have enough headaches with automagical commendations.
I'm not going to do automagical soldier bonuses... that's the very last option for me.

My preference would be to just stack them.
We do keep full track of them in the save file since the beginning, they can be duplicated (both via transformation and commendations).
The "non-stacking" happens when we calculate and cache the the bonuses per soldier (we didn't do that at the beginning, it was introduced later for performance reasons).
It could be that they stacked initially, I'll check the history tomorrow/later.
Title: Re: [Question] Should the soldier bonuses stack?
Post by: Meridian on February 20, 2023, 06:51:42 pm
Would it be better to add a rule to a commendation that can specify which commendation it supercedes (i.e. Commendation B supercedes Commendation A, so don't stack A+B)? 

If no rule is specified then commendations stack by default.

Please forget about the commendations, adding anything there will not solve the issue.
Soldier bonuses can come from more places than just from commendations.

We need to solve it on the soldier bonuses level.
Title: Re: [Question] Should the soldier bonuses stack?
Post by: Juku121 on February 20, 2023, 07:01:43 pm
Yeah, we have enough headaches with automagical commendations.
If so, then full stacking seems preferable.

Did a modder ever use the non-stacking functionality?
Title: Re: [Question] Should the soldier bonuses stack?
Post by: Mathel on February 20, 2023, 07:29:42 pm
If so, then full stacking seems preferable.

Did a modder ever use the non-stacking functionality?
Dioxine used it for the Nepotism soldier bonus in XPiratez. A gal can get nepotism any number of times, costing you money each time, but it does not stack.
Title: Re: [Question] Should the soldier bonuses stack?
Post by: Meridian on April 09, 2023, 01:12:25 pm
Soldier bonuses of the same type (regardless whether from transformations or from commendations) currently don't stack.

Not exactly sure if that's a feature or a bug. (I'll need to dig deeper in history)

I checked the previous implementations, and can confirm they never stacked.

Also found the original specification, which states they don't stack:

Soldiers can now collect bonuses.
Bonuses can be manually awarded by the player via soldier transformations; or automatically awarded together with a soldier commendation/medal.
Bonuses of the same name/type don't stack.
(Different bonuses changing the same attributes do stack.)
Title: Re: [Answered][Question] Should the soldier bonuses stack?
Post by: Juku121 on April 10, 2023, 11:05:12 pm
Well, that answers the question whether it's a bug - it is not. It still remains open whether bonuses should stack, unless I'm missing something?

Right now, it seems far, far easier to split something like this Nepotism into two bonuses, one that can be stacked (heh) and doesn't give a stat bonus, and one that cannot and does give that intended-to-be-nonstackable bonus... than it is to manually create differently named and thus stackable bonuses by item/enemy names for all the gazillion weapons/enemies around, one by one. Which is the one way I can see the current state of the game allowing stacking weapon bonuses, and I don't think any big mod is going to go with that.
Title: Re: [Answered][Question] Should the soldier bonuses stack?
Post by: Meridian on April 10, 2023, 11:43:24 pm
The original question/report is answered and closed.

The new question whether it should be changed is open.
Title: Re: [Answered][Question] Should the soldier bonuses stack?
Post by: Juku121 on April 11, 2023, 03:47:33 am
Does the new question have a thread? Should one be made if not?
Title: Re: [Answered][Question] Should the soldier bonuses stack?
Post by: Meridian on April 11, 2023, 07:52:43 am
I don't know.

So far I haven't seen a comment from any modder using commendations and bonuses, so hard to say if anyone's interested or not.
Title: Re: [Answered][Question] Should the soldier bonuses stack?
Post by: Juku121 on April 11, 2023, 10:04:24 am
Hmm. Well, it also affects players of mods that use those commendations, in a nonintuitive and not really clear manner. We've now had at least three players comment on this. Don't know if this make the issue relevant enough.
Title: Re: [Answered][Question] Should the soldier bonuses stack?
Post by: Meridian on April 11, 2023, 11:27:54 am
Hmm. Well, it also affects players of mods that use those commendations, in a nonintuitive and not really clear manner. We've now had at least three players comment on this. Don't know if this make the issue relevant enough.

It is relevant, yes.
I already agreed with that.
I personally would also prefer if they stacked, see my comment from Feb 20th.

But it is not the players who decide, it's the modders.
(If 100 XCF players want it to stack, but the XCF modder doesn't want it to stack... I will listen to the modder.)
(And if modders don't say anything, I tend to stay with the currently available, used and documented functionality.)

Is it so difficult to imagine that I don't want to make breaking changes to mods without modders' approval?
Title: Re: [Answered][Question] Should the soldier bonuses stack?
Post by: Solarius Scorch on April 13, 2023, 01:22:08 pm
Yes, I think Master of X and such definitely should stack, if possible.

Not gonna lie, I am worried that this will make some soldiers overpowered; but that's on my side to take care of, if necessary.
Title: Re: [Answered][Question] Should the soldier bonuses stack?
Post by: Dioxine on April 15, 2023, 12:00:14 am
From my side, as author of Piratez: if these commendations will stack (master of weapon etc.), I will be forced to remove them completely from my mod (or at least remove any bonuses); they will be way too powerful considering the number of possible commendations of this type (basically unlimited).
Title: Re: [Answered][Question] Should the soldier bonuses stack?
Post by: Solarius Scorch on April 15, 2023, 12:13:56 am
Then how about only the highest commendation counting?
Title: Re: [Answered][Question] Should the soldier bonuses stack?
Post by: Juku121 on April 15, 2023, 09:45:47 am
The main issue here from the player side is not whether "Master of X" stacks or not, it's that it currently stacks inconsistently.

I would also like to point out that getting higher levels of these promotions is pretty hard. How many of your soldiers are going to end up with triple- and quadruple-digit kill counts? So removing low-level bonuses might also work.
Title: Re: [Answered][Question] Should the soldier bonuses stack?
Post by: Mathel on April 15, 2023, 10:00:51 am
As I understand things, "Master of Sword 5" and "Master of Axe 5" (for example), are considered the same commendation and do not currently stack.
"Master of Sword 5" and  "Master of Sword 4" are different commendations, but "Master of Sword 5" removes "Master of Sword 4".
But it neither removes, nor deactivates "Master of Axe 4".

So if you decide to not have them stack, please do it thoroughly and have the highest instance of a soldier bonus deactivate any lesser instances in the same commendation line present.
Title: Re: [Answered][Question] Should the soldier bonuses stack?
Post by: Meridian on April 15, 2023, 10:30:14 am
As I understand things, "Master of Sword 5" and "Master of Axe 5" (for example), are considered the same commendation and do not currently stack.
"Master of Sword 5" and  "Master of Sword 4" are different commendations, but "Master of Sword 5" removes "Master of Sword 4".
But it neither removes, nor deactivates "Master of Axe 4".

So if you decide to not have them stack, please do it thoroughly and have the highest instance of a soldier bonus deactivate any lesser instances in the same commendation line present.

That's because technically, none of this is true (none of this is actually happening in the background).

The game doesn't compare or consider the commendations in any way. At all.
The game only works with soldier bonuses they provide.
And not only they, but also soldier transformations.

There is currently no concept of "higher" or "highest" soldier bonus.
Soldier bonuses can only be equal or not equal, they cannot be sorted.

To have a hierarchy in soldier bonuses, I would need to design and implement a completely new soldier bonus mechanism.

Then how about only the highest commendation counting?

Same as above.
It's not commendations counting, it's soldier bonuses.
And I don't have any way of deciding, which is "the highest".

STR_BONUS_1 and STR_BONUS_2 may seem comparable to humans (visually it's obvious isn't it), but the game doesn't have any numeric parameter to compare them by.
Or even a parameter to say which ones belong to the same group and should even be compared (or not).

If a soldier transformation called "Convert to MEC" gives you "STR_BONUS_1" and a commendation called "Jedi" gives you "STR_BONUS_2", should they stack? or not? is "Jedi" commendation higher than "MEC" transformation?
Title: Re: [Answered][Question] Should the soldier bonuses stack?
Post by: Meridian on April 15, 2023, 10:34:45 am
I'm not trying to be a dumbass here btw.

Just trying to explain why I cannot implement any of the two approaches.

I cannot implement the "intuitive stacking" (of commendations).
And I cannot implement the "intuitive non-stacking" (of commendations) either.

The stacking or non-stacking (of soldier bonuses) doesn't correspond to any of the two options above.

Both of these would require big and breaking changes.
Title: Re: [Answered][Question] Should the soldier bonuses stack?
Post by: Solarius Scorch on April 15, 2023, 12:46:59 pm
After reading this entire thread, and also a heated argument with Dioxine, I must retract my earlier message.

I still don't like how it works. I hate how it works now. But the alternative is even worse: either the bonuses from weapon mastery will grow uncontrollably (for example getting level 1 proficiency in 10 weapons is not hard, but will give you +10 Throwing), or the bonuses would have to be reduced to only be added every 2 or 3 levels, and empty levels are bad design. Since I have no good solution, I will drop the subject and pretend that there's no issue at all.
Title: Re: [Answered][Question] Should the soldier bonuses stack?
Post by: Juku121 on April 15, 2023, 04:53:47 pm
Hmm, this is largely a design problem with the "Master of X" having such a multitude of bonuses in the first place. Either they all do something and can be stacked to stupidity, they don't (or at least have gaps) and look kinda odd and useless, or have some sort of limit (like only a limited number of such commendations allowed to give you bonuses) that goes against the idea of having a commendation per weapon in the first place.

I suppose that gives us the answer that the current situation is the best of the worst options as far as (several big) modders are concerned, and leave players to optimise their 10 different levels of "Master of X" and "Bane of Y" as they like.
Title: Re: [Answered][Question] Should the soldier bonuses stack?
Post by: Vakrug on April 16, 2023, 11:22:40 am
The problem discussed in this topic is just an example of much bigger problem of this game. Right now there are countless counterintuitive mechanics in this game and only reading wiki can explain some (but not all) stuff. And commendation stacking/not stacking is just one of them. But I am still shocked how such strange behavior even got into a game. Is the idea of "1 soldier uses only 1 weapon" so deep in players minds?
Title: Re: [Answered][Question] Should the soldier bonuses stack?
Post by: Meridian on April 16, 2023, 12:38:08 pm
The problem discussed in this topic is just an example of much bigger problem of this game. Right now there are countless counterintuitive mechanics in this game and only reading wiki can explain some (but not all) stuff. And commendation stacking/not stacking is just one of them. But I am still shocked how such strange behavior even got into a game. Is the idea of "1 soldier uses only 1 weapon" so deep in players minds?

This idea got into the game by an explicit request (of several modders): https://openxcom.org/forum/index.php/topic,7405.0.html
The solution was heavily discussed (on discord) among modders and even the exact syntax was designed by modders.
The design limitations were properly described at the very beginning.

So to answer your question... it is a typical example of "mod it until it breaks"... it has happened a thousand times already and it will happen a million times more in the future.

Every second thread in the OXCE Support category begins something like this: "Can I misuse feature X to achieve Y?" or "Can I do XYZ using scripts or something even though it is not available in the game?"

Still surprised?

It is not possible to foresee all use and misuse of new (and old) features.
If I was 100% strict on possible misuse, I would never implement anything and reject everything.
And people already accuse me of rejecting everything...
Title: Re: [Answered][Question] Should the soldier bonuses stack?
Post by: Thallori on April 23, 2023, 02:23:37 pm
There's an existent implementation in Terra Invicta's traits system. Each trait is given a group, if the game tries to give another trait from that group to an agent then that trait is ignored. I think a best of both worlds implementation for OpenXCom might look something like..

All commendations/transformations can now be given a group number.

"Group: 0"
Default. Previous behaviour.

"Group: +X"
Sorts all awarded commendations by rank, then selects the highest rank and only uses the bonuses from that commendation. If more than one commendation is the same rank, then the game selects the earliest awarded commendation of that rank.
ex.
Sniper III: +3 firing, +3 reactions; group: 1
Overwatch II: +6 reactions; group: 1
Supergun I: +100 firing; group: 1

In this case, only Sniper III's +3 firing, +3 reactions bonus will apply to the soldier. The biggest problem is that someone's stats might fluctuate more than people are anticipating. A soldier that's been getting two awards in the same group, but the bonus stats are in health or bravery respectively might have 83 health, 20 bravery in one mission and 53 health, 80 bravery the next. This would be up to the mod author to sort out.

"Group: -X"
Looks at each bonus from each commendation, comparing stat by stat. Only the highest stat found is used for the bonus.
ex.
Sniper III: +3 firing, +3 reactions; group: -1
Overwatch II: +6 reactions; group: -1
Supergun I: +100 firing; group: -1

In this case, the bonus applied to the soldier from group -1 would be: +100 firing, +6 reactions.
Title: Re: [Answered][Question] Should the soldier bonuses stack?
Post by: Juku121 on April 23, 2023, 10:38:49 pm
As you admit yourself, this will not solve the problem we're having with "Master of X" making soldier stats fluctuate
for no reason other than technical. How do you differentiate between "Master of Shotgun" and "Master of Kitchen Knife"? They're technically the same commendation with the same bonus, but conceptually they should stack, i.e. be in different groups!

And it explicitly requires that Meridian "design and implement a completely new soldier bonus mechanism", which is the biggest reason why this going nowhere right now, and possibly never.
Title: Re: [Answered][Question] Should the soldier bonuses stack?
Post by: Thallori on April 24, 2023, 01:49:30 am
It does solve it, but in a more tedious way for the modders. You'd have to create a group, then add every weapon to it manually in the code. For your example, you could conceptually say that guns are group:1 and melee weapons are group:2, then make a commendation for every weapon in both those groups.
Title: Re: [Answered][Question] Should the soldier bonuses stack?
Post by: Juku121 on April 24, 2023, 02:25:28 am
The whole point of multiple "Master of X" commendations is that each of them does something. It is already possible to make commendations for all (or some) melee or ranged weapons with a fraction of the work necessary for redoing a stacking "Master of X" in the current system. Indeed, both XCF and XPZ already have such commendations in addition to "Master of X". That is not the problem here.

All your solution does is attribute the bonus to one of the "Master of X" commendations, which is essentially the same as having one mega-commendation awarding that bonus for an overall weapon class, and leaving all the "Master of X" commendations without bonuses.