Spielerando

Merging fresh recruits into a veteran squad should not give a free rank

Players learn to top up their best squad with new recruits, or to split it and merge it back. If experience is added up the wrong way, the squad ranks up for nothing, or loses its rank for no reason. This entry shows what to store so joining, splitting and losing soldiers all stay fair, and the numbers never drift.

Why this works

Experience belongs to the people in a group, so it has to be kept as a total that moves with them. An average is only a way of looking at that total. Keep the total and every join, split or loss stays exact, however often you repeat it.

When not to use it

Skip it when every soldier is an individual with a name and a story, such as a small band of heroes. There each person should keep and show their own rank, so track them one by one instead of as a pooled group.

In the full entry

  • What to build, step by step
  • Starting values and the reason for each
  • 3 common mistakes and the fix
  • 32 lines of example code with 4 checks that pass
  • How your AI shows you that it works

Say this to your AI

Use the Spielerando entry "Merging fresh recruits into a veteran squad should not give a free rank" (read_entry merging-squads-must-average-their-experience) in my game. Build it step by step, and show me how you checked that it works.

Or skip this and connect the MCP: your AI then finds all of this by itself.Connect the MCP