This is an old revision of the document!
Loggy's combat sim reverse engineering notes
This is me going through a lot of stuff in no particular order. Most if it probaly won't be interesting to anyone or have info that makes someone else think "what is the significance of this", but all my past attempts at looking at chunks of the combatsim code and trying to figure out what the heck is going on have died sadly.
For some reason I find myself starting at unit deployment on the field. I actually started at the beginning of the "dobattle" function which sets up and then calls the main battle sim until it's done. This was the first bit which is nonobvious enough to feel worth making notes on…
All units not in squads get one created for them and they are all assigned together, which doesn't have a commander. I assume this is the Big Blob of Unscripted Stuff when you get attacked and have units not on commanders. This has morale play implications, as it seemingly will happily mix "normal" morale units with mindless ones in the same squad and so it might be possible to deliberately make a resulting Big Blob squad have an extraordinarily high average morale
Spawn blood slave units (and take the "gems" off the commanders). Each commander's slaves live in their own squad, and slaves are given an action type of 8 and unit target of the commander that spawned them, and a squad target of 0
My head hurts and I got disatracted. :(