Jump to content
  • 0

Ultimate Doom Builder - Performance Question (GZDoom+UDMF)


Wo0p

Question

Hello everyone :)

 

I think I understand that linedefs (and very much dynamic lights) take a toll on performance when creating and playing WADs. But if I put a say 64x64 room in one corner of the total work area (The "map" of UDB) and put the rest of my level in the farthest other corner. Does the engine have to calculate that astronomical distance somehow that will impact performance? Or does the engine only calculate what is visible at any given time? 

I guess I'm asking if the engine "culls" parts of its total map until they're necessary. Asking from the standpoint of GZDoom & UDMF.

 

Thanks for reading!

 

I'm not a professional gamedev/coder so pardon the lack of proper technical language.

Edited by Wo0p

Share this post


Link to post

6 answers to this question

Recommended Posts

  • 1

It is not so much performance as accuracy of the renderer. Maps may become squirly when placing sectors at opposite ends of the editor field.

 

VykJT61.png

 

For example, if things may not appear where they were placed, impassable linedefs may be passable, sectors may not be rendered any more.

 

Maps should always by constructed around the center of the editor center point in a 32k by 32k (at most) area.

 

n5yLbkN.png

Edited by Kappes Buur

Share this post


Link to post
  • 1

The other answer is good but I wanted to add that regardless of map format and source port, Doom's node structures are used to prune areas of the map to avoid needing to render them at all.

 

Assuming that you use a modern, quality node builder, do not engage in any trickery to fool it, and the map geometry is valid and consistent, then the engine should not even try to render areas that cannot possibly be in view of the player. They are completely ignored. This is true for DOOM.EXE, GZDoom, and everything in-between.

 

There will likely be some gray area where a sub-sector is potentially visible from the player's sub-sector but in reality is not, so the engine has to perform some extra calculations. However, two completely disjoint areas with no connection and you teleport between them will certainly result in the engine completely ignoring one of the two map areas depending on the player's location.

Share this post


Link to post
  • 1
On 2/5/2024 at 2:06 PM, Wo0p said:

Does interactive linedef portals count as "trickery to fool it" ? As in two separate areas that aren't technically connected but you can still see and go through them.

 

Linedef portals are one exception to the rule I talked about, but there is some nuance. To start with, let's reference the ZDoom wiki page for portals.

 

You will notice there are four types of linedef portals, and as an aside I would like to point out that UDB3 has slightly different names for them when you use linedef special 156.

 

Anyway, the different types of linedef portals all increase the processing requirements for the engine. At a minimum, the engine has to do all of its regular work for the player's physical location then it has to do all that work over again for whatever is visible through the linedef portal.

 

There are two caveats here.

 

First, as you move up the stack to more advanced portal types, the load on the game engine increases because it has to support more and more features which require more (extra) calculations.

 

  • Visual portals are just that: view only. There is no collision detection between sectors because the linedef is not passable, at least not to the linedef that is the portal target. There is no sound propagation, either.
  • Teleporter portals add collision detection. The actor being teleported actually needs room behind both linedefs, adding a little extra work.
  • Interactive portals allow more effects to pass through such as projectiles and hitscan. This adds more work.
  • Static also affects the automap.

 

Second, any portal adds significant load. All guidance I have read whether on the wiki or forums say to limit portal usage, avoid complex architecture on either side, avoid large areas with lots of nodes/view checks, and absolutely avoid multiple portals in view of the player at one time including viewing a portal through another portal.

 

In my experience I have not suffered adverse performance from portals, but I have also not played any maps that abuse the feature and have a decently powerful PC. I certainly recommend following the guidelines above if you do choose to use portals in your maps.

 

I also need to point out that GZDoom also supports sector portals, which is why I was mostly careful to use the term "linedef portal" up until now. I honestly have not used sector portals before, but they appear to be more of a building block for 3D floors than a viewport into a different part of the map. They look like they would affect performance to a much lesser degree, probably about as much as any of the other twelve types of 3D floor effects supported by GZDoom.

Edited by Caffeine
Formatting only

Share this post


Link to post
  • 0
48 minutes ago, Kappes Buur said:

It is not so much performance as accuracy of the renderer. Maps may become squirly when placing sectors at opposite ends of the editor field.

 

snip-

 

For example, if things may not appear where they were placed, impassable linedefs may be passable, sectors may not be rendered any more.

 

Maps should always by constructed around the center of the editor center point in a 32k by 32k (at most) area.

 

-snip

 

Oh damn, alright. Thanks for the answer! I couldn't ever have predicted that was a thing at all. I'll keep my maps centrered from now on ;)

Share this post


Link to post
  • 0
1 hour ago, Caffeine said:

The other answer is good but I wanted to add that regardless of map format and source port, Doom's node structures are used to prune areas of the map to avoid needing to render them at all.

 

Assuming that you use a modern, quality node builder, do not engage in any trickery to fool it, and the map geometry is valid and consistent, then the engine should not even try to render areas that cannot possibly be in view of the player. They are completely ignored. This is true for DOOM.EXE, GZDoom, and everything in-between.

 

There will likely be some gray area where a sub-sector is potentially visible from the player's sub-sector but in reality is not, so the engine has to perform some extra calculations. However, two completely disjoint areas with no connection and you teleport between them will certainly result in the engine completely ignoring one of the two map areas depending on the player's location.

 

Very interesting, thanks for going indepth! :o

 

Does interactive linedef portals count as "trickery to fool it" ? As in two separate areas that aren't technically connected but you can still see and go through them.

Share this post


Link to post
  • 0

Thanks again for going very indepth on the topic. It's very much appreciated as while I usually don't compromise on my artistic "vision" on a project, performance, is one compromise I'm definitely willing to make. So knowing more about the little details and the differences helps in making the decision on which to use in any given situation :)

 

I haven't tried using sector portals either, the setup is a little confusing to me but if they're more performance friendly I might have to start looking into figuring out how they work. And to be fair I only use line portals because I'm too lazy to create 150 3D floors, so...

 

Anyway, I think my questions have been answered beyond the call of duty. Cheers both :)

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...