Commit graph

140 commits

Author SHA1 Message Date
Jaime Moreira
9eca08fd92 Faster "weapprev" and "weapnext" behavior
These commands can now "count" how many times they have been called,
similar to how "cycleweap" operates after #865.
This allows for changing to different weapons, instead of just going
"one down" or "one up".
New cvar "g_quick_swap" allows to enable/disable this behavior.
2023-12-07 23:57:19 -03:00
Denis Pauk
96b4037ac7 Merge remote-tracking branch 'yquake2/master' 2023-10-20 22:53:04 +03:00
Jaime Moreira
fa218c9f4c Fixed gl1_overbrightbits limiter
Allows values between 0 and 4. Updated documentation.
2023-10-18 20:35:51 -03:00
Denis Pauk
c91dc0b9b2 Share R_PushDlights between all renders 2023-10-14 02:08:30 +03:00
Denis Pauk
edfd93802b sync usage r_dynamic and r_dynamic 2023-10-07 18:08:33 +03:00
Denis Pauk
c916e56d2d Reuse r_showtris in renders 2023-10-02 22:37:35 +03:00
Yamagi
fe715f3d76 Document vid_pauseonfocuslost. 2023-09-16 16:36:19 +02:00
Jaime Moreira
9821c4b0a2 Show correct replacement for gl_lightmap cvar
Typos corrected
2023-08-26 19:18:24 -04:00
Jaime Moreira
a94e9dca81 Snappier "g_swap_speed" behaviour
Player is no longer forced to go through the last frame of activation
or deactivation of a weapon before changing its state.
2023-06-29 11:14:58 -04:00
Jaime Moreira
c5e2d51fd7 Cheat cvar "g_swap_speed" implemented
Allows to skip frames of "putting down weapon" and
"raising weapon" animations, speeding them up.
2023-06-28 15:28:40 -04:00
Yamagi
a5560ff3a2 Implement high dpi awareness into the client and all renderers.
Over the last years high dpi displays became increasingly popular. We
already implemented very basic high dpi support for Windows several
years ago by setting the "please don't scale us" option. Linux (and
all other unixoid platforms) hadn't a real understandig of high dpi
and everything involved until the advent of Wayland and finally the
*fractional-scale-v1* protocol last autumn.

Since then SDL (even bevore the protocol was finalized) and all three
common Wayland compositors (Gnome, KDE and wlroots) have grown support
for the protocol and are now high dpi aware. In a high dpi aware world
the choice is scale yourself or get scaled by the compositor. The later
option isn't so good for fast paced games like Quake II, it introduces
blur and slugishness. Therefore implement hig dpi awareness through SDL.

This isn't perfect right now:
* SDL is still getting high dpi awareness fixes with every release. High
  dpi awareness in YQ2 is currently limited to at least SDL 2.26 and we
  may rise the required version even more if necessary.
* There are stll bugs in the compositors. For example Gnome 44.1 has a
  tedency to misscalculate the space occupied by the fullscreen window,
  the game ends up wit a white bar on top. sway even misscalculates
  some scaling factors: https://github.com/swaywm/sway/issues/7463
* SDL hasn't got a reliable way to get the real non scales desktop
  resolution.

Because of this:
* High dpi awareness is currently restricted to Wayland. Let's get one
  platform right before we implement it for everything else.
* It's hidden behind `vid_highdpiawareness` and disabled by default.

High dpi awareness is implemented by setting `SDL_WINDOW_ALLOW_HIGHDPI`
on the window. After the window and rendering context are created
`SDL_GL_GetDrawableSize()` or `SDL_GetRendererOutputSize()` are used
to query the actual drawable size and the internal representation is
overwritten with it.

This would scale the fullscreen window over the full screen, no matter
what resolution was selected. Some work arounds are implemented to
(mostly) keep the old behaviour were resoltions lower than the desktop
resolution weren't scaled. There is one inconsistency: While the non
high dpi aware soft renderer always scaled over the full screen, the
high dpi aware variant doesn't. This is a restriction by SDL Renderer.

Setting native fullscreen was broken before when running on high dpi
displays and it's not fixed. This is caused by SDL being unable to
determine the real resolution (or whatever the compositor thinks the
real resolution is). Depending on the compositor or if the client is
high dpi aware the correct resolution must be set by hand **or** auto
setting with `r_mode -2` must be used. Resolution detection was switched
to `SDL_GetCurrentDisplayMode()` because it's somewhat less problematic
than `SDL_GetCDesktopDisplayMode()`.

The renderer API was extended by one function pointer `*GetDrawableSize`
used to communicate the actual drawable size between renderer and
client. The API version was bumped to 6. I'll fix ref_vk before pushing
this change to master.
2023-05-14 09:44:23 +02:00
David Carlier
f394209c75 introduces a new cl_unpaused_scvis cvar to unpause the cli. 2023-01-08 10:14:09 +00:00
Yamagi
6c18d819d3
Merge pull request #947 from devnexen/sound_pause_option
Introduces new cvar cl_audiopaused to control if the audio loop
2023-01-08 10:45:55 +01:00
David Carlier
7616880b96 Introduces new cvar cl_audiopaused to control if the audio loop
ought to go on or not when the game pauses.
2023-01-07 20:16:24 +00:00
Denis Pauk
02358e2457 Add joy_haptic_filter description 2023-01-07 21:47:21 +02:00
Denis Pauk
633c50177a Haptic: Fix comments 2023-01-07 21:30:21 +02:00
Denis Pauk
4e36b66654 Add joy_haptic_distance cvar.
Haptic maximum effect distance value, By default this cvar is `100.0`.
Any positive value is valid. E.g. effect of shot near barrel to barrel
has 58 points.
2023-01-07 21:30:21 +02:00
Denis Pauk
e1aed62201 Haptic code cleanup 2023-01-07 21:30:21 +02:00
Denis Pauk
66523aa98e Restore haptic feedback functionality.
Rumble feedback will be default.
Checked in both modes with:
* LibSDL2: 2.24.2+dfsg-1 (debian testing)
* Microntek USB Joystick (DragonRise hid-dr.ko)
2023-01-07 21:30:21 +02:00
Yamagi
f03906e91f Explain were to get the optional monster footsteps assets from. 2022-10-09 10:46:49 +02:00
Yamagi
294c4d1175
Merge pull request #896 from protocultor/gyro_invert
Options to invert gyro axes
2022-10-08 15:08:14 +02:00
Jaime Moreira
9de55c603d Classic cvar 'in_initjoy' resurrected
Added myself to credits
2022-09-19 11:36:23 -03:00
Denis Pauk
61f4540617 Fix documentation for model preview.
All default players models have 84-94 frames for salute.
So value will be same for `cyborg`/`female`/`male`.
2022-09-18 12:39:50 +03:00
Denis Pauk
3b583a7143 Bumb game version value
New code has exported monster footsteps sounds function.

Fixes typos.
2022-09-18 12:39:50 +03:00
Denis Pauk
93c6c76b0e sound: cleanup reverb code 2022-09-18 12:39:50 +03:00
SkacikPL
66f1bc9a33 Add simple sound occusion based on YQ2 AL EFX code
Can be disabled via s_occlusion 0, strength is modified
via s_occlusion_strength (higher values are actually less occlusion).

Cherrypick of b557494e14
2022-09-18 12:39:50 +03:00
SkacikPL
cfb86acc81 game: Implement monster footsteps.
Better tracking of enemies complementing the audio changes.

Cherrypick of 74edb966a2
2022-09-18 12:39:50 +03:00
Yamagi
1053b5dfb1
Merge pull request #871 from 0lvin/new_commands
Add new cheats spawn commands
2022-09-17 17:17:02 +02:00
Denis Pauk
5cddd2110c client: add multiplayer model preview animation 2022-09-04 23:40:55 +03:00
Jaime Moreira
c6dd713c89 Smooth rotation for Flick Stick
Added cvar to change maximum rotation angle that will be smoothed
2022-08-24 19:37:25 -04:00
Jaime Moreira
748909fd96 "Flick Stick" controller layout implementation
With southpaw version added to "sticks layout" menu
Cvar for length of stick to be considered a flick or rotation
Lacks rotation smoothing
2022-08-24 19:02:21 -04:00
Jaime Moreira
0417bc1023 Sloped axial deadzone added
2 cvars to change it, 1 per stick
Provides the "snap-to-axis" feeling of the previous axial deadzone
2022-08-24 17:48:33 -04:00
Jaime Moreira
f3fcf3fc24 Joystick handling refactored for precision
Changed 6 cvars for stick layout to 1; includes menu option
Axial deadzone replaced with radial one, 6 cvars to 2
Expo different for each thumbstick (1 cvar to 2); sliders included
Expo applied to full joystick vector magnitude, instead of per axis
Deleted "joystick_up" ("updown" function) and its sensitivity
2022-08-24 12:30:39 -04:00
Yamagi
c6f6a17176
Merge pull request #849 from protocultor/gyro_aiming
Gyro aiming
2022-06-17 13:07:25 +02:00
David CARLIER
a01309235b client download, adding two new cvar to have the ability to set
a threshold to abort the download if a certain transfer rate is too low.
Disabled by default.
2022-06-11 13:41:24 +01:00
Jaime Moreira
f12b759feb Gyro aiming configuration cvars
Cvar to choose between "yaw" (0) or "roll" (1) axis of the controller
to turn (change your yaw) in-game.
Cvars to change pitch and yaw gyro sensitivities.
Updated cvar documentation with new section "Game Controller".
2022-06-07 09:34:45 -04:00
Daniel Gibson
ae4388abed Doc: Make busywait 0 sound a bit less scary
As far as we know it's mostly a Windows-only problem, where
(especially in power-saving modes) sleeping can be very imprecise.
2022-05-11 17:44:57 +02:00
Daniel Gibson
e3aa1010f9 doc/040_cvarlist.md: improve documentation of cl_async etc
to reflect reality, including the latest changes
2022-05-11 02:02:46 +02:00
Daniel Gibson
ef7ba41932 Update documentation for GLES3 and gl3_usefbo 2022-04-27 00:33:46 +02:00
Jaime Moreira
db0e643419 Load gamecontrollerdb.txt for SDL2 joy mappings 2022-04-16 01:37:15 -04:00
Jaime Moreira
fadb281ec9 Added cvar to define SDL gamepad's 'Back' button 2022-04-06 22:15:14 -04:00
Denis Pauk
c73eac63b3 soft: rename r_colorlight -> sw_colorlight 2022-03-29 22:29:28 +03:00
Daniel Gibson
b5a0050e31 Document gl3_colorlight and gl_texturemode 2022-03-26 19:48:33 +01:00
Daniel Gibson
6eb9ca0f65 Add r_lerp_list and r_videos_unfiltered CVars, fix #800
r_lerp_list is to allow exceptions to r_2D_unfiltered (like for having
pixely UI in general, but filtered console background).

r_videos_unfiltered controls whether videos should be filtered or not

I also made r_nolerp_list CVAR_ARCHIVE, like users probably expect it.
2022-03-20 12:16:15 +01:00
Yamagi
7464cb7ae5 Document the HTTP downloading cvars.
For some reason I never added them to the documentation. Pointed out in
\#793, closes #793.
2022-02-26 17:34:16 +01:00
Denis Pauk
1e0d75857b Use separate r_scale8bittextures for image scale
Rename {sw,gl}_retexturing variables to r_retexturing in code.
2021-10-17 11:11:05 +03:00
Yamagi
c41e9413bb Move g_machinegun_norecoil to the appropriate section. 2021-09-28 18:40:07 +02:00
De-Seppe
b471578c3e Rename variable to conform to naming guidelines
Change the name of the cvar machinegun_norecoil to g_machinegun_norecoil to conform to the naming guidelines
2021-09-27 18:29:37 +02:00
De-Seppe
c1e0372366 Add new cvar to the documentation 2021-09-27 13:06:58 +02:00
Yamagi
1ff3760c76 Refine the g_footstep cvar.
There were complains that always generating footsteps is annoying,
because there will be footsteps while swimming or jumping. Refine
the cvar a little bit:

* `0`: No footsteps at all.
* `1`: Vanilla Quake II behavior.
* `2`: Always footsteps as long as the player has a ground entity.
* `3`: Always footsteps.

The changes the meaning of the values, `2` has become `3`.

Closes #738.
2021-08-25 18:34:24 +02:00
Yamagi
2861874da6 Small corrections to the documentation. 2021-06-03 07:24:42 +02:00
Yamagi
0838faf120 Remove ref_vk from the documentation. 2021-05-28 09:32:42 +02:00
Yamagi
ee945625d3 Add a cvar g_commanderbody_nogod to make the com. body destructable.
The commanders body entity is special, because it's spawned in god mode.
That's no problem in the baseq2 and addons campaigns. But it may break
some custom maps and prevents some hacks, one example is putting the
entity inside an killbox.

Submitted by Евгений T.
2021-03-31 19:28:20 +02:00
Yamagi
635f6ffb16
Merge pull request #685 from BjossiAlfreds/bad-triggered
Console warning and fix for triggered monsters with no targetname
2021-03-31 10:07:06 +02:00
BjossiAlfreds
fe517fd755 Console warning and fix for triggered monsters with no targetname 2021-03-28 17:16:36 +00:00
Ricardo Garcia
f601ffddfc Use the real anisotropic filtering value in Vulkan
When creating the Vulkan texture samplers, make them have the real
anisotropic filtering value selected by the user. This has two side
effects:

* We no longer need two sets of texture samplers in Vulkan (one with and
  another one without anisotropic filtering).

* The anisotropic filter value in Vulkan is no longer an on/off switch
  and we use the value as chosen by the user.
2021-03-21 11:08:09 +01:00
Ricardo Garcia
15e9c5499d Remove documentation for nonexisting vk_aniso variable 2021-03-21 00:33:16 +01:00
Yamagi
f1b6b82721 Pull the major release card and switch the semantics of vid_fullscreen
One of the most common bug reports is, that the fullscreen mode doesn't
behave like users expect. This is caused by `vid_fullscreen 1` setting
desktop fullscreen mode (a fullscreen windows) and not the native
fullscreen mode. This commits switches the semantics:

* 1: Native fullscreen, like Vanilla Quake II.
* 2: Desktop fullscreen.

With this alt-tab reverts to native fullscreen. While at it improve the
documentation, suggest setting `r_mode -2` when using `vid_fullscreen
2`. Change the menu strings to make things clearer, set `r_mode -2` when
selecting 'fullscreen window' in the menu.

I pondered several other options:

* Introducing a second cvar for the desktop fullscreen, like we did in
  dhewm3. This has the problem, that in Quake II vi_fullscreen is
  special and used to communicate changed to the renderer configuration
  between the client and renderer. A second fullscreen cvar would
  complicate this already shaky mechanism even more.
* Setting `r_mode -2` when `vid_fullscreen 2`. This might not be what
  the user wants and causes problems when we're unable to get the
  desktop resolution.
2021-03-10 10:30:21 +01:00
Yamagi
ae9a248e9e Add a cvar g_footsteps to control the generation of footstep sound.
1: The Vanilla Quake II behaviour, footsteps are generated when the
   player is faster than 255.
0: Footstep sounds are never generated.
2: Footstep sounds are always generated.

Defaults to `1`, cheat protected to `1`.

Closes #666.
2021-03-02 15:08:23 +01:00
Yamagi
9a17eb9ac3 Make limiting power screen sounds to 16 optional.
This was added in e3e5bd1 as a work around for some openal-soft bug.
When too many audio samples got played at the same time, the global
volume dropped. This was fixed in openal-soft 0.19.0, released more
than two years ago. We're keeping the work around, because some
distros may still ship with buggy openal-soft versions and some
players may like the changed behavior. It's disabled by default.
2021-01-30 13:51:02 +01:00
Yamagi
449776d3f6
Merge pull request #654 from 0lvin/ref_vk
Sync variable names for msaa, retexturing and anisotropic filtering
2021-01-22 12:27:18 +01:00
Denis Pauk
46c24d4d18 Sync variable names for msaa, retexturing and anisotropic filtering #646 2021-01-19 21:39:44 +02:00
Hugo Locurcio
08d59ee8e8
Rename cl_anglekicks to cl_kickangles for consistency with Q2PRO 2021-01-18 04:41:57 +01:00
Yamagi
2fae58d56b Implement singleplayer in the dedicated server.
When set to `1`, both `deathmatch` and `coop` are forced to `0`.
`maxclients` is forced to `1`. This makes it possible to play single
player campaigns over the dedicated server.

Closes #614.
2021-01-17 11:07:46 +01:00
Yamagi
f01998896f Hide the fix for sky surfaces missused for indoor lighting begind cvar.
All renderers had the fix, but it was only optional in the GL renderers.
And there it was missimplemented, cvars must be defined in the renderers
main() function. Otherwise they aren't available at startup.

Rename gl_fixsurfsky to r_fixsurfsky, implement it for all renderers and
enable it by default.
2021-01-17 10:25:09 +01:00
Yamagi
531cbdcdae Mention the Vulkan renderer on all appropriate places. 2021-01-17 10:05:04 +01:00
Yamagi
a9914efde7 Implement vk_underwater, make the underwater warp effect optional.
This was requested in #505.
2021-01-13 21:46:15 +01:00
Yamagi
023a012e82 Change the hyperblaster back to yellow for Vanilla Q2 lightning.
In Vanilla Q2 (without any point releases) the hyperblaster projectiles
emitted white light. In the 3.21 sources it's yellow. It likely changed
in on of the (early) point releases. Change it to yellow, the code now
matches 3.21.
2021-01-11 07:34:30 +01:00
Yamagi
462a0ddff5
Merge pull request #636 from rg3/vk_resolution_scaling
Add resolution scaling to Vulkan renderer
2021-01-10 19:02:51 +01:00
Yamagi
a98d533ae1 Add cl_r1q2_lighstyle, set to 0 for Vanilla Q2 dlight colors.
Since the first release Yamagi Quake II used the more fanzy R1Q2 colors
for some dynamic lights:

* In R1Q2 the rocket has orange light, matching the color of the fire
  trail and the generic explosion. Vanilla Quake II had yellow light,
  the same as the blaster and several muzzle flashs.
* In R1Q2 hyperblaster projectiles are emitting yellow light, like the
  normal blaster. That matches the projectile colors, the muzzle flash
  and the effect when hitting a wall. And it's more logical, since the
  hyperblaster is just a blaster on steroids. Vanilla Quake II had white
  / uncolored lights.

Add an option to revert to Vanilla Quake II colors, leave the R1Q2
colors as default. Closes #640.
2021-01-10 18:30:49 +01:00
Ricardo Garcia
930872b358 Add resolution scaling to Vulkan renderer
This commit adds a new cvar called vk_pixel_size that represents how big
pixels should look in the rendered world in order to simulate lower
screen resolutions. With its default value of 1 everything looks normal,
but with bigger sizes (e.g. 4) the rendered world starts to look
"pixelated" due to pixels appearing bigger.

To implement the effect, the viewport and scissor are modified when
drawing the world so the rendering results cover a smaller area in the
top-left corner of the image.

The post-processing fragment shader is used to scale the image back to
the swapchain size before drawing UI elements on top of it.

The UI is not affected by this change, so the existing UI scaling
options continue to work as before with no changes, adding some
flexibility to the mix.

Related to feature request #588.
2020-12-24 10:14:39 +01:00
Denis Pauk
b7bdd0be72 Add vk_nolerp_list support 2020-12-12 14:45:04 +01:00
Denis Pauk
539fea96bb add vk_retexturing force flag 2020-12-12 14:45:04 +01:00
Denis Pauk
8e5f68bb68 Remove vk_round_down as regressed visual quality 2020-12-12 14:45:04 +01:00
Denis Pauk
832d9666d4 Merge vk_point_particles with vk_particle_square to vk_custom_particles 2020-12-12 14:45:04 +01:00
Denis Pauk
a69c97f046 Add vk_particle_square support 2020-12-12 14:45:04 +01:00
Denis Pauk
2add32b5a8 Add documentation 2020-12-12 14:45:04 +01:00
Denis Pauk
db20a6ce18 Add ioquake3 vstr/nextdemo support 2020-10-06 23:38:12 +03:00
Yamagi
1f3f796322 Add cl_anglekick, when set to 0 angle kicks are ignored.
Angle kicks are used for weapon recoil, damage kicks and the like.
Setting the `cl_anglekicks` to `0` ignored them, they're read from
the network but not displayed. The cvar is cheat protected, it's
reset to `1` on server connect.

Rquested by Martin via mail.
2020-08-17 14:18:51 +02:00
Daniel Gibson
fd0c058b2e Implemented coop_elevator_delay cvar (for func_plat)
In coop it's often hard to get on the same elevator together, because
they're immediately triggered once the first player steps on it.
This cvar sets a delay (1 second by default) for the elevator to wait
before moving, so other players have some time to get on it.
If you like elevators/platforms that suck, just set it to `0` :-P

Currently only used in func_plat, if it turns out that other entities
are used for automatically triggered platforms, we'll have to adapt
those as well (I guess wait_and_change() is generally useful for that).

We're not bumping the savegame version because they should only break in
an uncommon corner case: *Coop* savegames created with clients including
this change will not work on older clients - SP savegames are not
affected and old savegames on new clients also still work.
2020-08-10 14:27:35 +02:00
Yamagi
1a6dea5a0b Add coop_pickup_weapons, allow a weapon to be taken several times.
In coop a weapon can be picked up only once. That's annoying, because in
coop ammunition is sparse and not getting the ammunition that comes with
a weapons make things worse. When `coop_pickup_weapons` is set to `1` a
weapon may be picked up if:

1) The player doesn't have the weapon in their inventory.
2) No other player has already picked it up.
2020-08-10 13:52:33 +02:00
Yamagi
5455ffa96f s_doppler should default to 0.
The doppler effect is a game play change. And it's rather badly
implemented. Discussed in yquake2/xatrix#51.

Closes yquake2/xatrix#51.
2020-04-21 13:58:58 +02:00
Yamagi
beadebbdec Document aimfix. 2020-04-21 13:00:00 +02:00
BjossiAlfreds
975298b3f2 Added doc entry for g_disruptor cvar in GroundZero 2020-04-21 00:28:51 +00:00
Yamagi
19214d6049 Implement adaptive vsync.
Adaptive vsync is a often requested feauture and easy to implement. Set
`r_vsync` to `2` to enable. This is untested because my system doesn't
support it.
2020-04-20 12:31:25 +02:00
Yamagi
fc99e5456f Make the gun fov optional.
Set r_gunfov to force the gun fov to be the same as the global fov.
While here finally commit somes missed parts of 50d442c.
2020-04-20 11:57:27 +02:00
Yamagi
8114748018 Document gl1_particle_square. 2020-01-12 11:05:15 +01:00
BjossiAlfreds
2b27665446 coop_baseq2 documentation added under General section in cvar docs 2019-11-04 16:40:44 +00:00
Yamagi
e3c3875bda Explain how option strings with quotation marks are given at cmd-line.
This is part of #457.
2019-10-12 16:25:19 +02:00
Yamagi
e77a8efa77 Reorder documentation files and make room for future additions. 2019-10-12 16:17:18 +02:00
Renamed from doc/04_cvarlist.md (Browse further)