DA 1.80e
(May also apply to TA; untested.)
I love the fact that it tries to calculate how much the AI will pay for a given tech/ship/planet/etc, or how much you have to pay, so we as humans don't have to (because, frankly, a computer can do that MUCH faster).
However, someone should probably take a look at that code. It's no big deal if you've only got, say, 2000BC, or even with a couple tens of thousands of BC. I was testing something (using cheat mode) in DA just now, though, and ran into SEVERE lag because of this function when my cash went over several million...my guess is it's around 5, but I'm not sure exactly. It's not like there was a lot of calculating to do, either-I just wanted one of his planets.
I've actually had one or two games where I wind up with that much money endgame, or close to endgame, and there was one game in particular that I never had that much money, but wound up making significantly more than that (about 28m BC in total) while trying to get myself out of debt-yeah, that was due to a bug; a production/buying bug on a planet got me into that hole, and eventually the UP tech vote got me out of it via Xeno Ethics-but first I had to survive and make myself 28m BC out of a 537m BC hole (that's 537,000,000BC for you folks watching at home. Well actually 536,740,000ish, but it amounts to the same thing.)
But that's neither here nor there.
Although I'm not sure exactly where the function starts to lag, my guess is (and I could be wrong), based on the amount of time it takes to compute, that it is actually trying EVERY POSSIBLE VALUE of BC.
This is clearly a problem when dealing with extremely large amounts of BC, though I wouldn't call it an everyday occurrence.
Now I know there's a simpler way to do this; there's a human way to do this. I never tried every single value before this feature, I just tried every value in a range, once I had narrowed it down by guessing too high and too low. I'm hoping the code can be modified to use that method instead, and if it does already, then I'm hoping it can be made more efficient.
Because, frankly, when my game freezes up for ~30+ seconds while doing this (not even an exaggeration) on an x1950GT/Q6600 system, there's something wrong.
I don't mean to be complaining, and this is obviously not something that everyone will experience, but it seems fixing the function would result in an overall improvement in calculation speed regardless of amount of BCs; though I admit in many cases the difference would be measured in milliseconds.
My apologies for not being as concise as I maybe could have been.