Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
bouchacha

GZDoom lags for bizarre reasons (e.g not picking up a chaingun)

Recommended Posts

I'm running GZDoom 3.4.1 with what I think are some very basic settings. I'm playing through Ancient Aliens and some levels just completely chug until I do something bizarre like pick up a chaingun, or pass through a certain node and suddenly everything is buttery smooth throughout the entire level. It's really fucking weird. Seriously, I have a save game right now which is consistently lagging no matter what I do until I pick up this gun. Every time. Why. The vid_fps flag shows it capped at a consistent 30fps but it definitely doesn't feel that way, which then suddenly jumps up to 60fps when it's "fixed".

 

I've reset my settings to the default several times now and I can pinpoint any specific obstacle, especially when the "fixes" are so damn random.

Share this post


Link to post

I know this is a weird issue, but can anyone point me to a direction where I can troubleshoot this myself? Recreating the bug seems so random.

Share this post


Link to post
Posted (edited)

Have you tried deleting the config and seeing if it happens with default settings? The file will be in the GZDoom root folder with the name gzdoom-<user>.ini You can also try using the latest GZDoom SVN.

Share this post


Link to post

Yep, I did exactly that. Literally the only change I've made from the default was turn on mouselook, change the control bindings, and change the resolution to 1920x1080. The same issue persists as far as I can tell. I'm willing to write this off as some odd bug within Ancient Aliens but this isn't the only wad it has happened; but it's also too inconsistent for me to reliably reproduce and test out.

Share this post


Link to post

Is there a log that would shed light on second by second changes in the engine?

Share this post


Link to post

There is a render readout that estimates the time it takes for each element of the render pipeline to process.  Bring down the console and type:

 

stat gpu

stat rendertimes

 

This will tell you how long (in milliseconds) each element is taking.  If you see one thing that's taking waaaay longer than anything else, that's a start.  Do you run with vsync on out of interest?  

Share this post


Link to post

I've tried both on and off for v-sync and it didn't seem to make a difference. Thanks for your console commands, they're hopefully useful! Here's what I did:

1. Delete my config file and change only the resolution (to 1920x1080) and the controls. Literally nothing else.

2. Start up ancient aliens and no other wads loaded

3. Warp to Map25 (I know the issue happens here, but it occurs elsewhere)

4. Game immediately starts in the 'lagging' stage and vid_fps shows "34ms (30 fps)":

cLBFoIb.png

5. Walk around for a minute or so until suddenly and inexplicably it stops lagging and vid_fps shows "17ms (60 fps)":

WckuxxY.png

 

There's clearly a difference between the two states, but I have no idea what's triggering it. For a while I suspected that it may have to do with render intensive portions of the map, but once the lagging state is gone, returning to previous areas doesn't bring it back. It's so goddamn weird!

Share this post


Link to post
Posted (edited)

Does it still happen if you disable the texture filters you currently have enabled?

Share this post


Link to post

Yep. The filters came with the default GZdoom configuration btw. I just tried it in a different map and the problem persists. I tried the first level of Sunlust and experienced the same issue (30 fps lag mode, then 60 fps inexplicably).

 

9xHSy2o.png

rpZDELb.png

Share this post


Link to post

Don't know if you are still interested, but I have seen some similar behavior with other ports on very large maps, like Europe.wad.

I made some changes with DoomLegacy to help avoid the problems.

As this is only similar (not identical), I will just mention some possibilities (without regards to the port or wad), and some things to try.

 

I would say to stop messing with your config settings.  That is not the kind of problem

 

If you look in a direction with complicated, complex, structures, the render engine can bog down.

One test is to change the rendering to something smaller, like 800x600, and test if that makes a difference.

This will tell you quickly if this is render related, or something else.

 

Depending on where you are standing, the BSP tree will be walked differently.

At some spots the BSP tree walk will eliminate parts of the map quickly and it will play fast.

Stand at some other spots, or look in a different direction, and the render sight checks have to cross problem sectors.

Look at the same sectors from a different position, and the render speed is OK.

 

When the player is at some map points. there may be a hundred monsters that might be able to see you, and the sight line checks

have to cross a large part of the map (thus making the BSP sight line check expensive).  Move a little bit and their

sight line checks become trivial, and much faster.  Check if the slow down only occurs when you cross

into certain map sectors, and then check with a map editor if that sector has anything special about it.

It can be something like the sight lines from a monster pool no longer pass through any void spaces.

 

Other things you can suspect:

- Blocking of input due to an obscure interaction with the map or your setup.

For some cases the responder functions act on button down events and sometimes on button up events.

I have had to fix one case where the button up event was being intercepted by another special case responder that had been activated by a button down event.

This will be triggered by something you did, that may seem to be entirely unrelated.

- Recursive loop that is activated by some obscure combination of events or state.   Might be able to test for this by skipping some the the things you do after restoring

your savegame.  See if variations in you play order or behavior have a difference.

- It might be texture related.  I suspect that GZDoom has fixed the render slowdown that occurs when a transparent texture is used.  But it is somewhat possible that you have discovered another variation of that problem.  Try to see if the problem is sensitive to where you are looking.  If a particular texture render is causing the problem, then the game would bog whenever you look at that linedef, no matter how far away it is.

- It might be an illegal linedef usage that triggers a recursive loop.  Something like crossed linedefs, or some other linedef trick that worked on some other port.

The game will slow down only when you look at it, or even look in its direction.

- Some wads are buggy.  They violate wad rules, and some ports may choke, while others with a very slight difference will detect or avoid the problem silently.

Try the wad with another port, such as one with extensive wad checks.

- buggy OpenGL implementation.   The slowdown will occur when it hits an OpenGL operation that is not implemented right.

Test the same savegame restore with different render selections.

- Test a different port render.  You may not be able to read your savegame with another port, but you can use cheats to get to a similar place.

Make a savegame with the test port, and restore it several times.  See if you can trigger the same slowdown.

If you can, then it is likely something like your OpenGL library, your video card software install, or some incompatibility with your OpenGL software,

such as it having the wrong video card hardware setup.   You may need a different video driver because one particular operation is stalling the render pipes.

If it can not properly detect the video card state, it may be hitting timeouts instead, which will make everything really slow.

It could also exceed some graphic memory limit in some situations, which may cause the video card driver to use external memory for textures, which causes a sudden slowdown in rendering.

 

 

 

 

Share this post


Link to post

When you go to pick up that chaingun ...

Check the wad with a map editor and see if you trigger any linedefs, such as a box around the chaingun.

If that triggers some sector to move, it may be removing a render trick that was hiding some monsters.  The render trick is the problem.

 

 

Share this post


Link to post

First, can you run your tests with vid_vsync set to 0? The "Finish" time contains all the waiting for this so unless you switch that off there is no way to tell what the real performance in those two screenshots is.

 

Aside from that, I suspect some power saving features at play here. Looking closer at your numbers, everything seems to run at 50% performance in the upper screenshots and if you say it only goes up after some playing it may well be that the system notices that it should quit power saving mode.

 

Share this post


Link to post

First step: Determine repeatability. Turn on uncapped framerate, and turn VSync off. Then, record a demo where the framerate is low, and continue to record until the framerate speeds up. Then, stop the game, and restart it, playing the demo. Playing a demo causes over 95% of the game's source code to be executed almost exactly as it was during recording. If the same issues occur, you have repeatability, and you have a tool that can be used to investigate further.

 

If the slowdowns/speedups don't occur at the same spot, I'd start looking for background programs running, and possible hardware issues. Background programs can eat up CPU cycles and thrash memory and cache, and hardware issues can cause all manners of slowdown. You could also reduce/increase video resolution, to determine if you are hitting certain limitations of the video card or the memory subsystems.

 

But, first and foremost is to see if the time issues happen at the same places in the game, and the best way to ensure that you're visiting the same place in the game is with a demo.

Share this post


Link to post
Posted (edited)

I appreciate all the good posts above but I think I'm throwing in the towel. The demo recording idea was especially clever but I ran into its own problem. I would start GZdoom with this parameter: "+map map25 -record aa25" and it would start me straight into ancient aliens map25, except it's running perfectly fine @ 60fps from the get-go. Less than five seconds later, I would use the command line command "-map map25" to essentially restart the level and suddenly it would be lagging heavily @30fps. So sometimes the level would lag, sometimes it wouldn't. I have no way to know how to reproduce this.

 

I have no coherent theory for why this happens. My settings don't seem to make a difference. The location within the level doesn't make a difference. Hell, even the exact same level doesn't seem to make a difference. I have all my video drivers updated, I have Nvidia control panel set to default, and my power options are set to High Performance. I can't discern any pattern to this slowdown.

Share this post


Link to post

In that case it may be some background process stealing time or the graphics hardware powering down, which can happen if it gets too hot.

What kind of computer do you have? Laptop or desktop? If it's a desktop you should open it and check for dust.

 

Share this post


Link to post

That suggestion about "too hot" should be investigated, even if you have "given up".

It is not that hard to overheat a processor.

High powered processors have thermal detection.  When they overheat the sensor notifies the OS, which puts the CPU into a slower state until it cools down.

The possible causes are simple and common:

- your CPU fan has failed

- your CPU heatsink is not properly fastened to the CPU, and/or has moved.

- your case vents are blocked with lint.  This happens on most computers even if they are not on the floor.  You need to vac the vents on the case periodically.

- a computer fan has failed, or come unplugged.

 

If the nVidia card is high powered and has a fan, then it too is likely to have thermal detection and thermal management.

Some video cards will respond by slowing down until they cool off.

- Use of high res graphics drives the video card harder.  A lower resolution screen should be easier on the video card, making everything run cooler.

You cannot just switch video resolutions and expect an immediate response.  Everything has to cool down first.

- It is also possible that a hot video card is adding to a hot CPU problem.

- Adding a high performance video card to a system in an ordinary case can lead to overheating, as the ordinary case does not have enough fans to keep that cool. 

My usual computer is quiet.  The gaming computer has so many large fans it roars like industrial equipment.

- The video card fan may have failed, or is blocked.

 

Share this post


Link to post
On 7/21/2018 at 1:50 PM, bouchacha said:

I appreciate all the good posts above but I think I'm throwing in the towel. The demo recording idea was especially clever but I ran into its own problem. I would start GZdoom with this parameter: "+map map25 -record aa25" and it would start me straight into ancient aliens map25, except it's running perfectly fine @ 60fps from the get-go. Less than five seconds later, I would use the command line command "-map map25" to essentially restart the level and suddenly it would be lagging heavily @30fps. So sometimes the level would lag, sometimes it wouldn't. I have no way to know how to reproduce this.

How many times did you try it? The heat thing might be spot on. But, if the demo *always* plays @ 60 fps, and then -map map25 always lags, you may be on to a problem with the source. Maybe try both 10 times, and make a log of what happens. If it were me, I'd try different combinations, stopping and restarting the game each time. For example:

demo

map

demo

map

demo

demo

map

map

demo, then -warp map25 without stopping program

Another test is to start a map, and let the player stand there without moving for a long time, and monitor the frame rate.

 

Eventually, one of three things should happen:

  1. You'll start to notice a pattern
  2. Your PC's components will begin to get hot, and the problem should escalate
  3. You'll find that there really is no pattern

But, none of this is possible, unless you try multiple times, the more the better. Each of these outcomes suggests what the problem might be. And, if it's an overheat-type situation, you need to find it before your equipment becomes damaged, if it hasn't already.

 

If you start to notice a pattern, the software may be at fault.

If it's an overheating problem, it should get worse as you progress with the tests.

If there's no noticeable pattern after many tests, you may have rogue programs running, or you could have an intermittent hardware issue, like a loose component or faulty memory.

 

On the hardware side, if you're comfortable with this, I'd suggest:

  • If you're overclocking, or have changed BIOS settings, put it back to factory defaults.
  • If the manufacturer has included a diagnostics partition, run the diagnostics, and set the tests to run for a few hours.
  • Run virus/malware scanners and possibly a rootkit revealer.
  • Unplug power, remove the PC cover and inspect the insides.
  • Vacuum out, or blow out the dust using proper electronics dusting spray, or an air compressor. And, if using a compressor, make sure the air it blows is dry.
  • Make sure all the fans are clean, and that they spin.
  • Make sure ventilation holes are free of obstruction, inside and outside of the case.
  • Carefully remove and reseat removable components, like plug-in cards and memory.
  • I would not suggest removing and reseating the CPU, unless you know what you're doing. You'll need some thermal paste if you remove the heatsink from the CPU, though you should not need to.
  • Make sure all cables are plugged in solidly, like HDD/DVD/CD cables, and power cables.
  • Make sure all unused power cables are dressed nicely, and that the conductors have no ability to touch anything inside.
  • If you can run the computer with the case off, and you are careful to ground yourself to avoid static electricity, you can gently lay your finger on motherboard and card chips to see if any of them are too hot. You can also visually inspect the boards to see if there is any discoloration from overheated components. Some chips, like the CPU, can be expected to run hot. But if something is expected to run hot, it would have a heatsink attached to it. Otherwise, you may have a problem.
  • If you have a similar computer, you could try swapping parts like memory, video cards, etc., and see if the problem follows the hardware.
  • Try to run other similar programs (GL games) and see if they have similar issues. Try older versions of GZDoom, try GLBoom, and try some non-Doom games and see if they have strange framerate issues.

Again, avoid everything listed above, except perhaps blowing out the dust, unless you are knowledgeable in such things, as you could damage your PC, get shocked, etc.

 

The basic idea here is to become familiar with the issue - when it occurs, when it does not occur, and what affects it. Intermittent issues are among the most difficult issues to diagnose, so, at this point you must gather facts. It's going to take some time, but you should be able to gain enough info to have a clue how to move forward. Good luck.

 

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×