FreeOrion

Forums for the FreeOrion project
It is currently Mon Nov 20, 2017 7:00 pm

All times are UTC




Post new topic Reply to topic  [ 46 posts ]  Go to page 1, 2, 3, 4  Next
Author Message
PostPosted: Tue Aug 04, 2015 12:16 pm 
Offline
Space Krill

Joined: Tue Aug 04, 2015 12:11 pm
Posts: 6
Hi,

I have the same problem with the game, regardless of version: right now I'm testing build 0.45 (2015-08-03.af01c2f) - as the game progresses, the turns tend to change slower and slower
over time, just like the game needed more and more time to calculate data between each turns.

I can provide any log that you need, but please tell me what to do.

Thank you for making this unique game!

oh, I'm running Windows 8.1 64bit, and pretty powerful laptop (will give all specs if needed).


Top
 Profile  
 
PostPosted: Tue Aug 04, 2015 2:00 pm 
Offline
Release Manager, Design
User avatar

Joined: Wed Nov 16, 2011 12:56 pm
Posts: 4241
Location: Sol III
Ghoster wrote:
the turns tend to change slower and slower
over time, just like the game needed more and more time to calculate data between each turns.
That's exactly what's happening, and there isn't much you can do about it, except playing on smaller maps, against fewer opponents, lower planet density. What are the typical setup options you're playing with (map size, number of AI, etc.)?


Top
 Profile  
 
PostPosted: Tue Aug 04, 2015 2:58 pm 
Offline
Space Krill

Joined: Tue Aug 04, 2015 12:11 pm
Posts: 6
Vezzra wrote:
Ghoster wrote:
the turns tend to change slower and slower
over time, just like the game needed more and more time to calculate data between each turns.
That's exactly what's happening, and there isn't much you can do about it, except playing on smaller maps, against fewer opponents, lower planet density. What are the typical setup options you're playing with (map size, number of AI, etc.)?


Currently I'm playing on 200 systems, medium starlane frequency and medium planet density, AI = 5.

What settings do you recommend?


Top
 Profile  
 
PostPosted: Tue Aug 04, 2015 4:28 pm 
Offline
Creative Contributor
User avatar

Joined: Fri Jun 28, 2013 11:45 pm
Posts: 3261
Ghoster wrote:
Vezzra wrote:
Ghoster wrote:
the turns tend to change slower and slower
over time, just like the game needed more and more time to calculate data between each turns.
That's exactly what's happening, and there isn't much you can do about it, except playing on smaller maps, against fewer opponents, lower planet density. What are the typical setup options you're playing with (map size, number of AI, etc.)?


Currently I'm playing on 200 systems, medium starlane frequency and medium planet density, AI = 5.

What settings do you recommend?

If your laptop is that good, it shouldn't be causing a huge amount of lag on those setting, I could play games through with that relatively easily on my much older laptop, and we've had a number of improvements to processing over time.

Basically, every turn, and whenever you queue something in the production panel, the game has to check through various effects to work out what's going on and update your display, we're aware that there are issues on production screen regarding updating the map and similar. If there are too many things to process, this can take longer than is ideal so you get lag.

First thing I always found useful, reduce the total number of ships you have flying by scrapping old obsolete designs, you benefit from reduced upkeep costs and thus new ships are cheaper and it seemed to speed the game up for me.

I also prefer to play on Low planets as each population centre you own requires processing time and I like bigger maps, that would help a bit but a 200 system map shouldn't be causing excessive problems for a decent machine.

The other thing of course is how much slower, what is to one player an acceptable waiting time is to others an interminable wait, maybe I'm just more patient? It's bound to slow down as the game gets bigger, not much can be done to stop it completely, especially given one of the project goals is to make all the content easily customisable which requires referring to source data and similar, are we talkiing minutes, seconds or just noticeably slower but not in an annoying way?

Also, although it doesn't seem to affect it dramatically, turning off gas field rendering and possibly starfield rendering in the galaxy graphics options can produce improvements for some.

_________________
Mat Bowles

Any code or patches in anything posted here is released under the CC and GPL licences in use for the FO project.


Top
 Profile  
 
PostPosted: Tue Aug 04, 2015 6:45 pm 
Offline
Space Krill

Joined: Tue Aug 04, 2015 12:11 pm
Posts: 6
MatGB wrote:
If your laptop is that good, it shouldn't be causing a huge amount of lag on those setting, I could play games through with that relatively easily on my much older laptop, and we've had a number of improvements to processing over time.


Well, you be the judge:
Intel(R) Core(TM) i7-4700HQ CPU @ 2.40GHz
16 GB RAM
GeForce GTX860M

and the lag becomes huge in my oppinion.

MatGB wrote:
Basically, every turn, and whenever you queue something in the production panel, the game has to check through various effects to work out what's going on and update your display, we're aware that there are issues on production screen regarding updating the map and similar. If there are too many things to process, this can take longer than is ideal so you get lag.

First thing I always found useful, reduce the total number of ships you have flying by scrapping old obsolete designs, you benefit from reduced upkeep costs and thus new ships are cheaper and it seemed to speed the game up for me.

I also prefer to play on Low planets as each population centre you own requires processing time and I like bigger maps, that would help a bit but a 200 system map shouldn't be causing excessive problems for a decent machine.


Ok.

MatGB wrote:
The other thing of course is how much slower, what is to one player an acceptable waiting time is to others an interminable wait, maybe I'm just more patient? It's bound to slow down as the game gets bigger, not much can be done to stop it completely, especially given one of the project goals is to make all the content easily customisable which requires referring to source data and similar, are we talkiing minutes, seconds or just noticeably slower but not in an annoying way?


It is utterly annoying and it progresses as the game goes on. It's bearable after 100 turns and becomes 20-25 seconds after 400 turns. Is it as the game had more and more data to process as the game progresses. The laptop starts to constantly cool itself on higher fan rotation mode. :D Even the sound starts to stutter on end of every turn cycle (when next turn is about to become active). It happens just the same way, no matter whether I use built-in graphic processor or the GTX860M.

MatGB wrote:
Also, although it doesn't seem to affect it dramatically, turning off gas field rendering and possibly starfield rendering in the galaxy graphics options can produce improvements for some.


Top
 Profile  
 
PostPosted: Tue Aug 04, 2015 7:53 pm 
Offline
Pupating Mass

Joined: Fri Mar 15, 2013 12:54 pm
Posts: 96
on a quadcore 3.5 ghz SSD it takes several (5) seconds between turns on a default 150 system game and the fan spins up , at turn 300 or so


Top
 Profile  
 
PostPosted: Tue Aug 04, 2015 8:54 pm 
Offline
AI Lead, Programmer
User avatar

Joined: Sat Sep 22, 2012 6:25 pm
Posts: 4374
Ghoster wrote:
Well, you be the judge:
Intel(R) Core(TM) i7-4700HQ CPU @ 2.40GHz
16 GB RAM
GeForce GTX860M
That is certainly fine in general. My desktop stats are pretty similar, though I guess they had to keep your processor speed down to minimize heat. Mine is an i7-4770K @3.5 GHz, and I commonly play 300-500 systems with 10-20 AIs. If the per turn delay was 20 seconds at turn 400 though I probably wouldn't really think twice about that.

This thread got me a bit curious for details, so I made a testgame with 200 systems, most things on medium except no monsters, 6 empires (AI, my empire did nothing but observe) , and plotted the times to turn 300-- it really ramps up towards the end. Keep in mind this is AI -only, and the lead was up to 2k PP per turn at the end, well ahead of the others and probably was still just cranking out a ton of ships.
Attachment:
times.png
times.png [ 25.97 KiB | Viewed 1737 times ]


The basic problem is that there gets to be just so many objects interacting. I think we had gotten rid of all processing behavior that led to N-cubed processing times, but maybe it was just n^4, and there are surely still at least some N^2 logN behavior, and then also ships are being created at a faster rate as well (killed at a faster rate, too, but I think the creation rate rises faster).

Anyways, it was surprising to me to see just how steep it the curve got there, perhaps sometime someone could follow up on it more to see which effects are making the most trouble, etc.

_________________
If I provided any code, scripts or other content here, it's released under GPL 2.0 and CC-BY-SA 3.0


Top
 Profile  
 
PostPosted: Wed Aug 05, 2015 7:46 am 
Offline
Release Manager, Design
User avatar

Joined: Wed Nov 16, 2011 12:56 pm
Posts: 4241
Location: Sol III
Dilvish wrote:
The basic problem is that there gets to be just so many objects interacting. I think we had gotten rid of all processing behavior that led to N-cubed processing times, but maybe it was just n^4, and there are surely still at least some N^2 logN behavior
I think the basic problem here is the way our scriptable effects framework has been designed. To provide maximum flexibility, basically each object can influence/interact with each other object. So, the algorithm has to walk through each effectsgroup of each universe object, tech, special etc., and each of them can potentially affect each universe object.

Now, my math skills are quite humble, but AFAIK this means there is absolutely no way to get below n^2 behavior. Which consequently leads to curves like the one above, I don't see a way to avoid that (other than to completely redesign the entire effects mechanism, which does not sound particularly appealing... ;)).


Top
 Profile  
 
PostPosted: Wed Aug 05, 2015 8:19 am 
Offline
Programming, Design, Admin
User avatar

Joined: Wed Oct 08, 2003 1:33 am
Posts: 12014
Location: Munich
Vezzra wrote:
To provide maximum flexibility, basically each object can influence/interact with each other object. So, the algorithm has to walk through each effectsgroup of each universe object, tech, special etc., and each of them can potentially affect each universe object.
Not necessarily; some effects only act on the source object with a relatively simple modification, and in that case the time to execute should be nearly constant per effect / source object, so roughly linear in the number of objects producing those effects, or maybe nlogn if there are some lookups in ObjectMaps involved in the preprocessing. There will still be other cases with higher order dependence on numbers of objects, though.


Top
 Profile  
 
PostPosted: Wed Aug 05, 2015 9:54 am 
Offline
AI Contributor

Joined: Tue Feb 17, 2015 11:54 am
Posts: 224
Vezzra wrote:
So, the algorithm has to walk through each effectsgroup of each universe object, tech, special etc., and each of them can potentially affect each universe object.

Now, my math skills are quite humble, but AFAIK this means there is absolutely no way to get below n^2 behavior.


I think your math skills are good enough to have heard about the distributive property.
Code:
1*1 + 1*2 + 1*3 + ... + n*1 + n*2 + ... + n*n = (1+... + n) * (1 + ... + n)


So while each of the objects interacts which each other, I can do n^2 operations in 2n+1 operations instead.

Generally, you have some complexity O(g*n) where g is the number of "groups" of operations you perform which may be smaller than O(n) (e.g. O(1) as in the example above).

Now in FO, g = O(n) so the asymptotic behaviour wouldn't change. I do not feel qualified enough to discuss whether this would still provide measurable performance boost (or is even compatible with current implementation) to e.g. cache all effects that affect all planets/ships of an empire/species ...

_________________
If I provided any code, scripts or other content here, it's released under GPL 2.0 and CC-BY-SA 3.0


Last edited by Morlic on Wed Aug 05, 2015 11:28 am, edited 1 time in total.

Top
 Profile  
 
PostPosted: Wed Aug 05, 2015 10:59 am 
Offline
Space Krill

Joined: Tue Aug 04, 2015 12:11 pm
Posts: 6
Oh my goodness, I knew that people working on such game are brainy...but still...wow...

Anyways, if would you find mathematical solution to make the code more efficient, that would be freakin' revolutionary for this game.

I don't think AI's are the problem. If I eliminate 1 of 3 from the game, the "processor eating" proccess still goes on and on.

I'm on turn 450 and waiting time for next turn varies from 5-6 seconds to 106 seconds (counted!). Craziness. ;)


Top
 Profile  
 
PostPosted: Wed Aug 05, 2015 11:13 am 
Offline
Programming, Design, Admin
User avatar

Joined: Wed Oct 08, 2003 1:33 am
Posts: 12014
Location: Munich
Ghoster wrote:
Anyways, if would find mathematical solution to make the code more efficient, that would be freakin' revolutionary for this game.
You might not appreciate the current state of the code, but compared to how long the effects calculations used to take, there have already been quite dramatic improvements / optimizations.

One thing you could do is start up FreeOrion, go into the options UI tab, and turn on verbose logging. Then load a saved game that currently take a long time (by your standards) to process a turn, and end turn. Then quit, and find the .log files, zip them up and attach to a forum post. They might be quite large, so preferably delete them all before starting, make sure to start the game anew, and play just one turn. It will probably take extra long to process the turn, but the log files should have some potentially useful timing info in them. Saving the game in XML format and attempting to post might also be helpful, though the file might be too big for the forum to allow it to be attached.


Top
 Profile  
 
PostPosted: Wed Aug 05, 2015 11:23 am 
Offline
Release Manager, Design
User avatar

Joined: Wed Nov 16, 2011 12:56 pm
Posts: 4241
Location: Sol III
Ghoster wrote:
Oh my goodness, I knew that people working on such game are brainy...but still...wow...
I can understand you well. When I try to follow some discussions here, I often feel like Sam in this strip: http://freefall.purrsia.com/ff300/fv00215.htm. "It's really simple" - "Yeah, right."

You have seen nothing yet, though. Take a look at some of the discussions of our AI folks for example. Oh my...
Quote:
I'm on turn 450 and waiting time for next turn varies from 5-6 seconds to 106 seconds (counted!). Craziness. ;)
Hm. That's odd. Usually turn execution times don't vary that much.


Top
 Profile  
 
PostPosted: Wed Aug 05, 2015 11:26 am 
Offline
Pupating Mass

Joined: Fri Mar 15, 2013 12:54 pm
Posts: 96
the amount of systems could also be brought down to 100

I find 150 to be on the high side already to manage manually (gets boring and tedious in the endstages), but then again, space is vast so.

more threading of the turn calculations may be possible.


Top
 Profile  
 
PostPosted: Wed Aug 05, 2015 11:35 am 
Offline
Space Krill

Joined: Tue Aug 04, 2015 12:11 pm
Posts: 6
Geoff the Medio wrote:
Ghoster wrote:
Anyways, if would find mathematical solution to make the code more efficient, that would be freakin' revolutionary for this game.
You might not appreciate the current state of the code, but compared to how long the effects calculations used to take, there have already been quite dramatic improvements / optimizations.

One thing you could do is start up FreeOrion, go into the options UI tab, and turn on verbose logging. Then load a saved game that currently take a long time (by your standards) to process a turn, and end turn. Then quit, and find the .log files, zip them up and attach to a forum post. They might be quite large, so preferably delete them all before starting, make sure to start the game anew, and play just one turn. It will probably take extra long to process the turn, but the log files should have some potentially useful timing info in them. Saving the game in XML format and attempting to post might also be helpful, though the file might be too big for the forum to allow it to be attached.


Thank you very much, I'll be sure to do it. Always glad to make an even small contribution. I appreciate the work done, don't get me wrong. But it's just still not close to the state to provide a prolonged, comfortable gameplay. But I still play though :D


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 46 posts ]  Go to page 1, 2, 3, 4  Next

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group