I’ve been looking at this bug and am getting frustrated at our mess of a morale formula.

It’s long overdue that we pick this thing apart *publicly* so we can start with a new baseline. If we want to add some secret sauce to it after, that’s fine, but our base formula is completely out of whack.

Here are the juicy bits:

VAR_A = number of Attacker’s attacks on Defender in the last 26 turns

VAR_B = number of Attacker’s attacks on Defender in the last 26-52 turns

VAR_C = number of Attacker’s attacks on Defender in the last 52-78 turnsVAR_X = ATTACKER_SIZE / DEFENDER_SIZE

VAR_Y = 1 + ((VAR_A / 10) + (VAR_B / 20) + (VAR_C / 40)) * sqrt(100 / DEFENDER_SIZE);MORALE_LOSS = (1 + 3 * pow(VAR_X, 4/3) * VAR_Y) / pow(ATTACKER_SIZE] / 100,2/3);

You can test the formula above here:

https://imperialconflict.com/tests/morale.php

To be blunt: ** I have no idea why it’s written this way**. This is a core part of the game code that has been victim of black magic and random adjustments over the years. The current morale code above was itself resurrected from an old copy of the game files that predated the 2015 morale shake-up.

I don’t have access to the “original” morale formula, and per Stefan, there are no copies of the game files older than the ones I already have.

In short: if we want something that feels closer to the original, and/or something more balanced, we’re going to have to reverse engineer it based on what we remember. Alternatively, we can throw our expectations out the window and start from scratch.

I’m going to come up with some alternatives to test with, but those of you with math chops are more than welcome to throw out ideas of your own. The general goal is simple: the larger the gap between you and a smaller empire, the more morale you should lose.

There’s a google sheet here if anybody wants to clone it to muck around with it: