Skip to content

Add single-soldier coin training addon - #1928

Merged
Flamefire merged 3 commits into
Return-To-The-Roots:masterfrom
DevOpsOfChaos:sidequest/single-soldier-coin-training
Oct 4, 2026
Merged

Flamefire merged 3 commits into
Return-To-The-Roots:masterfrom
DevOpsOfChaos:sidequest/single-soldier-coin-training

Conversation

@DevOpsOfChaos

@DevOpsOfChaos DevOpsOfChaos commented May 1, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • add an optional SINGLE_SOLDIER_COIN_TRAINING addon
  • make one gold coin promote only one eligible soldier when the addon is enabled
  • select the currently lowest-ranked promotable soldier for that single promotion
  • keep the default rank-chain coin training behavior unchanged when the addon is disabled
  • add regression coverage for both default chain training and single-soldier training

Motivation

By default, one consumed gold coin can promote a chain of eligible soldiers in a military building. This can make coin usage much more efficient when several promotable soldiers are present, but it also encourages micromanagement when players want to control coin efficiency more narrowly.

This addon provides an optional alternative where each delivered coin promotes only one eligible soldier. The selected soldier is the lowest-rank soldier that can still be promoted, matching the narrow behavior discussed in #1418.

The goal is not to replace the existing training model. It is a small optional gameplay variant for players who prefer one-coin-one-promotion behavior.

Scope / safety notes

This PR only changes how many soldiers one consumed coin can promote when the addon is enabled.

It intentionally does not change:

  • gold delivery
  • coin storage
  • military building capacity
  • training timing
  • soldier rank limits
  • mine output
  • default chain-training behavior

When the addon is disabled, the existing promotion-chain behavior remains unchanged.

Validation

  • Built Test_integration locally with Visual Studio 2022 / Debug
  • Ran Test_integration.exe --run_test=AttackSuite/CoinTrainingUpgradesRankChainByDefault --report_level=short
  • Ran Test_integration.exe --run_test=AttackSuite/SingleSoldierCoinTrainingUpgradesOnlyLowestRankSoldier --report_level=short
  • Ran Test_integration.exe --run_test=AttackSuite --report_level=short --log_level=error
  • Passed locally:
    • 23 test cases out of 190 passed
    • 167 test cases out of 190 skipped
    • 1258 assertions out of 1258 passed

Fixes #1418

@DevOpsOfChaos
DevOpsOfChaos force-pushed the sidequest/single-soldier-coin-training branch from 0805fe3 to b8c1f50 Compare May 1, 2026 15:51
Comment thread libs/s25main/addons/AddonSingleSoldierCoinTraining.h
@DevOpsOfChaos
DevOpsOfChaos force-pushed the sidequest/single-soldier-coin-training branch from 659905e to 707fef9 Compare May 3, 2026 10:24
@DevOpsOfChaos
DevOpsOfChaos requested a review from Flamefire May 3, 2026 10:25
@DevOpsOfChaos

Copy link
Copy Markdown
Contributor Author

Pushed a small follow-up.

This fixes the formatting issue and moves the addon ID into my own addon namespace as 0x01100002.

No gameplay behavior change.

Flamefire
Flamefire previously approved these changes May 3, 2026
@Flamefire
Flamefire enabled auto-merge May 3, 2026 11:16
auto-merge was automatically disabled June 22, 2026 12:45

Head branch was pushed to by a user without write access

@DevOpsOfChaos

Copy link
Copy Markdown
Contributor Author

Updated the branch against current master and resolved the resulting conflicts.

During the update, the previous addon ID conflicted with the still-open stranded-soldier return-search PR. SINGLE_SOLDIER_COIN_TRAINING now uses the audited free ID 0x01100002; gameplay behavior is unchanged.

Validation passed locally:

  • AttackSuite: 24 test cases / 1294 assertions
  • default coin-training behavior: 36 assertions
  • single-soldier coin-training behavior: 36 assertions
  • ctest -R "^Test_integration$": passed
  • clang-format dry-run: clean
  • git diff --check upstream/master...HEAD: clean

Flamefire
Flamefire previously approved these changes Jun 30, 2026
@Flamefire
Flamefire enabled auto-merge June 30, 2026 11:27
@Flamefire
Flamefire force-pushed the sidequest/single-soldier-coin-training branch from e01acf4 to 362da5f Compare October 4, 2026 09:30
auto-merge was automatically disabled October 4, 2026 09:30

Head branch was pushed to by a user without write access

Flamefire
Flamefire previously approved these changes Oct 4, 2026
@Flamefire
Flamefire enabled auto-merge October 4, 2026 09:33
@Flamefire
Flamefire force-pushed the sidequest/single-soldier-coin-training branch from d7d6a2b to 362da5f Compare October 4, 2026 10:20
Flamefire
Flamefire previously approved these changes Oct 4, 2026

@Flamefire Flamefire left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rebased, resolved conflicts and added the remaining change to the test

@Flamefire
Flamefire force-pushed the sidequest/single-soldier-coin-training branch from ffbe78b to 508762a Compare October 4, 2026 21:36
@Flamefire
Flamefire merged commit e4ec788 into Return-To-The-Roots:master Oct 4, 2026
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Addon: Make coins increase rank of only 1 soldier

2 participants