Author Topic: [FIXED] Unranked soldier types now count towards promotions  (Read 1553 times)

Offline Warzameg

  • Sergeant
  • **
  • Posts: 20
    • View Profile
[FIXED] Unranked soldier types now count towards promotions
« on: October 10, 2023, 09:18:47 pm »
Someone on the XPZ Matrix server has reported that the manual promotion feature had a knock on effect that probably wasn't intended: unpromotable soldier types (like XPZ repentia and pirate dogs) are now counted for the purpose of determining additional promotions for other units.

They offered the following repo links in support of this statement:

- https://github.com/MeridianOXC/OpenXcom/pull/113/files#diff-38a268ab06f7fcb5ead399d427eef51f8e31623789d4821dc1eb87ea1a2f6d8d
- https://github.com/MeridianOXC/OpenXcom/blob/8f1dd59ad1a27485b841f68a068556c403f72fd0/src/Savegame/SavedGame.cpp#L2436C47-L2436C47
- https://github.com/MeridianOXC/OpenXcom/blob/90f79de0cb01926c79b48dfce57b4515b446f2dc/src/Savegame/RankCount.cpp#L55C2-L55C2

This has a significant gameplay effect in XPZ, since it substantially increases the effective costs for unpromotable troops that are balanced around being low cost.  Since it seems like an accidental consequence of a feature addition, it seemed right to treat it as a bug.

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9084
    • View Profile
Re: Unranked soldier types now count towards promotions
« Reply #1 on: December 02, 2023, 09:17:28 pm »
I am probably missing some information to fully understand...

Someone on the XPZ Matrix server has reported that the manual promotion feature had a knock on effect that probably wasn't intended

That's possible.
I fixed about a dozen bugs in that PR before merging, but there may be more.

unpromotable soldier types (like XPZ repentia and pirate dogs) are now counted for the purpose of determining additional promotions for other units.

How did it work before this feature was added?

This has a significant gameplay effect in XPZ, since it substantially increases the effective costs for unpromotable troops that are balanced around being low cost.

I don't understand this.
How does any of this increase the cost of anything?
I need some example to understand.

Since it seems like an accidental consequence of a feature addition, it seemed right to treat it as a bug.

Yup, thanks for the report.

Offline zRrr

  • Sergeant
  • **
  • Posts: 31
    • View Profile
Re: Unranked soldier types now count towards promotions
« Reply #2 on: December 02, 2023, 10:32:21 pm »
1. Original feature description:

Exclusion of soldier types from promotions is now possible:

Code: [Select]
  - type: STR_SOLDIER_S
    allowPromotion: false

Technically, these guys are rookies.
Instead of rookie, description STR_RANK_NONE is used everywhere.
For promotion mechanics, these soldiers don't exist... i.e. cannot be promoted and also don't count into number of soldiers when determining promotions eligibility.

Translations:

Code: [Select]
      STR_RANK_NONE: "-"

2. Now game ignores allowPromotion: false, dogs count for soldiersPerX, which leads to more high ranked troops, and higher ranked troops cost more money monthly.


SavedGame::processSoldier was skipping unpromotable soldiers, but that check was lost, when code was extracted to RankCount.

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9084
    • View Profile
Re: Unranked soldier types now count towards promotions
« Reply #3 on: December 02, 2023, 10:39:09 pm »
got it, thanks!

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9084
    • View Profile