Log in

View Full Version : Just what does the computer think about during battles?


JonBrave
March 17th, 2011, 04:49 PM
OK, I play Dom 3 (SP) on an old desktop. Let's not debate how slow it is, it's slow! Maybe a minute resolving between turns, no problem.

I've noticed during post-turn-battle-watch that, particularly during big battles, it will regularly spend, say, 10 seconds just between one mage's action and the next (either side). It's not a graphics speed issue, nothing's happening (and yes I do click "fast-forward").

Now, my understanding is, when the computer does an end turn sequence, it must actually "play out" the battles, saving all the choices/dice rolls/outcomes as it goes, and the battles are "visual replays" of what happened.

Even on my PC, 10 seconds between "moves" is a lot of execution time --- though you guys might not notice so much. So, I am interested, what could it possibly have to think about at that point for so long?

JonBrave
March 17th, 2011, 05:02 PM
Now, my understanding is, when the computer does an end turn sequence, it must actually "play out" the battles, saving all the choices/dice rolls/outcomes as it goes, and the battles are "visual replays" of what happened.


I wonder whether I've just figured my own question? I had assumed that during end-turn the battle moves were saved, and later just replayed. I guess instead Dom3 must rely on re-resolving the battles but with visuals during View Battle, and dice-rolls repeated as they were. With a sufficently robust deterministic algorithm. And hence the occasional glitch where people report different visual behaviour from result, where it doesn't quite get it "right"?

[EDIT]
OK, even if this is so, 10 seconds per move per mage is way longer than it's taking during end-turn-resolve phase?

iRFNA
March 17th, 2011, 06:26 PM
It's thinking about skipping gleefully through a grassy meadow.

Gandalf Parker
March 17th, 2011, 11:33 PM
There have been many threads which discuss this. I should dig up some of the better ones and post the links. Maybe later if there is interest.

Some tips:

If you turn on logging (the -dd switch) you will get a text log with everything the game is thinking. How it rates your actions, decides results, adds things to the game, AND the thinking of the AI. To record that for even ONE turn is a really really big file. For example: for a recent discussion on how to improve AI casting I pulled out one small bit of a log. This is the AI thinking about ONE mage namedZrakhnadar in ONE round of ONE combat to cast ONE spell.
http://www.dom3minions.com/files/spell_ai.txt

Also if you play a game with computer players and turn on computer turns (the hidden switch of --comptrn ) then the game will save .trn files for the computer players which you can pick up and view