Jump to content
The Dark Mod Forums

Code Updates


CodeMonkey

Recommended Posts

re: posting questions

 

I'd recommend just starting a thread right in this forum for any discussions on implementing features. It's much easier to discuss here than the tracker.

 

Alright, I'll probably throw one up after I get some sleep, I've been working on getting the Doom3.exe compiled, then, I tried out the MH VBO, and some other 'supposed' optimizations, but, saw either little to no change, or changes for the worse. (I really need some more FPS, I hit as low as 6-8 FPS in FM's like Deceptive Shadows, most stay closer to playable, but, my computer should max this game out.)

 

Anyways, need sleep, I'll try to stop obsessing over FPS and get back on TDM coding tomorrow, or today, or possibly yesterday, depending on your time zone. :P

Edited by CodeMonkey
Link to comment
Share on other sites

As far as community optimizations for Doom 3, the only other notable change besides (possibly) the VBO improvement,

is "adding back Carmack's reverse with StencilOpSeperate".

 

Still, most of these optimizations are on the CPU side but your hardware is GPU limited as I recall.

 

I would stop by freenode webchat then visit #thedarkmod and see if Serpentine will provide (or discuss) his Normal Map compression patch.

That patch will, of course, require you to re-encode TDM assets to the new Normal map format but the GPU savings are quite substantial.

 

Deceptive Shadows takes a little heavier toll on performance than many other missions.

It seems to use more light sources for effect than most missions? There may be some things that can be improved by better mapping, like brush carving etc...

(I believe Biker may have helped on this one so perhaps not. :( )

 

I'll try recompiling the mission with shadowopt 2 or lightCarve switches and report whether any gains are shown for either. :smile:

 

 

Edit:

 

Added a note to Tracker. You should discuss your findings with MH over here:

 

http://forums.inside3d.com/viewtopic.php?f=9&t=3491&sid=af5a141b2f9395639118f7f508b2400a&start=540

Edited by nbohr1more

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

As far as community optimizations for Doom 3, the only other notable change besides (possibly) the VBO improvement,

is "adding back Carmack's reverse with StencilOpSeperate".

 

A doom3 community created variation of the reverse has already been added back into TDM as well as a host of other optimizations in the 1.08 code base.

Link to comment
Share on other sites

Yes, other than the carmacks reverse that is already in 1.08 the outside Doom 3 community has not issued any significant performance patches yet. That is what I was trying to convey.

 

raynorpat did have a cursory shadow mapping patch working (based on the experimental render path)... but found that it was a memory hog. So that's where things stand until some more eager "engine folk" show interest in Doom 3. That's why I've been pushing to test the VBO patch. If we can get show Mh how much our project benefits from his work he might dedicate more time to Doom 3 rather than Quake engine updates.

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

@nbohr1more, yeah, none of those things helped. I have the VBO and the carmack reverse variant, but, like you said, I'm GPU limited, so, that probably makes the difference. :(

 

RE: Normal maps, I think there is room for improvement even on more basic levels, just using more modern coding techniques could help, it has it's own STL implemetations, whereas standard STL code would likely be faster, it could use better multicore support, and take better advantage of modern GPU's, etc,. (I haven't profiled performance extensively, but, looking at taskmanager during runtime showed like: 25% CPU usage, and 250mb of my 4gb of ram, though, most games idle when they lose focus, so, that's not the best method for testing.)

 

I think this quote sheds some light on a lot issues related to assets. (ie, load times, performance issues at runtime, etc,.)

 

Fabien Sanglard - So far only .map files were text-based but with idTech4 everything is text-based: Binary seems to have been abandoned. It slows down loading significantly since you have to idLexer everything....and in return I am not sure what you got. Was it to make it easier to the mod community ?

 

John Carmack - In hindsight, this was a mistake. There are benefits during development for text based formats, but it isn't worth the load time costs. It might have been justified for the animation system, which went through a significant development process during D3 and had to interact with an exporter from Maya, but it certainly wasn't for general static models.

 

Xml might be a good replacement for things we want modifiable by hand, and then switch everything else to a binary form of encoding. (ie, Xml, and binary serialization, etc,.)

 

A lot of this stuff would be good to try as TDM goes standalone, just benchmark different formats against the defaults. (You could probably build a small test level, that has lot's of stuff in it, but, uses the same materials, to keep it simple, converting the entirety of the games assets multiple times would be tedious.)

 

It's up to these guys whether they want to dedicate time to any of this stuff, I'm new to the project, so it's not my place to say anything "will be done", but, I do see a lot of room for improvement just by glossing through the code, etc,. (I also have no idea how much improvement the unreleased versions have actually seen.)

 

----

 

Edit: Btw, to answer your question from the tracker, I tested the changes by making a save in Deceptive Shadows, I found a spot, and let my FPS normalize, then made a save I could restore to test with different .exe's. (I chose a couple of spots, and made named saves with an FPS note, ie, "FPS Test 15fps", etc,.)

 

I also just walked around the level to gauge general performance, I had lost 4fps on average with the VBO + reverse variant. (The reverse variant was stable, it showed no losses, but, no real gains either. There is a slight chance they conflicted, but, that's stretching, it's more likely that my system just doesn't benefit from them.)

 

---

 

Edit2: I wanted to give everything a fair shot, so I tested the reverse variant, and VBO separately, I also tried various compiler optimizations, etc, my original results still stand, these fixes simply don't benefit my rig.

 

I messed around with the source code, over a year ago now, and I added in distance fogging, and messed with some other render settings, and saw much bigger improvements, so, I may try that again. (It's wasn't ideal, but, it gave me a huge FPS boost, at the cost of ruining visuals to a large extent.)

Edited by CodeMonkey
Link to comment
Share on other sites

Well, we could really benefit from the following things:

 

* instancing. The D3 renderer renders every model instead of rendering multiple batches in one go. The SEED system "fixes" this by creating on-the-fly huge models that consist of the data of multiple small models copied together. That takes time to update and is a memory hog. But it was the best we could do w/o source code access. Having instancing would really help when multiple instances of the same model are on screen, like vegetation

* mesh deformation on the GPU. Currently all animations run on the CPU, then the result is uploaded to the GPU. If you have multiple AI, even if they are not thinking but just breathing, this takes a toll on slower CPUs.

* better multithreading support (an 8 core CPU will idle 6 cores or so)

* better trace methods. We currently run multiple traces for some things (AI => player vision), but AFAIK these all do the same work over and over again instead of caching some results between traces.

* a better physics engine (possible even running on the GPU, too)

 

There are probably others. Unfortunately, most changes are require a lot of work for gains that are only visible on some machines in some missions - if you don't have dense vegetation, you likely don't benefit from instancing, if you have only a single AI or only one CPU core, then you don't benefit from multihtreading etc.

"The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man." -- George Bernard Shaw (1856 - 1950)

 

"Remember: If the game lets you do it, it's not cheating." -- Xarax

Link to comment
Share on other sites

* Screen-Space Ambient Occlusion :wub:

* Soft Shadows :wub:

* Lightmap support :wub:

* ...

:>

 

Er, we were talking about making it render faster, not prettier (and slower ;)

"The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man." -- George Bernard Shaw (1856 - 1950)

 

"Remember: If the game lets you do it, it's not cheating." -- Xarax

Link to comment
Share on other sites

I think I see the issue with your revised VBO implementation.

 

Mh appears to doing the extension check from the whole extension list once then populating a variable with the result.

 

Your implementation appears to be parsing the extension list for the conditional every time the VBO path is invoked?

 

Hard to say how often that comes up. (Once? Every time?)

 

Here is a full dhewm build with the VBO code where the performance purportedly improved for ATI users (forum user anecdotes):

 

http://code.google.com/p/realm/downloads/detail?name=dhewm3.7z&can=2&q=

 

for comparison.

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

Yeah if we were making a fantasy wish list, I'd say better physics, multiplayer (coop & TvG) support, backtrackable load-zone support, I could use help with the security levels feature, I'd like script calls (like buttons) that could pass-self ... But this is all probably above bugs that need fixing and features the game really needs.

What do you see when you turn out the light? I can't tell you but I know that it's mine.

Link to comment
Share on other sites

(speaking as just a player)

First I would like to welcome and thank CodeMonkey for offering to help out. There have been times in the past where folks showed up, offered to help, but never actually produced anything, so it is pretty awesome to see someone just come out and offer some code. Something I am unclear on. I recall reading that Doom 3 had per-polygon hit detection. This can be seen in the way the ragdolls interract with each other. You can stack bodies and they do not clip through each other.

 

However, you cannot put objects like keys into pots/pans/bowls/etc... at least not while playing the game. The models seem to be a "box" and your item of choice just rests on the top. Is this a code limitation or a model limitation? This was especially noticeable in Paul's latest playthrough, where he was picking up pots and turning them upside down to see if anything came out.

--- War does not decide who is right, war decides who is left.

Link to comment
Share on other sites

Is this a code limitation or a model limitation?

 

Models that are movables can only have collision models with a limited number of sides. They don't work properly if they are concave.

Link to comment
Share on other sites

More detail about how collision "really works":

 

http://wiki.splashdamage.com/index.php/Collision_Meshes

 

Collision meshes are automatically optimised by the game to use polygons rather than triangles. Therefore, co-planar triangles will be optimised down into a single n-sided polygon, for efficiency and performance.

  • As an example, while a simple cube is rendered using 12 three-sided polygons (triangls), the collision optimisation will read it as 6 four-sided polygons (quads).

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

More detail about how collision "really works":

 

http://wiki.splashda...ollision_Meshes

 

Collision meshes are automatically optimised by the game to use polygons rather than triangles. Therefore, co-planar triangles will be optimised down into a single n-sided polygon, for efficiency and performance.

  • As an example, while a simple cube is rendered using 12 three-sided polygons (triangls), the collision optimisation will read it as 6 four-sided polygons (quads).

 

It is also worth mentioning that our idTech4 version of the engine has only one CM (so not different models for player vs. model or proectile vs model collisions) AND there is an extremely low limit of I think 16 polygons per CM AND it has to be concave (but I remember we have L-shaped chairs?).

 

This means you cannot put a key in a bow, anything under a chair (the lower part is just a cube), and a host of other limits.

 

There is some special case (read: hack done by id) for cylinders (like flowerpots) to make them appear rounder, but I am not sure what exactly it does or how it works. It is bloody useless in almost any case except for flowerpots (which cannot be empty) and bottles, anyway.

"The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man." -- George Bernard Shaw (1856 - 1950)

 

"Remember: If the game lets you do it, it's not cheating." -- Xarax

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

    • Petike the Taffer

      I've finally managed to log in to The Dark Mod Wiki. I'm back in the saddle and before the holidays start in full, I'll be adding a few new FM articles and doing other updates. Written in Stone is already done.
      · 0 replies
    • nbohr1more

      TDM 15th Anniversary Contest is now active! Please declare your participation: https://forums.thedarkmod.com/index.php?/topic/22413-the-dark-mod-15th-anniversary-contest-entry-thread/
       
      · 0 replies
    • JackFarmer

      @TheUnbeholden
      You cannot receive PMs. Could you please be so kind and check your mailbox if it is full (or maybe you switched off the function)?
      · 1 reply
    • OrbWeaver

      I like the new frob highlight but it would nice if it was less "flickery" while moving over objects (especially barred metal doors).
      · 4 replies
    • nbohr1more

      Please vote in the 15th Anniversary Contest Theme Poll
       
      · 0 replies
×
×
  • Create New...