Page 2 of 2

Re: Slowness with many actors and possible mitigations

Posted: Thu Jan 17, 2019 1:49 am
by Kinsie
GZDoom is powerful and amazing and my friend, but it's still Doom under the surface and for some things you need to work with that in mind, otherwise you're basically going to spend all of your time trying to smash square-shaped pegs into round-shaped holes and getting frustrated.

Re: Slowness with many actors and possible mitigations

Posted: Thu Jan 17, 2019 1:54 am
by Nash
Apeirogon wrote: Or Im wrong and gdoom dont move to/cross "free game engine" line?
Yes, you're wrong. GZDoom is meant to, and will always be a Doom engine. At some point, a line is drawn.

You want something more, you should consider Unity or Unreal Engine 4. :)

Re: Slowness with many actors and possible mitigations

Posted: Thu Jan 17, 2019 2:11 am
by Graf Zahl
Kinsie wrote:otherwise you're basically going to spend all of your time trying to smash square-shaped pegs into round-shaped holes and getting frustrated.
... and you can take that quite literally, considering how the engine performs collision detection of actors... :mrgreen:

Re: Slowness with many actors and possible mitigations

Posted: Thu Jan 17, 2019 5:55 am
by Apeirogon
Nash wrote:
Apeirogon wrote: Or Im wrong and gdoom dont move to/cross "free game engine" line?
Yes, you're wrong. GZDoom is meant to, and will always be a Doom engine. At some point, a line is drawn.

You want something more, you should consider Unity or Unreal Engine 4. :)
Kinsie wrote:GZDoom is powerful and amazing and my friend, but it's still Doom under the surface and for some things you need to work with that in mind, otherwise you're basically going to spend all of your time trying to smash square-shaped pegs into round-shaped holes and getting frustrated.
If you thought that Unreal/Unity dont have some silly restrictions, your wrong. I dont touch it at all, but from my experience from working with other "home made" game engine, (serious sam/dawn of war/half life/disciples/HoMM/etc. engine) Im sure that it have some. But thanks to programmers from Epic/Unity it it contains very few of such restrictions. Most famous "free" game engine after all.
But that question to Marisa, since it only significant person here which know thing or two about it.

What I meant, the only differences of gzdoom from nowadays game engine that it runs only on one core and that the renderer try to render ALL that player POSSIBLE can see, instead if draw all that player ACTUALLY can see. From all other point of view, it generic nowadays game engine, since it have materials, shaders, Vulkan API (in near future), models, can runs in windows 10, etc. Or even more, since it have JIT compiler.
So now gzdoom in position "too far to reach, too low to get up" from the point of game engine, in my opinion.

Re: Slowness with many actors and possible mitigations

Posted: Thu Jan 17, 2019 10:38 am
by Marisa the Magician
What.

Re: Slowness with many actors and possible mitigations

Posted: Thu Jan 17, 2019 3:49 pm
by gramps
Still would like to hear what happened to FPS with lots of things vs. lots of not-rendered things vs. not lots of things.

OP: did you get a chance to test this out?

Re: Slowness with many actors and possible mitigations

Posted: Thu Jan 17, 2019 4:23 pm
by Marisa the Magician
Excuse me but in here there are people who know more than me about those engines. I'm only specialized in Unreal Engine 1 and 1.5. You give me too much credit.

And I can tell you that UE1 also has trouble with slowness (or even crashing) caused by too many actors (in fact, slowness tends to happen with actor counts in the hundreds, not thousands). The engine is single threaded, runs at a much higher tick rate (a variable one, even) and it has even more stuff to deal with for just one actor than GZDoom.

Re: Slowness with many actors and possible mitigations

Posted: Mon Feb 18, 2019 9:14 am
by SuaveSteve
gramps wrote:Still would like to hear what happened to FPS with lots of things vs. lots of not-rendered things vs. not lots of things.

OP: did you get a chance to test this out?
I'm very certain with actors that don't do much thinking, it's a rendering thing. I did a test with setting bInvisible in batches:

I made an actor I call VisLinker* that makes a list of other actors within some radius (filtered by another list I provide) and hides/unhides them depending on distance to nearest player.

Look at this video:

https://my.mixtape.moe/hvjsak.m4v

You should notice two things: FPS going up as I move back, and the groups disappearing in the distance.

I only place the VisLinkers on one side of the map so the difference in FPS could be noticed.

But those are all in view, you may say, well... I've already started using these on a real map where you can't see all these cosmetic actors at once and I've already noticed an improvement on ~20FPS in some areas.

So actors that can not be seen by the player and are within the view frustum are still taking rendering time. Which means GZDoom has no occlusion culling or its implementation isn't that good.

I suppose another way to do this would be to segment your map by hand and turn the actors invisible/visible as the player passes segments, but then that sounds awful similar to what other engines like Doom 3 already do with visportals.

*Latest, slightly different to what is in vid, code if anyone is interested: https://pastebin.com/5pgFLHZ1

Re: Slowness with many actors and possible mitigations

Posted: Mon Feb 18, 2019 9:23 pm
by gramps
Ah, so the think time was a red herring, and it's rendering causing the slowness as you suspected.

Thanks for following up on this, this is useful stuff to know.

Re: Slowness with many actors and possible mitigations

Posted: Tue Feb 19, 2019 8:48 am
by Graf Zahl
SuaveSteve wrote: So actors that can not be seen by the player and are within the view frustum are still taking rendering time. Which means GZDoom has no occlusion culling or its implementation isn't that good.
The big time waster here isn't processing an actor for rendering but hitting a cache miss for most of them. Even for the most trivial of checks the actor's data needs to be read which most likely involves one cache miss. After that all the rest becomes mostly irrelevant. As long as an actor is linked to a sector that gets rendered it needs to be looked at at least once.