• We have updated our Community Code of Conduct. Please read through the new rules for the forum that are an integral part of Paradox Interactive’s User Agreement.

constantinople!

General
34 Badges
May 19, 2009
1.750
28
  • Crusader Kings II: Charlemagne
  • Rome: Vae Victis
  • Victoria 2: Heart of Darkness
  • Victoria 2: A House Divided
  • Sengoku
  • Semper Fi
  • Rome Gold
  • Victoria: Revolutions
  • Europa Universalis IV: Res Publica
  • Heir to the Throne
  • Hearts of Iron III: Their Finest Hour
  • Hearts of Iron III
  • For the Motherland
  • For The Glory
  • Europa Universalis IV: Art of War
  • Crusader Kings II
  • Crusader Kings II: Legacy of Rome
  • Crusader Kings II: The Old Gods
  • Crusader Kings II: Rajas of India
  • Crusader Kings II: The Republic
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: Sunset Invasion
  • Crusader Kings II: Sword of Islam
  • Darkest Hour
  • Europa Universalis III Complete
  • Divine Wind
  • Europa Universalis IV: Conquest of Paradise
  • Europa Universalis III Complete
  • Europa Universalis III Complete
  • Victoria 2
  • Europa Universalis IV
  • 500k Club
  • Europa Universalis IV: Pre-order
  • Crusader Kings II: Way of Life
I've noticed that every time a save game is loaded the morale of all armies on the map becomes zero. This has ruined the game for me in numerous occasions. And this does not affect only the human player; the outcome of whole wars fought by the AI changes just by the random action of the human player to save his game. And if you are unlucky and your game crashes (and the game unavoidably crashes over long gaming periods) and your last savegame or autosave is in a middle of a war, you suddenly find that your carefully assembled and structured armies are cut like paper by the enemy. You can wait 6 months and still your armies don't have a chance fighting an enemy of comparable power. Needless to say, realism goes out of the window each time this happens.

And if anybody is already at war with all his armies mobilised at game reload, you can create fresh armies and cut through his vastly superior forces like they were made of paper towels.

I've seen a structure of savegames and, if I'm not wrong, the morale is supposed to be saved but it is not. I think this is the single most important thing that must be modified in order to be able to play our games properly.

Can it be done?

Rgrds
Dimitris
 
I believe it is inherent to the engine, probably somewhere deep that can't be fixed. Just like the you-must-reload-on-tag-change, which exists in all Europa engine games including FtG, and even in the Clausewitz engine.
 
It's not ALL armies on the map. Only the ones actively engaged in combat. Units NOT engaged in combat have their morale stored properly.

I'm guessing that there's two variables used to store morale - a "permanent" one and then a temporary that's used in battle. If that's the case then what's probably happening is that when battle is entered, the temporary one is set to the permanent one, the permanent one is zero'd out, and after battle, the permanent one is set back to the temporary one.

Anyway, I'm thinking there'd be some way to use a hex editor to track variables or something, find out which ones were related to morale, and then do... something to store the battle morale.

The other possibility is that morale is saving fine and not being loaded correctly if a unit is in combat. Or, perhaps, just not being loaded for in combat units. If that's the case, I have an idea for an easier fix that would just involve saving a new game after everyone withdraws from combat then running an external utility on the it to copy the particular division values back over from a previous save. Not PERFECT but, eh. Better.

---edit---

Think I fixed it :3

Okay, here's what happens. The very last section in the save file lists active combats. Here it is:

Code:
combat = { 
    id = { type = 4712 id = 19698 } 
    province = 610 
    date = { year = 1067 month = july day = 2 } 
    phase = maneuver 
    phase_counter = 2 
    attacker_losses = { } 
    defender_losses = { } 
    attackers = { { type = 4712 id = 9857 } } 
    defenders = { { type = 4712 id = 10577 } { type = 4712 id = 9824 } { type = 4712 id = 10584 } { type = 4712 id = 11360 } } 
    }

As y'all suggested, morale's NOT being saved in combat.

That led me to the simple solution. Just... reset the combat. If you delete the combat {} sections, everyone in combat STOPS being in combat and their original morale values are used. Now, this DOESN'T let you store the results of a combat that HAD been in progress, as it essentially resets them, but... that's minor. They get back into combat immediately so. Just with better morale values.

The only way I can see this causing a problem is if you save and reload CONSTANTLY over really short periods of time. Like, every ten days or less. Then, wars will *never end*. Beyond that...

Now only two more things need to be done:

1. Write a program that automatically strips the combat sections from the saves so you don't have to do it manually each time.
2. Write a batch file so that you can have it automatically do this when you quit CK.

---edit2---

Wait, will this cause multiple combat results? I don't think it will since it just deletes the combats and they won't store a result. Even if it does save the results, it'd be neutral, I think, so it shouldn't mess up war score...
 
Last edited:
My empirical (but non-rigorous, admittedly) observations would suggest that morale isn't saved for out-of-combat regiments or stacks either.

Try it: Raise an army, save, load, declare war and attack some neighbouring muslim minor or something. You'll lose, even with numerical superiority and a better marshal, I think. Or when you're being invaded, save, load and watch your fresh army wipe the floor with the loaded up invaders.

Too bad you can't see morale before you actually get in combat in CK. :(
 
Too bad you can't see morale before you actually get in combat in CK.

What about when you click on a stack, click on a specific army in the stack, and it gives you a morale stat..?

---edit---

Okay, you're right about the units made pre-save getting wiped out easily thing. What's odd though, is that your morale stat in the unit view window DOES show their proper morale.

If that IS the case then the unit's morale that you see in the menu has absolutely nothing to do with their actual combat morale...

---edit2---

Doing some more experimentation.

I think the morale IS being saved and loaded.

I think the number's being saved are somehow wrong, though.

Experiment A: Edit the saves to give troops really HIGH moral.

Playing as Byzantium, I deployed some units in... Ani, Theseodopolis, Vaspurakan... whatever's out that way. Vaspurakan, with 200 units, is ALWAYS being created after I load a game that was saved AFTER DoWing... Kartli, and having Kartli deployed.

Kartli is afflicted by zero'd out morale, and loses pretty mush as soon as Skirmish phase enters (What happens during skirmish, by the way, that causes the sudden, massive morale hits? Nothing happens during... whatever phase is before that and after maneuver. Or maybe it's maneuver -> skirmish -> something else. It's the third stage of combat where the issue becomes apparent.)

Experiment B:

Playing as Byzantium. Save AFTER experiment A. Set Vaspurakan's morale in the save to 100.371 , which translates to 100371% morale. After a few days it normalizes down to 100%. I DoW Dwin, they deploy (post save), and I send Vaspurakan after them. There's not a HUGE difference in the number of forces (100 something compared to 300ish?) Vaspurakan, despite having their stats menu show 100% morale, is still being clearly affected by the zero'd out morale, because they lose as soon as phase three hits.

Experiment C:

Playing as Byzantium. I raise the Ani regiment, save, and exit. I set their moral to -1.000, which, in game, would be -100% but it shows up in the status screen as 0.0%. I DoW Dwin, and they raise an army post-save. I send Ani after them.

Ani, being made PRE-save, should have 0% morale. Neverthless, by the time they they get to Dwin's army, their morale is up to 40%. Okay. Whatever. Morale regenerates. Dwin's army's moral should be higher (805?) and forces shouldn't be... too uneven?

Ani wins as soon as they enter the same province as Dwin.

Conclusion:

The first two don't show anything. The LAST one shows something really anomalous that I want to explore now.

---edit3---

Did another set of experiments.

Experiment 4:

Started a new game as Byzantium. Deployed Ani. DoW'd Dwin. Dwin deployed. Saved, and exited. Manually edited the save to give Ani 1.000 morale, Dwin 0.100 morale, and made both armies have identical numbers and composition. Reloaded the game and had Ani attack Dwin. Ani won decisively with low, morale loss and, uh... Dwin lost in the skirmish phase.

Experiment E:

As per above, but the numbers were switched. Ani had morale set to 0.1000, and Dwin was 1.000. By the time Ani met Dwin, they were up to morale of 30%. In any case, Ani lost. It was a less decisive victory, with morale ending pretty close, so I repeated it. Same result. In this case, the skirmish phase was skipped completely. As per experiments A-C, both sides took unusually high morale lose during the Advance phase.

Conclusion:

Morale is in fact loading from the save files right, it seems. I think what's actually happening is: A) Morale calculations are screwy. B) Unit properties from saved units are somehow different than those from newly created units giving newly created units some kind of advantage. C) Newly created units have more than 100% morale for some reason. When the game is saved, this is set to a proper value.

I don't know. This is getting weirder and weirder.

Experiment F:

Opened combat.txt in the db folder and zero'd out all the unit morale. Began a new game as Georgia. Raised the Tao regiment and DoW'd Kartli. Troop morale average in the troop menu read 100%. Sent Tao after Kartli. Troop morale showed maximum for a second, and then dropped to zero for both sides, with Tao losing (being the small army I guess) with no loss of life occurring. Not sure the manuevering stage was even left.

If morale was actually being set to 0, this is what I would EXPECT we'd see on reload. This isn't actually what's happening, though. Combat actually takes place, but rather, morale drops off at an incredibly accelerated rate.

I'm thinking individual unit morale isn't actually being tracked, but rather, the morale value in combat.txt is more like "morale loss defense" or something. ?Not sure if that's right. I asked in someone's else's thread about it. If individual unit morale IS being tracked, it's definitely not being saved. Except, as I said, zeroing out unit morale values looks different from what I'm actually observing.

Here's another thing I noticed: Zeroing out an army's morale in the save file and letting them wait back up to 100... They still seem to have the same morale problem. NOT that sure about this one, though.

Also, why don't combat phases occur in a set order..?

---edit4---

Experiment G:

Zero'd out Shock values in combat.txt and loaded up my Byzantium game. Set Ani after Dwin. Battle continued until Ani was totally wiped out (as they had been given half as many units as Dwin).

Conclusion:

Morale is being saved fine, it seems. *Shock* values are getting screwed up for units that are already on the map. I think. So, one possible 'fix' to this probably is just to zero out ever shock value in combat.txt, which will make every battle to the death.
 
Last edited:
Thanks for your comprehensive examination MeshGearFox. Seems that the cause of the problem is much more complicated and deep than I originally thought. I could expect that it would be the first thing to be addressed by Paradox in Deus Vult, but it was completely ignored!

I'm tired to see battles changed completely after I reload -- and now I think that no matter how many months you wait, the morale of a saved/reloaded army will never become equal to the morale of an equal freshly created army. If you are unlucky and your game crashes mid-campaign, hours of effort will be lost :(
 
and now I think that no matter how many months you wait, the morale of a saved/reloaded army will never become equal to the morale of an equal freshly created army.

Yes. Don't remember if I mentioned this earlier, but I zero'd out the morale of some of my map units. Even AFTER their morale went back up the problem persisted, which made me think it wasn't actually the morale *itself* that was broken.

Ultimately, it's not going to ruin your game. Remember, it works both ways. If your game crashes mid-battle... just disband your entire army and re-deploy, then steamroll the enemy who will now lose morale like a stuck hyena (?).

Also the "easiest" fix is to just zero out shock damage completely in combat.txt, but I don't think the AI will ever retreat if its forces get too low, so... that sort of breaks things in a *different* way because now every fight will be a battle to the death. Then again maybe that'd be interesting. Certainly get rid of ping-ponging.

See, I really can't figure out what defends against shock, here. EU3 has a specific attack/defense shock/shock defense pairing. I THOUGHT unit morale was shock defense in CK but... it doesn't seem to be.

Morale calculations in general seem a little odd.

---edit2---

Here's another creative idea for a workaround.

In that recent law effect thread, someone mentioned that under Feudal Contract, armies WOULD expect to have a maximum length for their deployment.

Creating and event with a MTTH of 40 days or so, varying based on law (40 days with FC, up to 120 days with RP?) would force the player and the AI to cycle their troops a lot. This WOULD NOT fix the morale/shock issue. It would make it less of a factor.

Actually, in general, modding the game to focus on *smaller* scale warfare, or doing something to de-emphasize war altogether, could have interesting, positive effects.

Problem is I'm not sure exactly how type = remove_regiment works. I THINK that if you use type = command as the trigger, it SHOULD limit the event to the the army the commander is commanding, though it might need some extra DV scripting functions to work.

Does anyone know where I could find and overview of the new scripting features DV adds? Only thing I found on the scripting forum was for... 1.03, vanilla.

---edit3---

Other possibility might be to just up everyone's shock while dropping morale, making the base state of the game for all units closer to what happens on reload, maybe. I don't know how the AI works, though, and whether it would be capable of coping with this.
 
Last edited:
I did another experiment although it's less than conclusive.

I set the size variables in combat.txt to 1 for each unit time. I then started a new game, deployed one of my regiments, saved, declared war on Dwin, and let them fight without reloading.

What I saw was a really short battle with an average loss of life but fairly heavy morale hit for both sides.

It looks a LOT like what you see with the save game bug, making me think maybe it's the size variable that gets zerod out. I'm not really sure what size is for, as each regiment is set to 100. I'm thinking it's a general modifier, maybe? I dunno. It doesn't have any effect on how many soldiers are actually fielded and none of the improvements or advances seem to effect it.

Manually zeroing it out, unfortunately, makes the game prone to crashing, so I couldn't really test that.
 
Okay, I might be better off moving this to a new thread since it's starting to shift focus.

I'm considering some possible gameplay-driven workarounds to the morale issue.

The big problem I see, right now, is that wars in CK tend to get kind of drawn out and involve single, huge stacks of dudes. This means that the morale bug can make or break a big war where a lot of units are involved.

One idea I toyed with earlier was introducing limits on how long a unit can be deployed by making an event with a MTTH of 40 days or so which causes them to undeploy unless actively in combat or in a siege. This would also make waging wars halfway across the globe really unlikely, so Crusades would need to be removed. What this would do is basically cycle units so any that get messed up by a save and reload will just get recycled. It's easy enough to do this manually as the player, but the AI generally won't.

Another option of course is to just write something that removes all active units

A few other ideas would be:

* Make combats faster and more decisive.
* Similarly, make sieges faster.
* I don't think you can do anything to make the AI use smaller stacks inherently though the regiment loss thing might help. I'm not entirely sure how it works though. It sounds like it just removes one regiment and not the whole stack, which should do what I want here... The other problem is that dismissing a unit appears to return it to the recruitment pool. I'm not sure doing this through events works the same way or not.

Generally just make wars shorter and possibly less winner-takes-all so that this particular bug doesn't *matter*. DV making people of different religions required to negotiate the transfer of provinces would probably help too.

Also I only have vanilla so if there are any triggers and effects that DV introduces that could be useful...