Bug Reporting

Heh, I forgot to turn on NoCustomAssets in that mod test, so I was still using BUG. Okay, I have verified that the delay is not there without BUG, or at least it's not as severe.

I've now done some timings on the BUG code and found that redrawing the plot list when there are this many units takes roughly 350 ms (compared to 50 ms for stock BTS). It takes 85 ms to hide all the icons and 220 ms to draw them again. The way that PLE (and all Civ4 code) works is that it hides everything and then shows what needs to be shown each time it does an update.

One difference is that stock BTS has 3 items per unit: the icon, the dot, and the health bar. BUG (PLE) adds four: movement bar, upgrade indicator, promotion frame, and mission tag. Disabling these options drops the draw time to 75 ms.

There are two places I can see to improve the time:

1. Avoid hiding and showing an element that isn't changing. This could speed up the process slightly.

2. Add code to detect when the only change is the units that are selected. This could possibly greatly speed up the process because none of the elements would actually be redrawn. Instead, only the icons highlight (yellow frame) would be toggled. The problem is that I have no idea how to do this. Civ4 doesn't have any events for units being selected/deselected. All I get is a "redraw all the unit icons" call with no information as to why I'm being told to redraw them.

Recoding PLE to do (1) would be pretty costly, and I don't know how big the payoff would be. If the slowdown really hurts, turn off some of the PLE features in the late game.
 
EF - did you run that test with PLE disabled but all of the other options still on?
 
Yes, PLE is not the culprit. The slowdown is caused by the additional UI elements. Both showing and hiding a graphical element such as an icon or stacked bar take a surprisingly significant amount of time to execute. And the non-PLE mode adds all the same graphics--just in different locations.

Just for fun I'll explain how I would go about addressing this issue. I would create a data structure that holds all of the data describing which graphics are displayed for each cell in the plot list.

Code:
[B]class PlotListCell[/B]

int unitType
boolean selected

boolean injured    [these three determine which dot to show in the top-left]
boolean canMove
boolean greatGeneral

int health

int movesLeft
int movesTotal

boolean promotionAvailable

boolean upgradeAvailable

int mission

Before drawing the plot list, I'd create a list of all the cells by examining the units on the plot and their attributes. Then I would compare the new list to the previous list and only modify the graphics that need it.

For example, say you have two Warriors on a plot, both fortified and fully healthy. You now click on a new plot where you have a sentry Warrior and a fortified Archer. Instead of erasing and redrawing all the graphics you would only change the image of the 2nd cell to an Archer and the mission tag of the 1st cell to Sentry.

Since most plots contain different sets of units, little time would be saved when clicking on a new plot. However, whenever you select different units on the same plot, none of the graphics would need to be changed. The only change would be the yellow highlight around the units that were (de)selected. This could significantly improve unit selection time on plots with a lot of units.
 
The animations from building wonders look all scrambled. I downloaded BAT 1.2 the day it came out, and installed solvers unofficial around the same time. Any idea what's going on? Thanks.
 
This is not really a critical gameplay bug. But something I wanted to ask about.

You can see this was a fix in the 3.17 patch on the maininterface.
attachment.php


attachment.php


And here bug has the older version on where the domestic advisor sits. Just wondering if you guys had noticed and if any plans to change to the default 3.17 screen.
 
@johny smith - Yes, this was changed in the 3.17 patch. Ideally, we'd detect which version was active and adjust the elements accordingly. The PITA part is getting everything to line up correctly (research, GG, and GP bars and text, and the research icons).

It's not particularly difficult to do, just low priority. Could you post this to the bug tracker at SF?
 
I've tried BUG 3.6 and it's awesome!

Fortunately, I still managed to find a minor bug. In original BTS, if the iTradeYieldModifier in Civ4TraitInfos.xml is set to a value, it goes like this in the City screen:(see attachment)

In BUG 3.6, only the first yield type is displayed completely, all the rest yield types got omitted with '...' due to limited space in the table.

I've skimmed through CvMainInterface.py and couldn't find the cause, please help me fix it.:)
 

Attachments

  • sowhat.jpg
    sowhat.jpg
    34 KB · Views: 53
When the Trade Route view is selected or if Raw Yields is disabled, the normal table-drawing code is used. BUG shouldn't work any differently from the normal game. Did you have to modify the normal game to get it to display all the yields, or is that screenshot from an un-modded CvMainInterface.py?
 
I know it's hard to believe, but the screenshot is from an unmodded CvMainInterface.py. In BUG, even I turn RawYield off, the display is still omitted.
 
Can you be more specific? Maybe a screenshot? I thought you were saying the text gets truncated, but that seems strange since the TR display code is unchanged from the normal game AFAIK. Only when looking at non-TR do you get the new BUG code.
 
First off, thanks for a great mod! It's really changed my whole approach to the game, and made things much easier.

Secondly, I'm wondering if 3.6 has a memory leak? Windows tells me that my computer's virtual memory is insufficient whenever I launch Civ.... I understand that's the symptom of a memory leak (whatever a memory leak is....). Or could I adjust my settings in some way? I love the mod but the game slows to a crawl while running.
 
I'm wondering if 3.6 has a memory leak? Windows tells me that my computer's virtual memory is insufficient whenever I launch Civ.

Civ itself is known to have a memory leak. It is much better with the patches, but it is still there. How much physical RAM do you have? Can you take a screenshot of the error message?

Are you using BUG alone or with other mods, BAT, or BlueMarble? BUG itself should not increase your memory requirements in any significant way. Are you loading BUG as a mod or in the CustomAssets (single-player) mode? Are you running a lot of other applications in the background?

How long does it take to slow to a crawl? What part is slow? Selecting units, time for AIs to make their moves, combat animations?
 
I've never noticed a memory leak with Civ 4 before.

512 Mb ram. The error message is just a little a yellow triangle in my system tray that I find when I quit Civ. It says I need to add more virtual memory to my computer, and something about swap files.

I think I've just got Bug and Blue Marble.

I play Bug as single player in custom assets. I turn off everything I can before starting a game, including my avast anti-virus protection. The only things running are basic system requirements, as far as I know.

As for the slow down time, it gets slower as the game goes on gradually, so it's hard for me to say specifically when it gets bad. The more units, cities, AI decisions, etc., that have to be considered, the slower the game becomes. In this particular match, for example, on a standard map against a standard number of players, we're in the mid - 1800s and it takes significant time -- say, 1 to 2 minutes -- every time I finish my move. Then it lags going in and out of the city screen, and selecting units to move is a real exercise in patience. Takes maybe 3, 4 seconds, sometimes longer, between selecting a unit and seeing it highlighted. But combat animations, once they get started, seem to work fine.

Worth pointing out perhaps that I have a POS computer with a Celeron 2.66 Mhz processor and an old nVidia FX5200 graphics card. So the game has never run satisfactorily, and always suffered from slowdown -- but I can't remember every getting a message about virtual memory problems before, which is why I brought it up here.

Oh and yes, I have all the in-game graphics settings turned as low as they can go, pretty much.
 
I would be guessing you're running out of RAM. I've seen Civ4 using more than 1GB of RAM before (though on a fairly big map) and it's probably not uncommon for it to go over 512MB of RAM. If you're running windows xp, you can expect that to already be using a couple hundred MB of RAM as well. Generally I'd suggest having 1GB minimum on a windows xp machine and probably 2GB minimum on a vista machine. Back in the day when department stores were selling computers with xp and only 256 or 512MB of RAM I thought it was an outrage!

The actual slowdown is probably your computer starting to use the swap space (using your hard drive for memory rather than RAM, and hard drives are something like 100 times slower than RAM). If you're also running out of virtual memory (which is just space on your hard drive reserved for when you run out of RAM) then you probably have no hard drive space left either - not a great situation to be in.
 
A good test would be to rename your CustomAssets folder in My Games / BTS and open one of your saves. Does it seem noticeably faster without BUG and BlueMarble? Do you still get the warning after playing a session?

512MB RAM is pretty tight with XP wanting 256MB depending on your system. RAM is pretty cheap and easy to install, and it will improve your everyday use of the system.

Given that you have the graphics settings turned down, make sure you installed BM's low-res textures. No sense taking up RAM space with hi-res textures that just get down-sampled to low-res when drawing.
 
Okay, thanks then. It's probably a combination of limited RAM and a generally bad computer. I'm saving up to buy another anyway.
 
You can get around this somewhat by changing your pagefile to be locked at 2gb, instead of letting windows set it's size for you. I ran into this problem when I deleted my pagefile.sys to clean up my HDD and do a complete defrag. Try changing your virtural mem settings. If you don't have enough HDD space, you're SOL.
 
Was the Khmer Axe issue raised by KaytieKat on page 77 addressed? I can't find any response to it.
 
Page 77? I only have 39 pages (because I changed it to 40 posts per page) :lol:

My point is: Please refer to other posts by the post number instead of the post's page number. Makes searching unnecessarily annoying.
 
Back
Top Bottom