forceinfinity forceinfinity

Performance Issue (Here's what I noticed)

Performance Issue (Here's what I noticed)

I'm sure it's been reported here and there that performance gets to be an issue when you get toward the end of games on the larger maps. I noticed something rather striking when at one point, I adjusted my military slider to zero. When I did that, the performance got ALOT better. So this begs the question of why it is so much slower and what is it about military that's dragging it down.

Now based on a few things I'm seeing, I don't think the bottleneck is the AI. It seems to be doing okay on its own. But one other thing happened that made me wonder. Toward the end of this aforementioned game, I gave away something like 15 defenders to a minor civ. When that happened, my computer froze for 2 to 3 minutes.

I find this stunning since I'm on an Athlon XP 1700 with 512mb of RAM. (Galciv's memory footprint is only about 180mb, so it fits entirely in memory)

It seems to me that Galciv slows down when it is either inserting ships into your fleet, or moreso when moving ships from your fleet into the computers. Being a software engineer myself, I find it strange that it should take slow long to move a collection of say 15 objects and stick them into another collection of only maybe 5 objects.

The only thing I could think of that maybe slowing things down is that there's a sorting algorithm going on when these kind of transfers take place, but the Big O of moving ships into a fleet or transfering them shouldn't be that big, unless these ships are presorted in some way. The operation should be quick, even assuming a doubly linked list how the ships are organized, because these are mostly straight integer type operations.

I also noticed the same thing when giving away planets (which seems to cause worse problems). Again, you should only need to move objects from one place to another, which shouldn't be *that* expensive of an operation.

It would seem to me that something like this can be fixed, unless there's something else associated with these moves that I'm not privvy to. Is there a way this can be fixed?

SeanB
1,171 views 29 replies
Reply #26 Top
I agree that these calculations should be done as a batch. Not to mention I thought all this was supposed to take place on the AI's thread and not on the main game thread. It seems these trades are blocking on the main thread somehow, hence the non-response thing that goes on. Makes me think that there's almost an internal database engine being run and that its blocking on some sort of database transaction.

SeanB
Reply #27 Top
Infodragon:

You've been able to explain something to a project manager? I bow in awe and offer you a cup of tea and a potted flower. (See the Infinite Improbability Drive thread) =D
Reply #28 Top
Hmmm I had an AMD 1 gig machine on a geforce 4 vid card % 512 MB ram. The game was super slow as hell between turns, saving, loading, etc. I now have a brand new P4 with a new released gigabyte motherboard 2.53 (capable of hyperthreading when it is available). The game loads super fast now, no pause between turns or any issues at all. It is amazing too see actually if performance is an issue uprgade. :D I guess the amount of data being crunched requires a lot of power. :d

~SDC~
Reply #29 Top
The Hyperthreading was an option that never got fully implemented and is now incompatible with the current code.

Background loading loads the Gal Civ screens while the intro movies are playing. The reason that it defaults to off is that it can make animation/sound jump. But it only is relevant when Gal Civ is starting up.