Turn Slowdown After ~100 Turns / Combat Oddities

Problems and solutions for installing or running FreeOrion, including discussion of bugs if needed before posting a bug report on GitHub. For problems building from source, post in Compile.

Moderator: Oberlus

Message
Author
ZGruk
Space Krill
Posts: 7
Joined: Mon Jan 23, 2012 5:29 pm

Turn Slowdown After ~100 Turns / Combat Oddities

#1 Post by ZGruk »

Hmm, after a very few turns (probably 1 or 2 hundred) the game gets REALLY slow between turns. It takes 2-3 minutes for it to go from one turn to the next and CPU usage skyrockets. Also, a problem I noticed from the previous version, where the map dragging gets stuck (you're not holding down the mouse, but the map is still moving) when you minimize the game, causing the CPU usage to go up, is still present.

Other than that, it's great, a definite improvement.

User avatar
Geoff the Medio
Programming, Design, Admin
Posts: 13603
Joined: Wed Oct 08, 2003 1:33 am
Location: Munich

Re: What's still needed for v0.4?

#2 Post by Geoff the Medio »

ZGruk wrote:Hmm, after a very few turns (probably 1 or 2 hundred) the game gets REALLY slow between turns.
Please attach a save file (zipped) and the .log files in the directory
discussed on this page: http://freeorion.org/index.php/Config.xml

Ideally, make new log files by loading a game and ending turn once such
that it takes a long time, then quitting the game.

If files are too big to attach, you can use an upload site and link to them.

Likely there's a particular building or tech that was completed that has a condition test that it much slower than the others. We'd need to identify which that is. You might also look at saves just before turns get slow, to see if there's something new you're producing or researching around that time.

ZGruk
Space Krill
Posts: 7
Joined: Mon Jan 23, 2012 5:29 pm

Re: What's still needed for v0.4?

#3 Post by ZGruk »

Here is the zip file. I wasn't sure which log file, so I put all of them in.

I'll work on pinning down when it got slow at some point.
Attachments
FreeOrion.zip
(293.84 KiB) Downloaded 66 times

User avatar
Geoff the Medio
Programming, Design, Admin
Posts: 13603
Joined: Wed Oct 08, 2003 1:33 am
Location: Munich

Re: Turn Slowdown After ~100 Turns

#4 Post by Geoff the Medio »

Turns out the problem is that AI empire 2 has over 800 items on its production queue, and it's taking ~5 seconds to simulate 500 turns of that queue in order to estimate completion times for those items, and those estimates are done multiple times per turn.

Edit: I added a timer and loop abort to halt simulating future turns on the queue after 0.1 seconds, which reduces turn times to a bit over 20 seconds for me with that save, most of which is not taken up doing anything production-queue related.

(Also, the save was on turn 632 - somewhat more than "1 or 2 hundred" ...)

ZGruk
Space Krill
Posts: 7
Joined: Mon Jan 23, 2012 5:29 pm

Re: Turn Slowdown After ~100 Turns

#5 Post by ZGruk »

It was turn 632 that I sent you, but the turns had been slow for some time. I can't say exactly when it started.

I thought something might be wrong with the AIs. I sent ships to conquer them, and even when the ships had high health (80-100) they were completely destroyed within 2-3 turns, sometimes when there were no defending ships.

User avatar
eleazar
Design & Graphics Lead Emeritus
Posts: 3858
Joined: Sat Sep 23, 2006 7:09 pm
Location: USA — midwest

Re: Turn Slowdown After ~100 Turns

#6 Post by eleazar »

I'm not sure how much the AI currently does. I've conquered a couple AI homeworlds with the recent version and no similar weird effects.

I wonder if the AI has researched stealth tech and you simply can't see the ships that are beating you. My conquests came after turn 100, before anybody is likely to have much stealth.

User avatar
Geoff the Medio
Programming, Design, Admin
Posts: 13603
Joined: Wed Oct 08, 2003 1:33 am
Location: Munich

Re: Turn Slowdown After ~100 Turns

#7 Post by Geoff the Medio »

ZGruk wrote:I thought something might be wrong with the AIs. I sent ships to conquer them, and even when the ships had high health (80-100) they were completely destroyed within 2-3 turns, sometimes when there were no defending ships.
If that's happening, it's not a problem with AIs, but with the combat mechanics; the AIs play by the same rules as the human player. Someone else reported a similar problem with illogical combat losses, but didn't provide a save file when asked. If you could provide a save that replicates this, and specify exactly which system / battle to examine, that would be helpful. It would be more helpful if this was reproduced in as small a galaxy with as few planets, system, and empires as possible.

User avatar
Vezzra
Release Manager, Design
Posts: 6102
Joined: Wed Nov 16, 2011 12:56 pm
Location: Sol III

Re: Turn Slowdown After ~100 Turns

#8 Post by Vezzra »

ZGruk wrote:...I thought something might be wrong with the AIs. I sent ships to conquer them, and even when the ships had high health (80-100) they were completely destroyed within 2-3 turns, sometimes when there were no defending ships.
Just a thought: Maybe the AI has researched "System Defense Mines", and there is a bug in the effect execution code resulting in more than the supposed 2 damage/turn applied to invading ships.

User avatar
Geoff the Medio
Programming, Design, Admin
Posts: 13603
Joined: Wed Oct 08, 2003 1:33 am
Location: Munich

Re: Turn Slowdown After ~100 Turns

#9 Post by Geoff the Medio »

Vezzra wrote:Just a thought: Maybe the AI has researched "System Defense Mines", and there is a bug in the effect execution code resulting in more than the supposed 2 damage/turn applied to invading ships.
Have you observed that sort of bug, or are you just guessing?

ZGruk
Space Krill
Posts: 7
Joined: Mon Jan 23, 2012 5:29 pm

Re: Turn Slowdown After ~100 Turns

#10 Post by ZGruk »

Vezzra wrote:
ZGruk wrote:...I thought something might be wrong with the AIs. I sent ships to conquer them, and even when the ships had high health (80-100) they were completely destroyed within 2-3 turns, sometimes when there were no defending ships.
Just a thought: Maybe the AI has researched "System Defense Mines", and there is a bug in the effect execution code resulting in more than the supposed 2 damage/turn applied to invading ships.
I don't think so. This happened with two separate AIs one of which was fairly non-aggressive in technology research. (At least they only had Mark Is and the others had Mark IIs and they had very few ships.)

User avatar
Vezzra
Release Manager, Design
Posts: 6102
Joined: Wed Nov 16, 2011 12:56 pm
Location: Sol III

Re: Turn Slowdown After ~100 Turns

#11 Post by Vezzra »

Geoff the Medio wrote:Have you observed that sort of bug, or are you just guessing?
Just guessing. It came to my mind when I read that this apparently happened even in undefended systems. First I thought that might be just that, the AI having researched System Defense Mines. But then I checked and saw that the damage dealt is only 2/turn, that can't bring down ships with 80-100 health in 2-3 turns. So I wondered if it might be the System Defense Mines tech nonetheless, with a bug in the effect execution code doing more damage than intended... well, as I said, just a thought.

User avatar
eleazar
Design & Graphics Lead Emeritus
Posts: 3858
Joined: Sat Sep 23, 2006 7:09 pm
Location: USA — midwest

Re: Turn Slowdown After ~100 Turns

#12 Post by eleazar »

ZGruk wrote:
Vezzra wrote:
ZGruk wrote:...I thought something might be wrong with the AIs. I sent ships to conquer them, and even when the ships had high health (80-100) they were completely destroyed within 2-3 turns, sometimes when there were no defending ships.
Just a thought: Maybe the AI has researched "System Defense Mines", and there is a bug in the effect execution code resulting in more than the supposed 2 damage/turn applied to invading ships.
I don't think so. This happened with two separate AIs one of which was fairly non-aggressive in technology research. (At least they only had Mark Is and the others had Mark IIs and they had very few ships.)
The AI is very incomplete. I haven't followed the development of it very carefully in the last couple months, but i doubt the AI can design it's own ships. The Mark i, ii are pre-designed ships, which may have been the best prebuilt designs that included the tech the AIs had.
Last edited by Geoff the Medio on Tue Jan 24, 2012 11:34 pm, edited 1 time in total.
Reason: removed blank lines in quotes

ZGruk
Space Krill
Posts: 7
Joined: Mon Jan 23, 2012 5:29 pm

Re: Turn Slowdown After ~100 Turns

#13 Post by ZGruk »

Here is a save demonstrating the illogical combat problem. Look at the battle which occurs between turns 155 and 156 at Honeydew.
Attachments
FreeOrion_Human_Player_Terran_0155.zip
(49.46 KiB) Downloaded 60 times

User avatar
Geoff the Medio
Programming, Design, Admin
Posts: 13603
Joined: Wed Oct 08, 2003 1:33 am
Location: Munich

Re: Turn Slowdown After ~100 Turns

#14 Post by Geoff the Medio »

I think what's happening is that since planets are essentially invulnerable during combat, a planet with nonzero defense gets dozens of rounds of free combat shots at enemy ships in its system. The planet can be attacked by the ships, but the only effect is to reduce the planet's construction meter, which doesn't affect its ability to continue battle. The planet's attacks against the ships, however, do damage and may destroy them, as is often seen.

User avatar
Vezzra
Release Manager, Design
Posts: 6102
Joined: Wed Nov 16, 2011 12:56 pm
Location: Sol III

Re: Turn Slowdown After ~100 Turns

#15 Post by Vezzra »

Geoff the Medio wrote:I think what's happening is that since planets are essentially invulnerable during combat, a planet with nonzero defense gets dozens of rounds of free combat shots at enemy ships in its system. The planet can be attacked by the ships, but the only effect is to reduce the planet's construction meter, which doesn't affect its ability to continue battle. The planet's attacks against the ships, however, do damage and may destroy them, as is often seen.
I've checked the logs, that is exactly what's happening. The weird thing is that the planet's defense meter shows up as 0 in the UI, although the planet actually has defense 5. And that's weird because all the other meter values of the planet are displayed correctly, so it can't be insufficient detection on the attacker's part. Or does the defense meter have a different visibility than the other meters?

On a side note, there are some other weird things I noticed when examining the combat log: Battle rounds where the colonized planets in the system attack the uncolonized ones, battle rounds where ships attack the uncolonized planets in the system, ship part stats not showing up correctly (mass driver 1 damage as 0, ROF as 0?).

Post Reply