Realm667 / WolfenDoom

"WolfenDoom - Blade of Agony" | Important: This is only meant for development and testing purposes. You are NOT ALLOWED to use material from this repository for your own projects. Important: This repository is for development and testing purposes, you are NOT ALLOWED to use the copyrighted material for your own projects without our permission!
http://boa.realm667.com
253 stars 27 forks source link

C3M5_A can become nearly unplayable #521

Closed Talon1024 closed 3 years ago

Talon1024 commented 3 years ago

So I was playtesting C3M5_A, and I experienced enormous framerate drops that I haven't experienced before. I was able to capture a screenshot from profilethinkers t, and it seems as if the framerate drops are being caused by EffectsManager; maybe that new culling code isn't so good after all.

Screenshot_Doom_20210427_005235

And another thing I discovered: it looks like each individual piece of debris is being culled by EffectsManager, rather than the debris pile as a whole, and I don't think that's a good idea, since it adds a lot more array elements for the EffectsManager to iterate over.

AFADoomer commented 3 years ago

Yes, a sample size of "just you, this one time" means we should revert it all. 🙄

Where in the map were you when this happened?

If we don't care about debris piles looking the same when they spawn back in, then, sure, we can just cull the whole pile and respawn the debris actors randomly. I only added them to the culling in the first place because there are an obscene number of debris actors in the city area of C3M6_A, and culling them helped.

Tormentor667 commented 3 years ago

I think it is really not necessary to make the piles look the same each time you revisit an array.

x3003 commented 3 years ago

It doesn't look good indeed, right from the start the framerate drops under 20 fps.

DoomJedi commented 3 years ago

I think it is really not necessary to make the piles look the same each time you revisit an array.

I agree, this is unneeded detail

Talon1024 commented 3 years ago

Where in the map were you when this happened?

The screenshot was taken from inside the FĂĽhrerbunker, after beating Goebbels, and before the fight with Blondi.

If we don't care about debris piles looking the same when they spawn back in, then, sure, we can just cull the whole pile and respawn the debris actors randomly. I only added them to the culling in the first place because there are an obscene number of debris actors in the city area of C3M6_A, and culling them helped.

We can also check whether the debris piece is part of a debris pile, and add it to EffectsManager if it isn't.

Username-N00b-is-not-available commented 3 years ago

I confirm that there is some severe lag on C3M5_A, in the starting area too. The think time often jump to 100ms and sometimes even to 400ms with 20k thinkers, and the frame drawing times around (-10400, -13840) do not decrease below around 250ms for me. There is also some stuttering even at the potato predefined setting (most noticeable at the beginning of the map, and also when moving).

DoomJedi commented 3 years ago

We don't need pile/debris consistency, this is important we fix it before release.

AFADoomer commented 3 years ago

I got most of the change for debris culling done this morning before work; will finish tonight.

Also looking at adding a CVar to control the max number of culled actors that can respawn per tic (essentially making cull range dynamic - lower if there are more culled actors in the immediate area); that will have to wait for 3.1, though - too much of a change right now.

AFADoomer commented 3 years ago

OK, so I am going to push a commit that reverts debris being culled. It works fine in normal practice, but with the number of debris spawners in C3M5_A, the culling ends up spawning in hundreds of actors every time the player moves 512 units, which is what causes the lag spikes.

For me this reversion drops me ~7 FPS overall when standing still in the main street area, but gets rid of the periodic stuttering.

Perhaps for 3.1 I will build some static/non-random, single-model debris piles that can be used to reduce overhead for situations like this.

Ozymandias81 commented 3 years ago

I am going to playtest this and C3M0_A today, running as ipk3 under GZD4.6r195, with up-to-date build of BoA obviously.

x3003 commented 3 years ago

With vulkan it was between 15-20 fps, but with the latest git it's between 35-50 fps now.

Ozymandias81 commented 3 years ago

Yes, on c3m5_A I have 17-40 fps now with all default values, instead if I set with my usual setup I even get 30-70, it is a fantastic improvement so far. Let's see C3M0_A now. Btw I am playing it under OpenGL.

Ozymandias81 commented 3 years ago

C3M0_A with everything at default runs like C3M5_A to me, beside the little stuttering at the very start when I look into the campfire behind the zombie (without alert him): after a little while, framerate gets better. Let's say I have around 15-30 with default, double them with my usual settings. There is though one thing that really turns down framerate and it is the lantern: whenever I move inside RE mansion or at the city plaza, it goes down drastically, it is also noticeable btw if you look right down into the excavation portal at the 2nd part end (the spotlight which illuminates the zone down). I have also noticed that creepycandles have still the switch issue that tablelights had, gonna fix them again (to test it, check inside shovel crypt).

Default settings, slowdown as I move with lantern: Screenshot_BoA_20210428_185043 Screenshot_BoA_20210428_185053

My settings: Screenshot_BoA_20210428_185206 Screenshot_BoA_20210428_185214

AFADoomer commented 3 years ago

@Ozymandias81 - Creepy candle issue fixed in 23882c26bc4b662a729a5b40ef96994dbcfe7378.

Ozymandias81 commented 3 years ago

Gonna test the lantern on C3M0_A

EDIT: Sadly the slowdown is still there, maybe I gained 2-3 fps. I think the problem is related to geometry involved on that zone and the size of those lights, but that can't be changed. Maybe it is something minor we can live with anyway.

Tormentor667 commented 3 years ago

Graf Zahl said: Yeah, light range of 512 will pretty much be deadly for a moving light source when the map gets more complex. The lights were not made for this.

It's not related to the lights then, as they are not moving.

Ozymandias81 commented 3 years ago

They are moving with the player, 3 lights that follows us and the slowdown happens only if I move

AFADoomer commented 3 years ago

Yeah, between the huge number of models in that area and the floor portal to the basement, I don't know if there's anything we can do.

It is only one light, too - the first two only display for a few tics as the lantern is first "lit".

Luckily, the player usually won't have a reason to use the lantern here, since you don't normally get the lantern until after turning the power back on.

Yes that's what I tought, specially because players need to save oil for the lantern. --Ozy81

Tormentor667 commented 3 years ago

The lantern light isn’t that large anyway, or not?

Remember we needed it large inside caverns? It changes randomly from 424 to 324 radius -- Ozy81

AFADoomer commented 3 years ago

It flickers from 424 to 324. Still large enough to have an impact.

x3003 commented 3 years ago

In c3m5_a, when you're in the trainstation, the game becomes jerky, although the framerate is still quite high 40-60 fps. So for 1 second it's smooth and the next it isn't and so on. Which is strange, because in the previous section the framerate might have been a bit lower, but it still was smooth.

Screenshot_Doom_20210429_232457

edit: I moved on the c3m5_b and it's smooth again.