Jump to content
The Dark Mod Forums

Doom 3 mod code help


ReViliTy

Recommended Posts

Been scouring the net for an active community for doom3 and this was the most active outside of github source codes... so I figured it might be worth a shot.

 

Looking to see if there is anyone who can give me a hand fixing up the thirdperson cross hair for Doom 3 Ruiner. There are 2 bugs in it. I'm hoping to get a fix included for the upcoming, and long overdue, patch for the mod. This is probably the biggest bug in the mod.

 

The first bug is from the trace line made to determine the cross hair's position. When playing the mod, type g_debugweapon 1 in the console to show the line used to determine the position and also for the melee combat related additions. When something gets in the way of the line, the cross hair won't update. This is easily duplicated by standing next to a wall or door way and just shooting. I have a hunch the issue is mainly caused by the shoulder camera offsetting the camera. Maybe being able to offset the origin of the line to the right would help?

 

The other bug deals with launching projectiles from the barrel. When set to 1, the cross hair is always off. to counter act it an offset can be set in the cursor.gui It works alright, but will still be off when looking too high or low because of the weapons barrel position. The only thing I can think of is maybe a flag in the projectiles fired to aim towards it... which could look wierd unless the crosshair position is offset right in the cursor.gui.

 

Any help would be really appreciated!

 

We uploaded the source code for the mods years ago on the mod db.

https://www.moddb.com/mods/ruiner/downloads/ruiner-hardqore-2-source-codes

 

The crosshair is handled in the player cursor.cpp

Link to comment
Share on other sites

It is not easy to build and run your code, because it needs some assets (I guess D3 assets), which e.g. I don't have.

So debugging this requires would considerable effort from TDM coders.

Maybe videos with the problem will help a bit.

 

 

Looking at the sources, I have not found where crosshair is computed.

I see tracer.h/cpp which seems to be used to draw projectile paths. Also I found some relevant code in idWeapon::Event_LaunchProjectiles.

 

In projectile launching code I see:

idVec3 view_pos = playerViewOrigin + playerViewAxis[ 0 ] * 2.0f; // Muzzle pos for translation clip model only-- For barrel Launched projectiles
...
if ( barrelLaunch || tracer || beam ) { // Do not execute this part unless projectile is barrel launched or has a tracer effect.
    gameLocal.clip.Translation( tr, view_pos, view_pos + dir * 4096.0f, NULL, mat3_identity, MASK_SHOT_RENDERMODEL, owner );

It looks like this trace is always launched from view position.

 

There is some code to correct it later:

idVec3 &launch_pos = view_pos;
...
if ( barrelLaunch ){
    launch_pos = muzzle_pos; 
}

But it seems to happen after the first code segment, so probably it does not have effect.

 

Anyway, it would be great to know where crosshair is computed.

Link to comment
Share on other sites

Yes the mod requires doom3 to run. I completely understand not having d3 installed since you guys are standalone. If its a hassle dont worry about as I wouldnt want to hold you guys up any. I do appreciate the effort looking into it. cross hair stuff is located in the playercursor.cpp file

 

Since posting this topic; a port to dhewm has started. So maybe itll get tackled during or afterwards with a cleaner code on hand. Once again thanks for the look!

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.
      · 6 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...