Jump to content
The Dark Mod Forums

NHAT cavern fps


duzenko

Recommended Posts

So we have been using the NHAT cavern for general benchmarking.

Performance issues are obvious - I get 20 fps or less looking at the three spiders (notarget on).

And I have a problem with it - the problem is that the bottleneck here is not the graphics rendering.

I think I narrowed it down to physics simulation.

The map author appears to have assigned the smaller white spiders to be "chewing" on the corpses.

When you kill/gas the spiders or simply notarget off so that they move towards you then fps skyrockets.

My research shows that CPU is sweating in the debris of Collision Model Manager.

Quick questions:

1. How 'normal' is this? Do we need to do something about this issue? If it's exploitation of game mechanics to shock player with cannibal spiders then we probably should not use this scene for benchmarking.

2. Do we first kill spiders and benchmark then? I would not guess this unless I knew the spiders are the problem.

3. Do we need to blend animation frames each game tick for physics simulation? In my case, I have 20 graphics frames per second and 60 game ticks. If animation is 24 fps (judging by md5anim files) then would it not be enough to simply use the current frame? I understand that we want as much precision as possible for physics simulation but not at the expense of visual slideshow? Maybe introduce a new option - high precision vs low precision sims or something like that. Maybe automatically switch based on current fps.

Again, these scene is CPU limited and I have a 2.7 GHz Core i5. We should aim to achieve at least 30 fps on modern midrange CPUs, shouldn't we?

Edited by duzenko
Link to comment
Share on other sites

Interesting thoughts.

 

To evaluate the scene, we probably should be using killmonsters. I didn't do so because I was trying to make my CPU sweat

so that the CPU burden of the renderer was exaggerated.

 

Hmm. Are the spiders continually colliding with the corpse? I think that we need to look at why the code is being so realistic \ literal

about this scenario. They should just stop in front of the target and animate without thinking about collision or AI relations until they

are provoked by real AI or player relations.

 

Edit:

 

Oh, disabling blend based on FPS eh? Interesting thought too. It would make transitions and physics events look uglier but so is

sub-10 FPS (etc) rendering. Worth a look at that. The tdm_lg_interleave_min cvar has an example implementation of toggling

stuff based on FPS.

Please visit TDM's IndieDB site and help promote the mod:

 

http://www.indiedb.com/mods/the-dark-mod

 

(Yeah, shameless promotion... but traffic is traffic folks...)

Link to comment
Share on other sites

Might not be MC Biker. If the spider chewing on the corpse is the main culprit then it's just the repeated collision checks with the complexity of

the spider model vs the complexity of the zombie model.

Please visit TDM's IndieDB site and help promote the mod:

 

http://www.indiedb.com/mods/the-dark-mod

 

(Yeah, shameless promotion... but traffic is traffic folks...)

Link to comment
Share on other sites

A harder question.

How thread safe is the collision manager?

Putting physics in a separate thread looks so beautiful and exciting in theory but my uneducated attempts to QueueUserWorkItem anything related to collision manager from the gametick code crashed and burned with null ptr AV.

Ideally, SMP might easily double fps in the cavern, unless throttling kicks in.

 

It's funny, really, how killmonsters doubles the fps here.

We should absolutely put it in the Performance Tweaks wiki [trollface.png].

Edited by duzenko
  • Like 1
Link to comment
Share on other sites

I believe that it was intended to be thread safe.

 

Here is a little background on SMP in general:

 

 


 

Fabien Sanglard - The rendering system is now broken down in a frontend/backend: It reminds me of the design of a compiler which usually has a frontend->IR->backend pipeline. What this inspired by the design of LCC which was used for Quake3 bytecode generation ? I wonder what are the advantages over a monolithic renderer like Doom, idTech1 and idTech2.

John Carmack - This was explicitly to support dual processor systems. It worked well on my dev system, but it never seemed stable enough in broad use, so we backed off from it. Interestingly, we only just found out last year why it was problematic (the same thing applied to Rage’s r_useSMP option, which we had to disable on the PC) – on windows, OpenGL can only safely draw to a window that was created by the same thread. We created the window on the launch thread, but then did all the rendering on a separate render thread. It would be nice if doing this just failed with a clear error, but instead it works on some systems and randomly fails on others for no apparent reason.

The Doom 4 codebase now jumps through hoops to create the game window from the render thread and pump messages on it, but the better solution, which I have implemented in another project under development, is to leave the rendering on the launch thread, and run the game logic in the spawned thread.

 

 

http://fabiensanglard.net/doom3/

Please visit TDM's IndieDB site and help promote the mod:

 

http://www.indiedb.com/mods/the-dark-mod

 

(Yeah, shameless promotion... but traffic is traffic folks...)

Link to comment
Share on other sites

Yes, as far as I can tell, SMP in Doom 3 is "frontend is one core, backend is the other" The work is syncronized via session markers like "latchedTicNumber".

To get AI or Collision on a different thread, you must also move the renderer frontend there.

Please visit TDM's IndieDB site and help promote the mod:

 

http://www.indiedb.com/mods/the-dark-mod

 

(Yeah, shameless promotion... but traffic is traffic folks...)

Link to comment
Share on other sites

I wonder what makes the cavern spiders so slow.

Is it the corpses? The stalagmites? Does the spring water add any complexity into the calculation?

Maybe we could alter the map and see how fps responds to each of the factors.

Edited by duzenko
Link to comment
Share on other sites

Probably the skeletons. Might be worth making them immovable and setting them non-solid. ( @Biker) but ideally we would want

to be able to have prop skeletons in missions like this.

Please visit TDM's IndieDB site and help promote the mod:

 

http://www.indiedb.com/mods/the-dark-mod

 

(Yeah, shameless promotion... but traffic is traffic folks...)

Link to comment
Share on other sites

Hmm.

 

I tried both killRagdolls and killMonsters in the scene and neither seemed to

improve performance that much for me. I'm probably more GPU limited now.

 

Just to double check, you're on NHAT 3.0 (latest build)?

 

(screenshot please?)

 

Gonna compare cm_backFaceCull 1 vs 0 cvar to see if physics drags me down at all.

 

Edit: Nope, no real change.

Please visit TDM's IndieDB site and help promote the mod:

 

http://www.indiedb.com/mods/the-dark-mod

 

(Yeah, shameless promotion... but traffic is traffic folks...)

Link to comment
Share on other sites

Thanks.

 

I have an i3-2130 3.4ghz and GeForce GT 730.

 

One other thing that might help here is setting the interleaved thinking frames higher on the

Spiders. I got a Minimal boost from that but you might see better results.

Please visit TDM's IndieDB site and help promote the mod:

 

http://www.indiedb.com/mods/the-dark-mod

 

(Yeah, shameless promotion... but traffic is traffic folks...)

Link to comment
Share on other sites

Yes, you could set "tdm_ai_opt_interleavethinkframes" to 15 or higher in the console.

 

Or you'd need to open the politics.map and locate the atdm_ai_spider_child entities and give them

a value like:

"max_interleave_think_frames" "15"

then repack the mission.

 

http://wiki.thedarkmod.com/index.php?title=Interleaved_Thinking_optimization

  • Like 1

Please visit TDM's IndieDB site and help promote the mod:

 

http://www.indiedb.com/mods/the-dark-mod

 

(Yeah, shameless promotion... but traffic is traffic folks...)

Link to comment
Share on other sites

Hm, tdm_ai_opt_interleavethinkframes did not do anyting really for me too. I think there are a number of situation where interleavethink option is overridden and AI thinks each game tick, such as when its movement is blocked. It's all in idAI::SetNextThinkFrame.

On the other hand, _opt_nothink, again, doubles the fps.

I have been looking at where cpu is spending most of its clocks and I think while some of it is AI but a lot of it is idAFEntity_Base.

I have an idea which objects it could be.

Here's a low-quality video with a jittering model stuck between spider and bed: https://www.youtube.com/watch?v=ekZkOBnE2u4.

While TDM physics code may or may not be doing a great job handling narrow places like this I still think it would be easier to fix it on the map design level.

If we relieve the white spiders from getting stuck around the bed it should help a ton in terms of fps.

Edited by duzenko
  • Like 2
Link to comment
Share on other sites

Join the conversation

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

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  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.

  • Recent Status Updates

    • OrbWeaver

      Does anyone actually use the Normalise button in the Surface inspector? Even after looking at the code I'm not quite sure what it's for.
      · 2 replies
    • Ansome

      Turns out my 15th anniversary mission idea has already been done once or twice before! I've been beaten to the punch once again, but I suppose that's to be expected when there's over 170 FMs out there, eh? I'm not complaining though, I love learning new tricks and taking inspiration from past FMs. Best of luck on your own fan missions!
      · 4 replies
    • The Black Arrow

      I wanna play Doom 3, but fhDoom has much better features than dhewm3, yet fhDoom is old, outdated and probably not supported. Damn!
      Makes me think that TDM engine for Doom 3 itself would actually be perfect.
      · 6 replies
    • Petike the Taffer

      Maybe a bit of advice ? In the FM series I'm preparing, the two main characters have the given names Toby and Agnes (it's the protagonist and deuteragonist, respectively), I've been toying with the idea of giving them family names as well, since many of the FM series have named protagonists who have surnames. Toby's from a family who were usually farriers, though he eventually wound up working as a cobbler (this serves as a daylight "front" for his night time thieving). Would it make sense if the man's popularly accepted family name was Farrier ? It's an existing, though less common English surname, and it directly refers to the profession practiced by his relatives. Your suggestions ?
      · 9 replies
    • nbohr1more

      Looks like the "Reverse April Fools" releases were too well hidden. Darkfate still hasn't acknowledge all the new releases. Did you play any of the new April Fools missions?
      · 5 replies
×
×
  • Create New...