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

Reducing lag for Gzdoom

Recommended Posts

Any tips on doing this?
It's especially bad when i'm playing slaughter maps or using wads like DoomRPG/DoomRLA/Russian Overkill (Not in combination, just in general) and since slaughter maps are my favorite, it's quite upsetting.
Is there a way to reduce lag significantly?

Share this post


Link to post

If your lag is specifically with slaughter maps, only a faster computer will be able to help you.

ZDoom's play engine has some issues with extremely high monster count.

Share this post


Link to post

Yeah that's what I was afraid of, I was hoping there we're settings that could be tweaked specifically for that, or maybe a wad that removes monster bodies or something.

Share this post


Link to post
Clusterone666 said:

maybe a wad that removes monster bodies or something.

That can be done relatively easily. I'll use the imp for an example of how you'd go about creating it in DECORATE. There's two possible approaches you can take:

1. Remove after a period of time.

Actor DoomImpBeGone : DoomImp replaces DoomImp
{
  States
  {
  Death:
    TROO I 8
    TROO J 8 A_Scream
    TROO K 6
    TROO L 6 A_NoBlocking
    TROO M 4200 CanRaise
    Stop
  XDeath:
    TROO N 5
    TROO O 5 A_XScream
    TROO P 5
    TROO Q 5 A_NoBlocking
    TROO RST 5
    TROO U 4200 CanRaise
    Stop
  }
}
These imp corpses will disappear after 4200 tics (about two minutes). Adjust value as appropriate, there's 35 tics in a second and 2100 tics in a minute (well, approximatively at least). The CanRaise thing is to allow arch-viles to resurrect them because otherwise arch-viles only consider a monster corpse is "stable" enough to be resurrected if its duration is -1 (infinite). CanRaise is a relatively recent addition and you'll need a GZDoom build based on a development version of ZDoom. I think any GZDoom 2.x should work though.
Spoiler

PROTIP: if you want to adjust the time value, you can try defining a constant, so that you only need to change one line of code to update all the modified monsters. It'd work kinda like this:

const int CORPSETIME 4200

Actor DoomImpBeGone : DoomImp replaces DoomImp
{
  States
  {
  Death:
    TROO I 8
    TROO J 8 A_Scream
    TROO K 6
    TROO L 6 A_NoBlocking
    TROO M CORPSETIME CanRaise
    Stop
  XDeath:
    TROO N 5
    TROO O 5 A_XScream
    TROO P 5
    TROO Q 5 A_NoBlocking
    TROO RST 5
    TROO U CORPSETIME CanRaise
    Stop
  }
}
The "const int" line must be present only once, at the top of your DECORATE file, before the monster definitions.

2. Remove after an amount of corpses
Actor DoomImpBeGone : DoomImp replaces DoomImp
{
  States
  {
  Death:
    TROO I 8
    TROO J 8 A_Scream
    TROO K 6
    TROO L 6 A_NoBlocking
    TROO M -1 A_QueueCorpse
    Stop
  XDeath:
    TROO N 5
    TROO O 5 A_XScream
    TROO P 5
    TROO Q 5 A_NoBlocking
    TROO RST 5
    TROO U -1 A_QueueCorpse
    Stop
  Raise:
    TROO M 8 A_DeQueueCorpse
    TROO LKJI 8
    Goto See
  }
}
With this approach, corpses are moved after a certain number (chosen by a console variable) of monsters is reached, so you can set it to remove the oldest corpses after a thousand or however many you feel comfortable with. (The default value of 64, taken from Hexen, will certainly be too low for slaughterwads, especially those that make use of arch-viles!) And of course here we need to dequeue corpses that are being raised, otherwise resurrected monsters could suddenly disappear when their fellows are killed (to say nothing about what could happen if a queued monster is resurrected and then killed again, ending up queued a second time).

You can even end up combining both approaches:
Actor DoomImpBeGone : DoomImp replaces DoomImp
{
  States
  {
  Death:
    TROO I 8
    TROO J 8 A_Scream
    TROO K 6
    TROO L 6 A_NoBlocking
    TROO M 4200 CanRaise A_QueueCorpse
    TROO M 0 A_DeQueueCorpse
    Stop
  XDeath:
    TROO N 5
    TROO O 5 A_XScream
    TROO P 5
    TROO Q 5 A_NoBlocking
    TROO RST 5
    TROO U 4200 CanRaise A_QueueCorpse
    TROO U 0 A_DeQueueCorpse
    Stop
  Raise:
    TROO M 8 A_DeQueueCorpse
    TROO LKJI 8
    Goto See
  }
}
Here I'm dequeueing corpses just before they get removed when their time runs out. There's no need to let the queue be filled by monsters that have been removed from the game; besides if there's no foolproofing in this part of the code it could lead to nasty bugs.

Anyway, the same thing would have to be done for all monsters, it might not work nicely with dehacked monsters.

Share this post


Link to post

All nice and well, but since corpses do not move they don't create much performance overhead in the playsim.

It'd be throwing a lot of effort at a non-issue.

Share this post


Link to post

I experience random lags in GZDoom, mainly in elaborate wads such as Winter's Fury or The Refinery. It all runs smooth and fine, but at a random time framerate starts slowing down, more and more (over a couple minutes), up to the point of making the game unplayable - and then it stops, and I can play normally again. It periodically repeats every few minutes, and I say it again, it happens at random occasions, unrelated to the scene I currently see in the game.

Is there a known solution to this problem?

Share this post


Link to post

Just for random reference. I did a nuts.wad test just now and got these results during combat.

Average fps 90 for Zdoom
Average fps 45 for GZdoom
Average fps 180 for PrBoom-Plus

Note this is on my i5-4670k with a GTX 780 though. :P

Share this post


Link to post

So gzdoom is the main culprit.
Damn, the mods I run are only GZDOOM compatible.
Time for a upgrade!
And thanks for all the suggestions and the DECORATE help!

Share this post


Link to post
BlackFish said:

Just for random reference. I did a nuts.wad test just now and got these results during combat.

Average fps 90 for Zdoom
Average fps 45 for GZdoom
Average fps 180 for PrBoom-Plus

Note this is on my i5-4670k with a GTX 780 though. :P


How are you getting those FPS?!

I've got an 4770k i7 and a GTX780. I went with the faster CPU after a discussion over at the ZDoom forums where it was pointed out that the CPU was pretty important for Doom engines. I don't get anywhere near those frame rates... single digits once the baddies start moving... :(

Share this post


Link to post
BlackFish said:

Average fps 90 for Zdoom
Average fps 45 for GZdoom
Average fps 180 for PrBoom-Plus



Since the playsim is 100% identical between ZDoom and GZDoom, something must be off. What resolution are you using? GZDoom should be a lot faster with anything above 1024x768. Or are you, by any chance, loading dynamic lights?

Share this post


Link to post
scifista42 said:

I experience random lags in GZDoom, mainly in elaborate wads such as Winter's Fury or The Refinery. It all runs smooth and fine, but at a random time framerate starts slowing down, more and more (over a couple minutes), up to the point of making the game unplayable - and then it stops, and I can play normally again. It periodically repeats every few minutes, and I say it again, it happens at random occasions, unrelated to the scene I currently see in the game.

Is there a known solution to this problem?



Sounds like the graphics card is powering down due to overheating or some background process is stealing time.

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
×