Slowness with many actors and possible mitigations

Discuss anything ZDoom-related that doesn't fall into one of the other categories.

Re: Slowness with many actors and possible mitigations

Postby Kinsie » Thu Jan 17, 2019 2:49 am

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.
User avatar
Kinsie
A Concept Utterly Obsolete
 
Joined: 22 Oct 2004
Location: MAP33
Discord: Find Me...
Twitch ID: thekinsie

Re: Slowness with many actors and possible mitigations

Postby Nash » Thu Jan 17, 2019 2:54 am

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. :)
User avatar
Nash
 
 
 
Joined: 27 Oct 2003
Location: Kuala Lumpur, Malaysia
Github ID: nashmuhandes

Re: Slowness with many actors and possible mitigations

Postby Graf Zahl » Thu Jan 17, 2019 3:11 am

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:
User avatar
Graf Zahl
Lead GZDoom Developer
Lead GZDoom Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: Slowness with many actors and possible mitigations

Postby Apeirogon » Thu Jan 17, 2019 6:55 am

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.
Apeirogon
I have a strange sense of humour
 
Joined: 12 Jun 2017

Re: Slowness with many actors and possible mitigations

Postby Marisa Kirisame » Thu Jan 17, 2019 11:38 am

What.
User avatar
Marisa Kirisame
ZScript Magician
 
 
 
Joined: 08 Feb 2008
Location: Vigo, Galicia
Discord: Marisa Kirisame#1666
Twitch ID: magusmarisa
Github ID: OrdinaryMagician
Operating System: Other Linux 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: nVidia with Vulkan support

Re: Slowness with many actors and possible mitigations

Postby gramps » Thu Jan 17, 2019 4:49 pm

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?
gramps
 
Joined: 18 Oct 2018

Re: Slowness with many actors and possible mitigations

Postby Marisa Kirisame » Thu Jan 17, 2019 5:23 pm

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.
User avatar
Marisa Kirisame
ZScript Magician
 
 
 
Joined: 08 Feb 2008
Location: Vigo, Galicia
Discord: Marisa Kirisame#1666
Twitch ID: magusmarisa
Github ID: OrdinaryMagician
Operating System: Other Linux 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: nVidia with Vulkan support

Re: Slowness with many actors and possible mitigations

Postby SuaveSteve » Mon Feb 18, 2019 10:14 am

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
SuaveSteve
 
Joined: 05 Jul 2014

Re: Slowness with many actors and possible mitigations

Postby gramps » Mon Feb 18, 2019 10:23 pm

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.
gramps
 
Joined: 18 Oct 2018

Re: Slowness with many actors and possible mitigations

Postby Graf Zahl » Tue Feb 19, 2019 9:48 am

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.
User avatar
Graf Zahl
Lead GZDoom Developer
Lead GZDoom Developer
 
Joined: 19 Jul 2003
Location: Germany

Previous

Return to General

Who is online

Users browsing this forum: Yandex [Bot] and 3 guests