• Welcome to Battlezone Universe.
 

News:

Welcome to the BZU Archive dated December 24, 2009. Topics and posts are in read-only mode. Those with accounts will be able to login and browse anything the account had access granted to at the time. No changes to permissions will be made to be given access to particular content. If you have any questions, please reach out to squirrelof09/Rapazzini.

Main Menu

Performance hits: Mem leak bug with specific hardware?

Started by Belix, July 16, 2008, 11:23:22 PM

Previous topic - Next topic

Belix

Hello! First off, I just wanted to greet everyone here and express my appreciation for this patch, team and project. A lot of fun games get abandoned simply because they're "old" and this kind of community effort is invaluable. I've been playing BZII with the 1.3 patches for awhile now, since the last version (pb3) and really like it. But with Battlezone II I've always had some severe performance hits, almost so much as to cripple the game and make it unplayable, and I've tried playing with every graphics setting in-game and in the configuration files I could think of, with no luck. I finally gave it up and crossed my fingers that the next patch from here would improve performance.

With this patch's release, I did a completely fresh install of BZII and slapped it on. I was at first saddened that I did not see any improvement, but I decided, rather than sulking and leaving the game until the next patch, that I was going to do my best to determine what seemed to be causing these performance hits I was experiencing. I assumed I wouldn't get anywhere, but if I could help contribute to this project it was worth the time and experimentation. It paid off. I realize these issues my be specific to my system, however after reading other posts around here noting performance drops around bases, I believe it is not some unique issue. I'll post my system specs after this; but know in advance this is a fairly high-end system. I'll also include current graphics settings for BZ2.

After playing a bit, different maps, switching races, building a base, units, flying around and scratching my head at the wildly varying performance, I finally started noticing a pattern. Barring combat (which I did not test but I'm sure throws some kind of framerate hit, obviously) I've found specific things that ALWAYS hit my framerate, even though at all other times it's a flat full 60fps and smooth as silk (even with about 6 units and 6 buildings on the screen). I think there is some major issue or bug here but I lack the technical expertise to analyze it; so I'll leave that to you guys. Here's what I found after some thorough testing:





List of "problem objects" that cause a performance hit and details UPDATED: July 19th

Previously it seemed that my game suffered a large (set) FPS hit with specific objects on the screen, but I after playing around with it more, it actually seems the FPS hit for these objects... bear with me, this is kind of difficult to explain. Essentially the FPS hit my game suffers isn't within a set amount - i.e., a Recycler doesn't hit 40, a Power Lung 25, whatever. I thought it was a specific amount for specific things, however, playing around with it more, I've found that the number is *wildly* variable, but there is a pattern. The longer any of these "problem" objects have existed in the game, the higher the framerate hit. I can deploy an ISDF Recycler, park my Scout looking at it, and watch my framerate literally bleed itself to death, dropping from 60 to a mere 8 FPS after about 6 minutes. It's like there is some kind of memory leak. For the most part this effect does NOT stack (thank goodness!) - for example, both Power Plants and Recyclers cause this, but if I have both of them on the screen simultaneously, the FPS crush doesn't increase. Of note however is that the drop-off markers DO stack with this. Like the buildings, over time the drop off markers seem to hurt FPS more, but if I have both a problem building and a drop-off marker on screen at the same time, then my FPS takes an even heavier hit. Multiple drop-off markers seem to function similarly though; I can put two or three in one place and the FPS hit is the same.

I sincerely believe that these objects are BUGGED. Something about how the game handles or renders them is causing a consistent, accumulative performance degredation. If I look away from the objects framerate instantly leaps back up to 60fps, but the moment I turn back to face them, even if I fly far away first, fps tanks back down to the level it was at when I was looking (or lower, if it's been awhile). Of peculiar interest is that, regarding the ISDF Recycler and Power Plants, this issue ONLY occurs on High Object Detail, or on lower settings when you get close enough to the structures to see the high detail models - if they are not displayed in high detail, framerate again leaps to 60fps. I have had this problem for some time over different NVIDIA forceware versions and it's persisted from pb3 into pb4. I can reproduce this issue on another computer here with similar hardware and drivers and am working on trying to get ahold of a system to attempt to reproduce it on with different hardware and drivers. No I don't have processes running, nothing bogging down my system, I've reproduced this dozens of times now both with an AI player on the map and completely alone so nothing should be causing a performance degredation while I sit there and do nothing, and I've tried playing around with all kinds of graphics options inside the game and outside of it and with the videocard itself as per suggestions so far and nothing has resolved the issue.

I would assume if this issue was widespread it would have been detailed by now, but I honestly can't believe that this is some kind of one-in-a-million problem. I recall reading somewhere else on here that a fellow found he had a bunch of units and buildings on screen at one point and FPS was fine, then in another his framerate took a hit simply with a Scion Matriarch and two turrets (or scavengers) on the screen - I bet it was the drop-off marker causing the hit, and he'd been in the game awhile. I suspect other posts I've seen describing performance issues in and around the bases are due to this as well.


Here's the list of offenders that crush my performance gradually when on-screen:

ISDF Recycler - Only when fully deployed, and only in High Object Detail.
ISDF Power Plant - Only in High Object Detail.
"Drop off" marker - At all times regardless of any graphics options I've tried so far.
Scion Lung - At all times regardless of any graphics options I've tried so far.

There may be more I haven't found yet.


System Specs:
Windows XP Professional SP2 with DirectX 9.0c
2 hyper-threaded 2.00GHz Intel processors (effectively 4 CPUs)
2GB of physical RAM, 2GB+ of virtual memory available
512MB videocard (NVIDIA GeForce 7900 GTX; current forceware version 169.21)


Current Battlezone II Graphics settings:
Note that I can set resolution to 1024x768 16 and switch everything on HIGH and ON and *still* get a flat smooth 60 FPS with none of the things above on the screen. The only exception is the SKY setting. With it off I get the perfect 60, but with it on High it dips down as low as 40 sometimes but still stays close to 55. Right now all GamePrefs.ini files are default. I'm not running any mods for BZ2.

Note: VSYNC is on, and I'm running the game fullscreen.

In-game:
Resolution: 800x600 16
Sky: None
Light Sources: None
Terrain: High
Local Fog: Off
Weather: On
Reflections: On
Texture Size: Large
Props: Low
Shadow Detail: Low
PIII Optimization: On
Mipmaps: Auto
Anisotropic Filtering: 2
EMBM Bumpmapping: Off
Particle Detail: Low
Object Detail: High

===================================

This is a real killer and if there's a fix I can't find it anywhere obvious, which should be corrected, and if not, I'm hoping this information will help the team identify the problem(s) and fix them in the next patch. Thanks again for all your hard work BZU team! Questions welcome from anyone; I tried to provide all the information I anticipated anyone asking for, but I'm sure I may have missed something.

Red Devil

First of all, Welcome.   Glad to have you here.  :-)

It sounds like you have vsync turned on in your video adapter and in the game.

BZ2 uses the CPU to render instead of the GPU, so any time there's dense graphics on the screen, it shows.  Try turning on PIII optimization.

I have an Athlon 64 3500+ and use 1680x1050 resolution on high settings with vsync on and get 60 fps.

Have any processes running in the background?



What box???

bigbadbogie

I agree - a virus scanner or something like that is a likely culprit.
Others would merely say it was good humour.


My BZ2 mods:

QF2: Essence to a Thief - Development is underway.

Fleshstorm 2: The Harvest - Released on the 6th of November 2009. Got to www.bz2md.com for details.

QF Mod - My first mod, finished over a year ago. It can be found on BZ2MD.com

GreenHeart

#3
Quote from: Belix on July 16, 2008, 11:23:22 PM
Also, the changes I made to the GamePrefs.ini are listed below, and didn't seem to have any impact on the issue

Editing the GamePrefs.ini file can cause bad assets so I'd suggest copying the settings from GamePrefs.ini to either LocalPrefs.ini, LocalPrefs_bzone.ini, or LocalPrefs_bz2edit.ini to avoid bad assets while playing online.

those files can be found in your 'battlezone II\addon\config\*.ini' folder

also the lights setting maybe another reason why you got fps hit, try turning that off if your having problems with your FPS.  Light Sources: One  -> None
Signature:
Many failures will take place in the process of attempting to achive your goal. It don't matter how many times you fail, Its how much you've learned each time since its apart of the learning process.

Belix

Quote from: Red Devil on July 16, 2008, 11:35:37 PM
It sounds like you have vsync turned on in your video adapter and in the game.

BZ2 uses the CPU to render instead of the GPU, so any time there's dense graphics on the screen, it shows.  Try turning on PIII optimization.

Have any processes running in the background?
Quote from: bigbadbogie on July 16, 2008, 11:41:00 PM
I agree - a virus scanner or something like that is a likely culprit.

I don't see an option for VSYNC anywhere in the game (I see it in the ini file but it's set to off, and I don't recall changing it so I think that's default). And for BZ2's purposes, is performance better with VSYNC on or off (both in-game and for the videocard)? I'll gladly change/check them to whatever is suggested.

PIII Optimization seems to make no improvement regarding the FPS drop with these things on screen. I did notice playing around with this that the special effect on ISDF power plants seems to cause a hit too (about 22-33 FPS loss).

I have a couple things running in the background but nothing consuming. An idle messenger, notepad, and a virus scanner (and no it's not running any scans - resident shields don't hurt right? I can disable it to be sure). I understand Battlezone II is an oddball as far as CPU/videocard usage, but these specific FPS hits seem like they're caused by some kind of bug related to the things listed above (and possibly others I haven't found). Glitched models? Bugged special effects code? Whatever the actual cause is, it is beyond me, but this certainly seems more than just a general issue. Why would very specific objects in the game cause performance hits onscreen when many others that, for all purposes, appear just as complex or decorated, and in much greater numbers, do not?


Quote from: GreenHeart on July 16, 2008, 11:43:17 PM
Editing the GamePrefs.ini file can cause bad assets so I'd suggest copying the settings from GamePrefs.ini to either LocalPrefs.ini, LocalPrefs_bzone.ini, or LocalPrefs_bz2edit.ini to avoid bad assets while playing online.

those files can be found in your 'battlezone II\addon\config\*.ini' folder

also the lights setting maybe another reason why you got fps hit, try turning that off if your having problems with your FPS.  Light Sources: One  -> None

I guess I should have noticed the "Do not edit this file" line at the top. Wasn't there before, just opened it up and twirled down looking for new options to try tweaking. Since the changes made there didn't seem to improve performance any, I've set all the variables back to their original values for now.

I tested again with Light Sources set to none. No difference noticed in FPS hits with the things mentioned above on screen.



Thanks for the suggestions so far but no dice yet. From what I can tell if I could just make ISDF Recyclers and power plants stay in the mid-detail state, and make Lungs and drop-off markers invisible, this game would absolutely fly barring the ISDF construction effect. The Scion construction effect doesn't even make a dent in my FPS. EDIT: And I wanted to add, that's with Reflection ON, which I read somewhere makes the effect even more demanding.

EDIT #2: Is there a way to disable transparency effects? It just occured to me that that's one thing Lungs and ISDF Power Plants have in common. Not to mention the drop-off markers and the ISDF construction effect. Doesn't explain the ISDF Recycler though...

bigbadbogie

Others would merely say it was good humour.


My BZ2 mods:

QF2: Essence to a Thief - Development is underway.

Fleshstorm 2: The Harvest - Released on the 6th of November 2009. Got to www.bz2md.com for details.

QF Mod - My first mod, finished over a year ago. It can be found on BZ2MD.com

Belix

Quote from: bigbadbogie on July 17, 2008, 12:57:24 AM
Does the ISDF relay bunker hurt your FPS??
I think I see why you asked... I just realized there seems several transparent textures here on the Relay Bunker too, so there goes that idea... unless it's something to do with animated and/or partial transparency. I just circled the Relay Bunker in satellite mode and in a scout with none of the aforementioned troublemakers onscreen, and there wasn't even a tickle off of the 60fps. Relay Bunker seems perfectly fine.

Red Devil

Might want to check the video aperture size in your CMOS too.
What box???

Commando


Belix

Okay everyone... I haven't bailed out yet. I've been playing with this more and I think I've got better details now. I updated the area of my first post containing the list of "problem objects" on the screen and relevant details with more detail and hopefully described the issue I am having better - please peruse it. I've reproduced it on another machine (with similar hardware) and in spite of all the suggestions here so far that I've attempted, nothing has resolved it. I sincerely believe there is some kind of bug here that I can't think of any name for other than a "memory leak", though that might not be what it is - something similar maybe - I really, REALLY would love it if someone would diligently attempt to reproduce this and I will report it as a bug. I am trying to get my hands on a system with different hardware to test it out on too just to be sure, but it could take awhile, so if any of you could help me I would be grateful.




Quote from: Red Devil on July 18, 2008, 05:34:05 PM
Might want to check the video aperture size in your CMOS too.
Sorry, I'm a bit unfamiliar with fetching information from the BIOS... what exact bit of information am I looking to retrieve and where would I likely find it in there? Or is it one of those wonderful non-standardized bits that's different from one BIOS to another? (Doh)

Quote from: Commando on July 18, 2008, 06:18:01 PM
Try adding /nodxt to your bz2 shortcut.
I did this. Unless having this in the target field isn't typed correctly -

"C:\Program Files\Battlezone II\bzone.exe" /nodxt

- I tried it and I didn't notice any change or benefit.




Thanks again for your time and patience! I'll continue trying out suggestions made here, if I get the game flowing wonderfully at a 60fps I'll be happy but I'll still think there is some underlying cause for this that needs to be addressed.

Red Devil

With Vsync on, it will always dip.  I have it on and it does the same thing. Reason being is that the percentage hit is more noticeable since it's limited to your monitor's refresh rate.

Poke around in your video adapter for an option to turn off vsync and set it to false in your localPrefs.

For the aperture thing, hold Del down when booting and go into the peripherals area (i think) and poke around until you see the place where you adjust aperture.
What box???

bigbadbogie

You can turn off Vsync with MM5. Just go to Bz2 Configuration, 1.3 Configuration, and you should see it. Remember to click 'apply'.
Others would merely say it was good humour.


My BZ2 mods:

QF2: Essence to a Thief - Development is underway.

Fleshstorm 2: The Harvest - Released on the 6th of November 2009. Got to www.bz2md.com for details.

QF Mod - My first mod, finished over a year ago. It can be found on BZ2MD.com

Commando

What video card do you have?  If you have an Nvidia card, turn Sky detail to None.  With my comp, my performance is crappy when it is set to either low or high and will eventually cause the game to pretty much die.

Belix

Quote from: bigbadbogie on July 19, 2008, 04:01:06 PM
You can turn off Vsync with MM5. Just go to Bz2 Configuration, 1.3 Configuration, and you should see it. Remember to click 'apply'.
Quote from: Red Devil on July 19, 2008, 02:41:58 PM
With Vsync on, it will always dip.  I have it on and it does the same thing. Reason being is that the percentage hit is more noticeable since it's limited to your monitor's refresh rate.

Poke around in your video adapter for an option to turn off vsync and set it to false in your localPrefs.

For the aperture thing, hold Del down when booting and go into the peripherals area (i think) and poke around until you see the place where you adjust aperture.

I made sure VSYNC was off in the videocard and localprefs etc. and saw the framerate gliding at 120-124fps. Still the objects listed above in the main post eventually cripple my framerate. The longer the game runs, the worse it gets. Unfortunately it seems to get bad FAST. Within the first five minutes my Recycler is deployed I lose about 50% of the framerate. It continues deteriorating, though the rate of decay lessens as the framerate drops. It doesn't take long to go from 120 to 40, but from 40 to 8 takes much longer.

Red Devil, I could not find any settings anywhere for the videocard in my BIOS. I didn't see anything with the word "aperture" in it for sure. I couldn't find any mention of it in the NVIDIA control panels either.

Quote from: Commando on July 19, 2008, 04:15:45 PM
What video card do you have?  If you have an Nvidia card, turn Sky detail to None.  With my comp, my performance is crappy when it is set to either low or high and will eventually cause the game to pretty much die.
Yep I read a post about this elsewhere here (from you I think), and I have had Sky detail set to None for some time. I posted this information (including all current BZ2 option settings) and my system specs in the main post above. It's a 512MB videocard (NVIDIA GeForce 7900 GTX; current forceware version 169.21). I also read before signing up here about the /nodxt thing and had tried that previously as well. I did try it again now as mentioned before and it seemed to make no difference. Basically for me what you describe as the game performance eventually "dying" is exactly what happens to me with these objects on the screen. It's not an immediate slaughter of performance, but a slow death over a short period of time. Maybe there's a relation?




I just got out of a game that I'd been running for about 35 minutes (with no AI players). I got down to 5.88fps with nothing but a Factory, Recycler and one Power Plant onscreen along with both their drop-off markers. Yet, I took the time to build 20 Missile Scouts, 10 Sabres, and a Constructor, put them all in one area and build a scrap pool and 4 Relay bunkers... with *all* of that onscreen at one time my FPS didn't drop below 71. Heck I even sabotaged it further by turning Headlights -> All. Imagine 30 vehicles and 4 buildings with light effects all clustered in one spot. Brought the framerate down to 18fps. There is absolutely no way three buildings can be more demanding than that. Something ain't right. I face an empty direction and it skips back up to 120+... is there a proper channel I need to use to report this as a bug? I've done my absolute best to ensure this isn't a performance issue, I'm headed there next if I can't get it resolved or if I can get this issue reproduced on a different computer that doesn't have the same hardware in it.

Commando

I glanced through your settings and I didn't see sky detail which is why I brought it up.  I saw light sources set to None, but that isn't the setting that causes issues.