Forum

Doom 3 engine release and game code

Discuss programming topics for any language, any source base. If it is programming related but doesn't fit in one of the below categories, it goes here.

Moderator: InsideQC Admins

Re: Doom 3 engine release and game code

Postby revelator » Thu Nov 22, 2012 11:45 am

Hmm i seem to have found atleast part of the performance problem, it seems to be related to entity triggers as the game lags somewhat whenever i trigger one.
Strange i didnt touch that code as far as i know :S but maybe its caused by something i done elsewhere ?

I also noticed that sometimes moving close to a wall the viewport gets all screwy and tries to drag the edge of the wall along with me as i move :shock:
Productivity is a state of mind.
User avatar
revelator
 
Posts: 2567
Joined: Thu Jan 24, 2008 12:04 pm
Location: inside tha debugger

Re: Doom 3 engine release and game code

Postby revelator » Sat Nov 24, 2012 2:33 am

Oh hell well the rendering problem is a driver bug in 306.97 :evil: still trying to figure out what makes entity triggers lag the game like theres no tomorrow.
Productivity is a state of mind.
User avatar
revelator
 
Posts: 2567
Joined: Thu Jan 24, 2008 12:04 pm
Location: inside tha debugger

Re: Doom 3 engine release and game code

Postby mh » Mon Nov 26, 2012 7:41 pm

BFG Edition GPL code is out: https://github.com/id-Software/DOOM-3-BFG
We had the power, we had the space, we had a sense of time and place
We knew the words, we knew the score, we knew what we were fighting for
User avatar
mh
 
Posts: 2292
Joined: Sat Jan 12, 2008 1:38 am

Re: Doom 3 engine release and game code

Postby revelator » Mon Nov 26, 2012 11:22 pm

:shock: nice one, you pulling an all niter mh :?: :mrgreen:
Productivity is a state of mind.
User avatar
revelator
 
Posts: 2567
Joined: Thu Jan 24, 2008 12:04 pm
Location: inside tha debugger

Re: Doom 3 engine release and game code

Postby revelator » Mon Nov 26, 2012 11:28 pm

Short look we where wrong the changes are huge :shock: no idlib anymore, the renderer looks nothing like the old one either and the vertexcache was totally rewritten.
Edit: idlib is there just overlooked it since the project looks a bit alien compared to the old GPL release.
Productivity is a state of mind.
User avatar
revelator
 
Posts: 2567
Joined: Thu Jan 24, 2008 12:04 pm
Location: inside tha debugger

Re: Doom 3 engine release and game code

Postby mh » Mon Nov 26, 2012 11:56 pm

Fixed the missing muzzleflash lights. In R_AddSingleLight (tr_frontend_addlights.cpp) - this nasty block of code needs to die:
Code: Select all
         // We don't want the lights on weapons to illuminate anything else.
         // There are two assumptions here -- that allowLightInViewID is only
         // used for weapon lights, and that all weapons will have weaponDepthHack.
         // A more general solution would be to have an allowLightOnEntityID field.
         // HACK: the armor-mounted flashlight is a private spot light, which is probably
         // wrong -- you would expect to see them in multiplayer.
         if ( light->parms.allowLightInViewID && light->parms.pointLight && !eParms.weaponDepthHack ) {
            continue;
         }
We had the power, we had the space, we had a sense of time and place
We knew the words, we knew the score, we knew what we were fighting for
User avatar
mh
 
Posts: 2292
Joined: Sat Jan 12, 2008 1:38 am

Re: Doom 3 engine release and game code

Postby revelator » Tue Nov 27, 2012 12:35 am

Nice :) one thing we might have to fix also is the missing bink interaction since it seems id used bink for ingame videos none of the terminals showing videos ingame work anymore.
Ill see if i can find an opensource alternative that can play bink videos.
Productivity is a state of mind.
User avatar
revelator
 
Posts: 2567
Joined: Thu Jan 24, 2008 12:04 pm
Location: inside tha debugger

Re: Doom 3 engine release and game code

Postby revelator » Tue Nov 27, 2012 12:44 am

Hmm ffmpeg can open bink or bik files though im not sure which codec it uses.
Edit found it its libavcodec :) now we just need an interface since id have removed most of that part as well.

They also removed libfreespace which im a bit curious about since that library is LGPL2 ? its not propriarity it seems.
Last edited by revelator on Tue Nov 27, 2012 1:33 am, edited 1 time in total.
Productivity is a state of mind.
User avatar
revelator
 
Posts: 2567
Joined: Thu Jan 24, 2008 12:04 pm
Location: inside tha debugger

Re: Doom 3 engine release and game code

Postby mh » Tue Nov 27, 2012 1:32 am

Interestingly, the shaders are included with this source release - base/renderprogs.
We had the power, we had the space, we had a sense of time and place
We knew the words, we knew the score, we knew what we were fighting for
User avatar
mh
 
Posts: 2292
Joined: Sat Jan 12, 2008 1:38 am

Re: Doom 3 engine release and game code

Postby revelator » Tue Nov 27, 2012 1:33 am

Aye and the backend is a real beauty :) damn nice coding there.
Edit: just noticed there backend can convert cg to glsl at runtime :)
Productivity is a state of mind.
User avatar
revelator
 
Posts: 2567
Joined: Thu Jan 24, 2008 12:04 pm
Location: inside tha debugger

Re: Doom 3 engine release and game code

Postby revelator » Tue Nov 27, 2012 9:38 am

// Determine whether or not the shadow volume needs to be rendered with Z-pass or
// Z-fail. It is worthwhile to spend significant resources to reduce the number of
// cases where shadow volumes need to be rendered with Z-fail because Z-fail
// rendering can be significantly slower even on today's hardware. For instance,
// on NVIDIA hardware Z-fail rendering causes the Z-Cull to be used in reverse:
// Z-near becomes Z-far (trivial accept becomes trivial reject). Using the Z-Cull
// in reverse is far less efficient because the Z-Cull only stores Z-near per 16x16
// pixels while the Z-far is stored per 4x2 pixels. (The Z-near coallesce buffer
// which has 4x4 granularity is only used when updating the depth which is not the
// case for shadow volumes.) Note that it is also important to NOT use a Z-Cull
// reconstruct because that would clear the Z-near of the Z-Cull which results in
// no trivial rejection for Z-fail stencil shadow rendering.

const bool renderZPass = ( drawSurf->renderZFail == 0 ) || r_forceZPassStencilShadows.GetBool();


Code: Select all
      if ( renderZPass ) {
         // Z-pass
         qglStencilOpSeparate( GL_FRONT, GL_KEEP, GL_KEEP, GL_INCR );
         qglStencilOpSeparate( GL_BACK, GL_KEEP, GL_KEEP, GL_DECR );
      } else if ( r_useStencilShadowPreload.GetBool() ) {
         // preload + Z-pass
         qglStencilOpSeparate( GL_FRONT, GL_KEEP, GL_DECR, GL_DECR );
         qglStencilOpSeparate( GL_BACK, GL_KEEP, GL_INCR, GL_INCR );
      } else {
         // Z-fail removed
      }


heh seems id took the bat to it in this as well
Productivity is a state of mind.
User avatar
revelator
 
Posts: 2567
Joined: Thu Jan 24, 2008 12:04 pm
Location: inside tha debugger

Re: Doom 3 engine release and game code

Postby hogsy » Tue Nov 27, 2012 9:40 am

How exciting! Will have to check this out when I get home.
User avatar
hogsy
 
Posts: 198
Joined: Wed Aug 03, 2011 3:44 pm
Location: UK

Re: Doom 3 engine release and game code

Postby revelator » Tue Nov 27, 2012 9:57 am

Small whoops on there part it seems one of the changes they had to make to make the source GPL broke the old Doom games that come with it, selecting them from the menu now crashes the engine :S
Productivity is a state of mind.
User avatar
revelator
 
Posts: 2567
Joined: Thu Jan 24, 2008 12:04 pm
Location: inside tha debugger

Re: Doom 3 engine release and game code

Postby Barnes » Tue Nov 27, 2012 12:41 pm

Code: Select all
if ( renderZPass ) {
         // Z-pass
         qglStencilOpSeparate( GL_FRONT, GL_KEEP, GL_KEEP, GL_INCR );
         qglStencilOpSeparate( GL_BACK, GL_KEEP, GL_KEEP, GL_DECR );
      } else if ( r_useStencilShadowPreload.GetBool() ) {
         // preload + Z-pass
         qglStencilOpSeparate( GL_FRONT, GL_KEEP, GL_DECR, GL_DECR );
         qglStencilOpSeparate( GL_BACK, GL_KEEP, GL_INCR, GL_INCR );
      } else {
         // Z-fail removed and restored  :D
   qglStencilOpSeparate(GL_FRONT, GL_KEEP, GL_DECR, GL_KEEP);    
        qglStencilOpSeparate(GL_BACK, GL_KEEP,  GL_INCR, GL_KEEP);
     
}
User avatar
Barnes
 
Posts: 226
Joined: Thu Dec 24, 2009 2:26 pm
Location: Russia, Moscow

Re: Doom 3 engine release and game code

Postby Spirit » Tue Nov 27, 2012 2:28 pm

reckless wrote:Edit found it its libavcodec :)

There is a lot of drama around this, make sure you are looking at the correct sources: http://blog.pkh.me/p/13-the-ffmpeg-libav-situation.html
Improve Quaddicted, send me a pull request: https://github.com/SpiritQuaddicted/Quaddicted-reviews
Spirit
 
Posts: 1031
Joined: Sat Nov 20, 2004 9:00 pm

PreviousNext

Return to General Programming

Who is online

Users browsing this forum: No registered users and 1 guest