Now, I have a good hunch where the battle replay inconsistencies might be coming from. I have logged the replay from the game that I posted on the page before. It's very short, only 7 turns, and not too crowded, which is good. I removed all the graphic display logging information from the log of the battle replay, and diffed the files against each other. The relevant sections from the log files are attached to this post. The diff can be inspected in a highlighted format at
http://paste.pocoo.org/show/111416/ (removed lines from the original battle generation are in red, new lines from the battle replay are in green)
The battle rapidly develops very differently, as can be seen from the amounting changes between the log files. What stands out as one of the first real changes is
Code:
- est. choices 24
+ est. choices 26
which, as I interpret it, shows the available spells that a mage may cast, and evaluates their usefulness. In the battle replay, there are two more choices. A little later you see the same:
Code:
- est. choices 40
+ est. choices 42
The evaluation of spells from then on differs a little, because, it seems, there are more spells available. And this evaluation may be using the RNG, so that it then corrupts the battle replays because it uses more random numbers, thus giving different random numbers for target and hit and damage determination.
What I'm getting at, I think the problem is that during hosting, the game may be using the old spellbooks. And during replay, the game may be using the new spellbooks with the spells that have been researched during the last turn. I can't proof it, but that's what seems the most likely to me.
Another possibility is that the battle background is different. The "OptimizeWorld" lines differ even before anything regarding the spells pops up in the diff. May be worth looking into, too.