Page 1 of 1

Game's sloooooooow

Posted: Thu Jan 03, 2019 6:57 am
by xahodo
So, I'm currently playing a map with 1000 stars (I like a huge universe :D ), researched all techs (I like to turtle) and when trying to play the game everything... well... takes about a second to actually happen.

Is there a memory leak somewhere or something? In early game it didn't take all that long for a turn to happen, now I've got to wait (about 15 seconds) for a turn.

Also, construct something? wait a second. Double-click on a planet? Wait a second. The entire UI just feels too slow to be acceptable.

I'm playing 0.4.8.

Re: Game's sloooooooow

Posted: Thu Jan 03, 2019 9:28 am
by Oberlus
My impressions:
- More objects means more saving time when pressing "next turn" (on the turns that autosave is done, so increasing number of turns per autosave may greatly reduce waiting times) and more time for UI calculations (which slows down the UI responsiveness, which seems your problem).
- More AIs or bigger empires (spanning more systems/planets) means more AI calculation time when pressing "next turn".
- More systems means bigger empires and more objects.
- All this grows with time, a game that can run smoothly (immediate response) on its first 50 turns may be really sluggish late game.

You need a fairly powerful machine to be able to run smoothly a 1000 systems galaxy unless playing against very few AIs and not running into late game.

Re: Game's sloooooooow

Posted: Thu Jan 03, 2019 8:30 pm
by Peter524
I just happen to have implemented a couple of improvements to the UI yesterday, including some significant performance boosts on the client and server side. I'm playing a 800 star system map, with 20 AIs. With the changes, to me, the UI still feels snappy after 250 turns. This includes changing my rather long build queue, selecting other systems, opening the production screen and selecting fleets. I can see about half of the universe.
Only the turn change still freezes the UI for two or three seconds - much shorter than before. On these occasions sometimes the sounds stops briefly.

If you can compile from source you can try my changes at ... nSidePanel until i come around to advertise some of the UI changes I made and properly prepare a pull request.

If you can't compile from source, you might want to try to:
- Keep your production queue as short as possible. In vanilla FreeOrion 0.4.8 the production queue becomes rather slow when it becomes longer. The production queue is recalculated every time you select a system, even when the production screen is not open.
- Enable binary serialization. I believe you need to restart FreeOrion for this config change to take effect.
- Alternativly, disable zlib-xml compression. This compression methods works very badly with large systems. It tries to serialize everything to memory first, but always fails after some seconds, because it can't allocate a continuous block of memory of the size required. It then fallbacks to binary serialization, taking another couple of seconds to complete. Again, restart FreeOrion to make this config change take effect.
- Increase the number of turns when an autosave is made. I play with 5 turns.

If you want to try to compile my changes, make sure to have at least one savegame with non-zlib XML at hand. Your newly compiled version will most probably not be able to load the binary savegames of vanilla 0.4.8.

Re: Game's sloooooooow

Posted: Fri Jan 04, 2019 6:19 pm
by xahodo
Thanks for the replies.

I've got one question, though. How do I enable binary serialization? In the settings I see something about "Create binary save files", but nothing to enable binary serialization.

Re: Game's sloooooooow

Posted: Sat Jan 05, 2019 5:09 pm
by Peter524
Yeah, that's what I meant, "Create binary save files". I guess I was lost in tech parlor.