cg_gunX, cg_gunY, cg_gunZ, r_znear: can you build a release with this variables unlocked?

Hi guys.

I know a .pk3 called ztm-flexible-hud, but this solution are too restrictive to manage freely the weapon model in other FOV values.

In fact, I’ve search for hel in other great project called Quake 3 Spearmint were a great guy called zturtleman have listened my petition from a idea taked from another game called Serious Sam 2, where I’ve detected that the render makes the weapon model independent from the embiroment render, so the result is when you changes the FOV in game, the weapon model is not altered for the FOV value.
Sadly, this guy have decided to stop developing this grear source port
https://clover.moe/spearmint/

Long live to Spearmint, what memories! :pensive:

The problem with this solution, is I can’t change the X Y Z values from weapon model.

The second try was with a cool russian guy called Берсеркер (Berserker) with a wonderfoul project called Quake 3 Berseker (obious).
http://quakegate.ru/forum/topic429/page155/

In this case, I’ve requested to make the X Y Z variables unlocked. And the cool guy responds me: “Hello SolivaN, I will unlock this cvars”
here: https://cloud.mail.ru/public/3Akr/jopYJCvbX
post: http://quakegate.ru/forum/topic429/page156/

The problem with this source port, is with his eyecandy features (Fake PPL renderer,
True PPL renderer, Parallax mapping, Specular mapping, Texture distortion, Advanced material system, etc) is that the FPS drops dramatically even on my RTX 2070! :open_mouth:

So’ I’ve thinking about Vulkan render that is the solution for all things in the life, vulkan brings a solution for my low self-esteem, for the love of the girl that I don’t have, the solution for, ejem, sorry. :sweat_smile:

So, vkQuake3 is here: https://github.com/suijingfeng/vkQuake3/releases
This project have a excelent performance on the FPS stability. Very very smooth.
But, this project are implemented from ioquake3 code. So this source port have heredated the same omitted locked variables: cg_gunX, cg_gunY, cg_gunZ

So, I would like to have the possibility to move X, Y, Z axes of my weapon on the screen (HUD weapon), because I like to make the appeareance of weapons more brave and more deteailed.

Here’s a serie of screenshots that shows the possibility that we have with this 3 commands.

First I will make a comparison between Quake 3 Vanilla 1.32 with the view cg_gunx 0, cg_guny 0 and cg_gunz 0 with a classic 4: 3 resolution in 640x480 and cg_fov in 90:

Light Gun: cg_fov 90; cg_gunx 0; cg_guny 0; cg_gunz 0

In the following case, we can see that if we want to configure Lightgun in the same way as in XBOX360, we need to change CVAR cg_gun

Light Gun Quake 3 Arcade (XBOX 360) comparison:

XBOX360 Light Gun HUD

Vanilla Quake 3 Light Gun HUD with cg_gunx 2.4 and cg_fov at 115

Plasma Gun example in 640x480 without changes to cg_gun CVAR or cg_fov CVAR:

But if we change CVAR cg_fov, the weapon model (in the HUD) will decrease dramatically

Plasma Gun: cg_fov 110; cg_gunx 0; cg_guny 0; cg_gunz 0

To fix the perspective of the plasma gun, we need to change the CVAR cg_gun parameters:

Plasma Gun: cg_fov 110; cg_gunx -3.5; cg_guny 0; cg_gunz 5

Now we will make a comparison in Quake 3 Berseker to see its behavior.
Quake 3 Berserker compilation on May 25, 2019 with a view of cg_gunx 0, cg_guny 0 and cg_gunz 0 with panoramic resolution from 16: 9 to 2560x1440 (2k):

Machine Gun example in 2560x1440 unchanged in cg_gun CVAR

Until then, Q3 Berseker excels at 16: 9 with CVAR cg_fov at 90
But let’s see what happens when we change cg_fov’s CVAR to 110

It can be seen that the same thing happens in Vanilla Q3, the weapon model decreases when CVAR changes. Cg_fov
To fix this problem, we need to change CVAR cg_gun, as shown below:

Machine Gun: cg_fov 110;cg_gunx -0.1; cg_guny 0; cg_gunz 3.4; r_znear 4

We see that CVAR r_znear 4 affects the weapon pattern when we try to adjust the perspective of the weapon model in the HUD. Same happens with ioquake3, spearmint, and vkQuake. (and vanilla quake 3 of course)

To completely fix this problem, we need to change the r_znear value to 1

I think that z_near is dangerous for hacking, wallhack, etc. So, a good idea is to limit his values from 0 to 4 (like Quake Live does with his cvars) :wink:

We can also customize the impressive BFG 9000 to look like UnrealTournament99Redeemer:


BFG 9000: cg_fov 110; cg_gunx 1.5; cg_guny -9; cg_gunz 6; r_znear 1

In conclusion, I want to show that unlocking CVAR cg_gunx, cg_guny, cg_gunz and r_znear will help Quake 3 Source Ports become even more universal with HUD.

This source is incredible, they really did an excellent job, and I congratulate you and thank you for this wonderful work with such dedication to the classic Quake 3 Arena.

Many thanks to all you dudes, developers! of the best source ports
that I have had the opportunity to probe (ioquake3, berserker, spearmint) :raised_hands:

My respect to all your, masters! :facepunch: :sunglasses:

Some of my dedicated videos to Quake 3, Spearmint and ioquake3 :

Alternate solution:

Use devmap q3dm1 to find cg_gunX/Y/Z offsets you want for a weapon and then modify models/weapons2/*/*_hand.md3 which controls the first person weapon placement. This also allows for per-weapon control and works with all mods and engines.

The new *_hand.md3 models won’t be allowed on pure servers but neither is a CGame VM with the cg_gunX/Y/Z cvars made non-cheat protected. Though both can be used on a pure server if the pk3 with the custom hand models or cgame is on the server.

Extract

Extract the models with a zip program and keep the same directories (models/weapons2/).

Quake 3

baseq3/pak0.pk3

  • models/weapons2/gauntlet/gauntlet_hand.md3
  • models/weapons2/shotgun/shotgun_hand.md3
  • models/weapons2/machinegun/machinegun_hand.md3
  • models/weapons2/grenadel/grenadel_hand.md3
  • models/weapons2/rocketl/rocketl_hand.md3
  • models/weapons2/lightning/lightning_hand.md3
  • models/weapons2/railgun/railgun_hand.md3
  • models/weapons2/plasma/plasma_hand.md3
  • models/weapons2/bfg/bfg_hand.md3
  • models/weapons2/grapple/grapple_hand.md3

Team Arena

missionpack/pak0.pk3

Team Arena dropped the 2 for whatever reason.

  • models/weapons/nailgun/nailgun_hand.md3
  • models/weapons/proxmine/proxmine_hand.md3
  • models/weapons/vulcan/vulcan_hand.md3 (chain gun)

Modify

Using Maverick Model 3D (or Misfit Model 3D) you can load the *_hand.md3 model and translate it like cg_gunX/Y/Z. Use menubar -> Model -> Transform Model. On the default Translate tab set X = gunX, Y = gunZ, Z = gunY (yes, Y and Z have to be swapped for MM3D) and click Translate. Then save the model. Note that *_hand.md3 is not rendered so it only has “MD3 tags” to set tag_weapon position/rotation.

Make a pk3

Zip your modified files (with the same models/weapons2/ directories) and rename the .zip to .pk3. The filename needs to be alphabetically after “pak”, such as q.pk3 since Q is after P.

For testing with ioquake3 and Spearmint you can create a directory with “.pk3dir” at the end (baseq3/zz_new-hands.pk3dir/models/weapons2/...) and set sv_pure 0 to use the models without having to zip the files.

1 Like

zturtleman? is it you? WOW!! man! I don’t know what you are here! MEN!! Thanks a LOT for your GREAT work with SPEARMINT MEN! Is very very impressive to see you here dude!

Well, I’ve follow step by step your manual and the result of the .PK3 is awesome!
I’ve loaded the XBOX 360 Weapon Models on your Spearmint, and the result are sublime

However, the problem of cutted weapon model by znear is there yet. look:



Is possible with your knowledge make a spearmint release (or ioquake release) with the r_znear cvar unlocked?
Or if do you prefer, make the r_znear cvar like Quake Live does (limit his values between 0 to 4) for example.

Quake Live manage the cg_gunX, Y and Z between a range values, so, is a great idea for bring to other source ports, I think.

Thanks again dude for your great help throug all this years.
Cheers! :wink:

Yep, it’s me. Ah, yeah I don’t have a clever workaround for r_znear. It should indeed be range checked so people can’t (as easily) look through walls.

By the way what is the Quake Live range of cg_gunX, Y, Z?

Well, the way to manage all the cvars into the QL are optimized and more controlled.
I mean, if you take a close look in the console, you’ll see the cvars (and some commands) are limited between a range of values (to bring some freedom to the users) but without neglect the security cheats (the same you say “look through walls” for the r_znear cvar case).

However, the idsoftware guys (or Bethesda) have been limit too much the cg_gunX, Y, Z cvars, because you can’t move the Z axis to positive values (cg_gunZ 1, cg_gunZ 2, cg_gunZ 3, etc) only you can set the Z axis with negative values (cg_gunZ 0, cg_gunZ -1, cg_gunZ -2, until -10 if I remember).

This great way to manage the cvars, is a good idea to implement in other source ports, I think.

And for other hand… if I remember right, exactly yourself have been unlocked other CVARS (like r_lodcurveerror and r_subdivisions cvars) when I posted to you some of this same points that I’ve talking about now. It was on the active forum era of Spearmint, rembember this pics???


Actually, your Spearmint have unlocked the r_lodcurveerror and r_rsubdivisions CVARS
Can’t you do the same with r_znear? Look:


Well, If you need some help about the source code for Berserker Quake 3 with unlocked cvars, here is the forum where you can contact with Berserker Quake 3 author:
https://translate.google.cl/translate?hl=es-419&tab=wT&authuser=0&sl=ru&tl=en&u=http%3A%2F%2Fquakegate.ru%2Fforum%2F

Let me what do you think about.
Thanks for all! :smile:

Thanks for checking the cg_gunX, Y, Z cvar range in Quake Live.

Yeah, I know how to un-cheat protect a cvar. I may allow r_znear and cg_gunX, Y, Z range in Spearmint 1.1.0 (feature update) but there is currently no announcement as to when it will be released.

r_subdivisions is not cheat protected in vanilla Quake 3. r_lodcurveerror is cheat protected in Quake 3 but not in Wolfenstein: Enemy Territory. Though I still haven’t tracked down if Wolf:ET unlocked it or if a later Q3 patch make it cheat protected. It’s impressive that high quality curves are possible in such an old game and I want people to use it.

Yaicks! I can’t wait to be released! Thanks for hear me again zturtleman! You are great code developer!

PS: I can suggest values range between -20 to 40 in the cg_gun cases? And for r_znear a range from 0.3 to 4 it will enough.

Also I’ve remembered that the Rail Gun and BFG trail path are not coded to follow the position of the model gun (in the case of the BFG the projectile always shoot out from the center of the screen). And the Rail Gun are always fixed to a static point. Here’s a fixed example of this, look:

fixed CG code path for EV_RAILTRAIL: correct rail trail start position according cg_gun

If too much all this, never mind, with the r_znear fix and cg_guns unlocked are sufficient. (may be for future future re release maybe :wink:)

Apologize my trusting, but I prefer to mention this before it’s too late.

The face HUD have a zrange limit that affect to some graphics effects for some champs. Look:

If you could raise this zrange limit too, it will be great.
Again, if is very annoying all that I’ve requested, is no problem, forget it.

Sorry for request too much on this.
And thanks for your patience.

The head model on HUD is in a small 3D scene. So that line you drew is likely the edge of the scene bounds not znear related. But yeah, it might be nice if it was fixed.