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 » Sun Aug 05, 2012 6:49 am

Doom3 ROE shot from my engine

Image

Doom3 is dark ... naaaahh :P

It works really well now but damn it takes its tool on FPS with highres textures and everything set to highest detail.
2x 560 gtx ti in sli and with everything on max i can hardly hold it at 10 fps :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 Spiney » Sun Aug 05, 2012 1:46 pm

Something which I think would look cool on D3 would be self shadowing bumpmaps :)
Spiney
 
Posts: 63
Joined: Mon Feb 13, 2012 1:35 pm

Re: Doom 3 engine release and game code

Postby revelator » Mon Aug 06, 2012 12:00 pm

Interresting :)

I seem to recall that doom3 was allready able to do selfshadowing but that it looked crap so many mods turn it of hmm ?.
Atm im pondering a way to make parralax occlusion mapping a material resource so that it can be enabled on flat textures only to avoid the
texture gliding bug which looks kinda bad.

The offset limited version looks mostly ok but even that one sometimes breaks.
Tesselation might work better but im not yet sure how to go about that one.
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 Aug 06, 2012 5:13 pm

Two simple enhancements.

Change the definition of the "saveGame" command to this:
Code: Select all
cmdSystem->AddCommand ("saveGame", SaveGame_f, CMD_FL_SYSTEM | CMD_FL_CHEAT, "saves a game", idCmdSystem::ArgCompletion_SaveGame);

And now you've got TAB autocompletion on it.

In idConsoleLocal::KeyDownEvent, change the K_ENTER/K_KP_ENTER condition block to this:
Code: Select all
   if (key == K_ENTER || key == K_KP_ENTER)
   {
      int buflen = strlen (consoleField.GetBuffer ());

      common->Printf ("]%s\n", consoleField.GetBuffer ());

      cmdSystem->BufferCommandText (CMD_EXEC_APPEND, consoleField.GetBuffer ());   // valid command
      cmdSystem->BufferCommandText (CMD_EXEC_APPEND, "\n");

      // don't add empty lines to history
      if (buflen > 0)
      {
         // copy line to history buffer
         historyEditLines[nextHistoryLine % COMMAND_HISTORY] = consoleField;
         nextHistoryLine++;
         historyLine = nextHistoryLine;
      }

      consoleField.Clear ();
      consoleField.SetWidthInChars (LINE_WIDTH);

      session->UpdateScreen ();// force an update, because the command
                        // may take some time
      return;
   }

Prevents blank lines from being added to the history.

Both were just minor annoyances, but it's nice to clean these things up too.
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 Aug 07, 2012 6:10 am

Nice addition mh thanks :)
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 Aug 07, 2012 6:21 am

Small addition from me.

theres a ton of if (strlen(somename) == 0) according to pvs-studio its better to just do if (somename[0] == '\0')
i tried it to see if it would break anything but it seems to work just fine there might however be edge cases so doublecheck.
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 » Wed Aug 08, 2012 12:46 pm

Hmm found a rather weird call

if (sel >= 0)
{
m_drawMaterial->setMedia(lightInfo.strTexture);
}
else
{
m_drawMaterial->setMedia(lightInfo.strTexture);
}

there essentially the same so removing the check should be correct ?
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 » Wed Aug 08, 2012 8:45 pm

An interesting change is to enable in_toggleRun for single player; in idUsercmdGenLocal::MakeCurrent:
Code: Select all
toggled_run.SetKeyState (ButtonState (UB_SPEED), in_toggleRun.GetBool ());

It completely alters the feel of the game; there's no more sluggish movement and a pretty cool resource management game with your stamina bar is added.
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 » Thu Aug 09, 2012 9:03 am

Heh nice :) that is indeed usefull.

Would the toggle also work for crouch etc ?. as i found it does not seem to work in vanilla.
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 motorsep » Thu Aug 09, 2012 4:18 pm

So mh's code allows to press Shift once and player will keep running until Shift is pressed again ? What about stamina bar is it another code that brings it to the HUD?
motorsep
 
Posts: 231
Joined: Wed Aug 02, 2006 11:46 pm
Location: Texas, USA

Re: Doom 3 engine release and game code

Postby revelator » Thu Aug 09, 2012 6:23 pm

If using an unmodified gui the stamina bar is just there you will run untill your stamina bar reaches zero then you will have to walk a bit untill it reaches full again.
Stamina bar does not show up if using 6th venoms HD menu gui.

So yeah press shift to toggle ;) works a bit like in crysis.
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 motorsep » Thu Aug 09, 2012 6:38 pm

Well, if you have run toggled, then what's the point of having stamina ?
motorsep
 
Posts: 231
Joined: Wed Aug 02, 2006 11:46 pm
Location: Texas, USA

Re: Doom 3 engine release and game code

Postby mh » Thu Aug 09, 2012 7:39 pm

Stamina still goes down if you're running; the bar is just always visible but otherwise behaviour is exactly the same.

There's an in_toggleCrouch as well, which needs to be set to 1 (and which doesn't get saved to your config) in order to enable crouch toggling. A lot of the PC-weenies hate toggled crouch, seeing it as a symptom of consolization, but I'm thinking that in general terms if you crouch then 9 times out of 10 you're going to want to stay crouched (e.g. going through a pipe, ducking behind a crate, whatever).
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 » Sat Aug 11, 2012 1:38 am

Heh i just found Doom3's breaking point for model texture sizes its 1024x1024 for a card with 1 gig texture mem. Going above that will crash both doom3 and the driver ouch.
Can probably go beyond that with compressed textures but will loose some detail.
Biggest problem in that regard is that textures this size will have to be loaded directly or split in several pk4 archives cause else the archives will go above the boundaries of what the pak loader can read (atm 2.2 gig above that and you will get a pak that wont load).
I wonder if the same trick that was used in nehahra for expanding pak sizes can be used for doom3 ? referring to the MAX_FILES_IN_PAK define.
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 motorsep » Sat Aug 11, 2012 2:03 am

Why don't just raise the limits? Especially for pk4 size.
motorsep
 
Posts: 231
Joined: Wed Aug 02, 2006 11:46 pm
Location: Texas, USA

PreviousNext

Return to General Programming

Who is online

Users browsing this forum: No registered users and 1 guest