About freeorion's performance

Programmers discuss here anything related to FreeOrion programming. Primarily for the developers to discuss.

Moderator: Committer

Message
Author
User avatar
Rydra
Space Squid
Posts: 55
Joined: Fri Jun 28, 2013 6:15 pm

About freeorion's performance

#1 Post by Rydra »

I'd wish to pose some questions about graphics just to feed my curiosity. This prolly has been discussed a hefty amount of times, yet I'm trying to clarify the reason. Freeorion, even on an "idle" state consumes an insane amount of CPU (almost always at 90-100% on a Intel I5, 55% when limiting FPS to around 24). What's the reason for such high consumption? Is it due to GG or OGRE itself? Does the screen completely redraw itself each time instead of just redrawing what's moving?

Thank you and greetings.

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

Re: About freeorion's performance

#2 Post by Geoff the Medio »

Rydra wrote:Does the screen completely redraw itself each time instead of just redrawing what's moving?
Yes.

User avatar
Rydra
Space Squid
Posts: 55
Joined: Fri Jun 28, 2013 6:15 pm

Re: About freeorion's performance

#3 Post by Rydra »

But... that's extremely inefficient IMHO. Is it the way GG is implemented or is it inherent to OGRE? Just asking.

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

Re: About freeorion's performance

#4 Post by Geoff the Medio »

I think GG is designed to render the UI every frame. Things animate in FO, so frequent rendering is required. If you want to limit rendering resource usage, use the FPS limit setting.

User avatar
Rydra
Space Squid
Posts: 55
Joined: Fri Jun 28, 2013 6:15 pm

Re: About freeorion's performance

#5 Post by Rydra »

Geoff the Medio wrote:I think GG is designed to render the UI every frame. Things animate in FO, so frequent rendering is required. If you want to limit rendering resource usage, use the FPS limit setting.
Other games (Urban Terror or Battle for Wesnoth come to my mind) require frequent rendering as well, without that much hit on CPU usage... but ohh well...

User avatar
cami
Space Dragon
Posts: 411
Joined: Tue Sep 20, 2011 10:32 pm
Location: Halle (Saale)

Re: About freeorion's performance

#6 Post by cami »

TORCS is a 3D racing car simulator. With max eye candy settings at 100% CPU/GPU, it renders 300 FPS on my machine. Freeorion renders 15 FPS. Fifteen. There's clearly some problem with rendering here, and I'm fairly certain it's not OGRE's fault. :p
Yesterday, we were still on the brink. Fortunately, today we have come one step further.

shawndream
Space Kraken
Posts: 124
Joined: Fri Nov 22, 2013 8:47 pm

Re: About freeorion's performance

#7 Post by shawndream »

I agree that it seems too heavy on rendering for a turn based game.

But developing the game part of the game seems more important than optimizing the engine.

The engine is perfectly workable as is, and not too heavy on my CPU when I crank down the frame rate.

At some point later someone good with graphics can turn the galaxy map into a static texture for each turn, and tune the refresh rates seperately for the seperate items.
Everything I post is self-created unless noted otherwise. It is simultaneously released under GPL 2.0 or later, CC Attribution-Share Alike 3.0, and GNU Free Documentation 1.2. Make something awesome with it please!

User avatar
MatGB
Creative Contributor
Posts: 3310
Joined: Fri Jun 28, 2013 11:45 pm

Re: About freeorion's performance

#8 Post by MatGB »

shawndream wrote: But developing the game part of the game seems more important than optimizing the engine.

The engine is perfectly workable as is, and not too heavy on my CPU when I crank down the frame rate.
I play on a laptop, which wasn't top of the range when I bought it three years ago, even with the framerate cranked down I've seen it hit 95% of my CPU and it's simply impossible to play on battery (the life of which is otherwise quite good given the hammering I've given it).

I thought Flash based games ate battery life and similar, that's nothing compared to FO, if it gets any worse I'll have to find a different game (and it has been slowly getting worse over time, but the most recent test release appears to be a big improvement, but still on game #1 with that).

If the test versions of the game become unplayable in such a way that testers and similar are forced to drop out because their system can't handle it, then that's a problem in itself—I would love to be able to justify a new machine. I'd love to have the option of considering it, frankly, but I don't. I have huge amounts of free time to contribute to something, and I'd like FO to get the lions share of that, but the performance issues are getting close to preventing it.

Short version: if the engine isn't optimised as the game progresses, then a) some testers will have to stop playing and b) it might become an even bigger job fixing it later on.
Mat Bowles

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

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

Re: About freeorion's performance

#9 Post by Geoff the Medio »

MatGB wrote:...even with the framerate cranked down I've seen it hit 95% of my CPU and it's simply impossible to play on battery (the life of which is otherwise quite good given the hammering I've given it).
Have you disabled galaxy gas and starfields rendering? Turning on / off optimized system rendering and detection range circles might also help. Playing with fewer systems, AIs, and monsters might also help.

User avatar
MatGB
Creative Contributor
Posts: 3310
Joined: Fri Jun 28, 2013 11:45 pm

Re: About freeorion's performance

#10 Post by MatGB »

Geoff the Medio wrote:Have you disabled galaxy gas and starfields rendering?
That makes little to no difference, have tried it several times.
Turning on / off optimized system rendering and detection range circles might also help.
Circles makes no difference, but I'd never registered the optimised rendering option before, have now turned it off but as I'm playing with the most recent test which has a lot of cleanup in other code it'll be harder to see any difference. I was mostly replying to Shawn's "it doesn't really matter" point as to me, for obvious reasons, it does, but I'm convinced the problems I experienced are unrelated to graphics, the biggest issues are planet selection, production queue changes and focus changing (and yes, when I start to encounter it again I'll be sending up a logfile).
Playing with fewer systems, AIs, and monsters might also help.
All of these do make a difference, yes, I had been limiting my games to no more than ~180 systems and limited AI numbers, plus reducing monsters helps the AI a bit as well, but at Dilvish's suggestion I've been cranking up my game sizes recently to see how well things are doing with the more recent changes.

Depending on AI settings I can now comfortably play up to ~250 systems without serious issue except once I get to 150+ colonies production queue problems and focus change delays start to kick in, I've not had to adandon a game completely recently, which I had done in the past (and uploaded at least one savegame), but it came close with the game I finished yesterday, in that case everything was fine until the turn I let 300+ ships finish production in one go (turn 198, I had stargates at every system near the Experimentors and all AIs were dead), at that point the game slowed to a crawl, it really didn't like having that many ships and that was the only real change to the previous turn.

The game I started late last night after DLing the newly compiled test release has 250 systems, I have 101 planets but am about to defeat the last AI, so nott as good a test as I'd wanted, need to get a game to 150+ planets to see if things have improved on that score, and might launch a massive fleet at some point before finishing to see if that still creates the lag.

The biggest CPU drain I ever saw was when I saved a game wher eI'd conquered half a fairly large galaxy, then loaded it in multiplayer assignign an AI to my empire, that AI on its own took 50%+ of my CPU processing its turns, not a fair test I know but indicative, a succesful AI drains the system to a fairly large degree.
Mat Bowles

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

User avatar
Dilvish
AI Lead and Programmer Emeritus
Posts: 4768
Joined: Sat Sep 22, 2012 6:25 pm

Re: About freeorion's performance

#11 Post by Dilvish »

MatGB wrote:...I'm convinced the problems I experienced are unrelated to graphics, the biggest issues are planet selection, production queue changes and focus changing (and yes, when I start to encounter it again I'll be sending up a logfile).
I'm hopeful that may be a while -- in my tests it looked like those procedures benefited from the recent changes even to a greater degree than the turn initialization processes.
The biggest CPU drain I ever saw was when I saved a game wher eI'd conquered half a fairly large galaxy, then loaded it in multiplayer assignign an AI to my empire, that AI on its own took 50%+ of my CPU processing its turns, not a fair test I know but indicative, a succesful AI drains the system to a fairly large degree.
The AI was also being slowed down by the demands of Condition evaluation; the recent changes to the Condition code has substantially sped up the AI as well. The biggest current AI cpu sinks appear to be the colonization evaluation of planets and the closely related invasion evaluations; they are each taking around 10 ms per planet on my system. I'll be looking into trying to improve that.
If I provided any code, scripts or other content here, it's released under GPL 2.0 and CC-BY-SA 3.0

OttOXBerlin
Space Krill
Posts: 3
Joined: Fri Nov 21, 2014 6:09 am

Re: About freeorion's performance

#12 Post by OttOXBerlin »

Hallo, i´new here... i find this topic "performance" and dont want to open a new topic. I only want post Screenshots.
Uuh, im from germany and my english was bad...

Look in the picture at the FPS....

http://fs1.directupload.net/images/141121/hdalbbew.png
---
http://fs1.directupload.net/images/141121/duaggn6u.png
---
http://s14.directupload.net/images/141121/hzyy9xm8.png
---
http://s14.directupload.net/images/141121/x2yp7ntd.png
---
http://fs1.directupload.net/images/141121/vhbu7be6.png

300 Starsystems, 5 KI Players

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

Re: About freeorion's performance

#13 Post by Geoff the Medio »

OttOXBerlin wrote:I only want post Screenshots.
What point are you trying to illustrate with these screenshots?

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

Re: About freeorion's performance

#14 Post by Vezzra »

Geoff the Medio wrote:What point are you trying to illustrate with these screenshots?
Judging by the screenshots, I think he's trying to point out a problem with FPS dropping to 10 and lower.
OttOXBerlin wrote:Uuh, im from germany and my english was bad...
Nun, wenn's auf Englisch gar nicht geht, dann versuch halt, das Problem auf Deutsch zu erklären. Der eine oder andere hier hat Deutsch als Muttersprache (ich zB), als Notlösung geht das also... ;)

Mitten.O
Programmer
Posts: 255
Joined: Sun Apr 06, 2014 4:15 pm

Re: About freeorion's performance

#15 Post by Mitten.O »

Perhaps you should try the latest testing release. Certain rendering performance improvements have landed after 0.4.4 was released. It would be of interest to hear how they affect you.
Any code by me in this post is released under GPL 2.0 or later.

Post Reply