In other places I_GetEvent should be used to call the system's message pump and keep the app responsive, but all game side processing should be skipped.
Avoid passing this anywhere in the client code. It should only be set right before rendering the 3D view and the only code using the base palette should be the 3D renderer and hud_drawsprite.
Also make the palette override CVARs 3D view only in debug mode.
a boss, ensure that FinishTimer and FinishAnim are appropriately
updated. This commit bumps GameVersion.
Additionally, the set of FinishAnim to 0 in NewLevel had
to move to a different location (InitLevelGlobals2), so
it doesn't override the value stored in the saved game.
# Conflicts:
# source/sw/src/game.cpp
* Calculate game-side mousex/mousey divisions into the calculations performed in `InputState::GetMouseDelta()`.
* Fix mouse speed when `in_mousesmoothing` is true (wasn't factoring in / 3.f division used in non-true vector.
* Standard mouse forward/side movement speeds in Exhumed & SW with that of other games.
* Remove `strafeyaw` code from Duke/Exhumed/RR as it's not necessary and was leading to situations where the player would continually keep moving sideways even without input.
* Change mouse forward/side velocities to -= current value as is done with controller input and the player's angle/aim velocities.
* Convert axes in ControlInfo struct from int32_t to float as what's received from the backend.
* Remove all the scale up/down math since we don't need that with floats and replace with float constants that match old behaviour.
* Store q16mlook scaling as a constant for use with mouse and upcoming controller code.
* Add required controller code to Blood as the only game not to have working controllers.
* Fix typos in (gInput.forward > input.forward) for `ctrlGetInput()` in Blood.
* Remove use of `scaleAdjustmentToInterval()` on Exhumed and Shadow Warrior as they only process forward/side velocities within the game's ticrate.
* Repair angvel/aimvel scaling mistakes from d79a5d256d.
* Scale dyaw and dpitch by 25% for Shadow Warrior as the game runs 25% faster than the other games, leading to faster input.
This is to allow giving them a texture ID so that they can be used from ZScript which has no access to naked textures.
This also consolidates AnimTexture and VpxTexture.
* Repairs https://forum.zdoom.org/viewtopic.php?f=340&t=67239 and https://forum.zdoom.org/viewtopic.php?f=340&t=67933
* Values that come from GZDoom backend are too low to be suitable for the Build games which were dividing by 'analogExtent'.
* Remove definition of analogExtent from all games and define in inputstate.h, then define joyaxesScale as 75% of analogExtent to provide a bit of headroom and not have a scale of 1.0 be full speed.
* Invert the returned results of GetAxes() as the returned floats are reversed for build games.
* Leverage scaleAdjustmentToInverval() on game-side code to consistently scale the input irrespective of frame rate, vsync etc.
(e.g., beginning to jump, or landing on ground);
Reproduced with the input being tied to framerate
while SO interpolation is toggled on.
This involves the following modifications:
- PF2_INPUT_CAN_TURN and PF2_INPUT_CAN_AIM are now additionally set
from various DoPlayerBegin* functions, allowing the player to continue
turning/aiming as usual (right before the next call to domovethings),
even in specific instances of player action changes.
- If PF2_INPUT_CAN_TURN/PF2_INPUT_CAN_AIM was set before and
after calling pp->DoPlayerAction from domovethings altogether,
ensure that the player's oq16ang/oq16horiz is updated by
making an appropriate call to DoPlayerTurn/DoPlayerHorizon. This
is done in case a call to DoPlayerTurn/DoPlayerHorizon is missed.
This change is not applied for a dead player, though.
in 1a3c9e3a15ba788607dfd96ebcc75a2198be6d69 was a mistake.
The interpolation should still apply, albeit not while
the viewing angle is changed via the player's own input.
We should also continue interpolating in coop view.
interpolation of player turning/aiming/movement, while being carried
by a sector object, without SO interpolation. This is a continuation of
73a0aa394e906a65633d61f3c749c9b9b7e66aaa and bf31bc2987a3eccd31d343622327bd4ee0f9c5a1,
aiming to fix a jitter in case the player is continuously
getting pushed by a wall (e.g., on the boat in level 5).
Basically, this moves the relevant assignments from track.cpp:MovePlayer
and MovePoints to player.cpp:DoPlayerMove. Unless a call to one of these
functions has been missed, pushwall and clipmove can be called from
player.cpp in the following instances, which should be covered:
- Via DoPlayerMove, which is the function getting the fix now.
- Via DoPlayerSlide, which is called in the beginning of DoPlayerMove.
- Via DoPlayerCurrent when called from DoPlayerCrawl/DoPlayerWade,
followed by DoPlayerMove.
- Via DoPlayerCurrent when called from DoPlayerDive,
followed by DoPlayerMove if the player doesn't stop diving.
# Conflicts:
# source/sw/src/track.cpp
(with SO interpolation turned on). It would be nicer to have something
better structured than the given hack, but this currently seems to work,
while not breaking the sprites on the boat in the beginning of level 5.
of change that camq16ang/camq16horiz gets. Such an update is possible
after making sure that UpdateInputs (faketimerhandler) is
never called from domovethings.
# Conflicts:
# source/sw/src/game.cpp
and ready2send and the call to timerUpdateClock, which are now done
before calling UpdateInputs itself from RunLevel.
# Conflicts:
# source/sw/src/network.cpp
from EDuke32-OldMP. Main difference from EDuke32-OldMP is that this is
done even while staying in the menu; Behaviors will otherwise break.
We should also call timerUpdateClock() before the loop, especially
after removing the call to this function from faketimerhandler soon.
of the secret rotating pillar in level 1 with SO interpolation.
The drill in level 2 is also covered. So far, SetVatorActive seems
to be the only place where interpolation of ceiling/floorz
may be set, outside of the SO interpolation code.
of sector objects as whole groups of points and sprite angles.
The following goals are intended to be achieved with this code:
- Make it easy to let the user toggle sector object interpolation.
- Interpolate the angles of sprites carried by sector objects.
- Use the right amount of samples for interpolating a sector object,
depending on the players' locations, as done in the checks within
DoSector. Unfortunately, modifying DoSector itself to
unconditionally call MoveSectorObjects(sop, synctics) technically
changes the way sectors move (in the logical sense), and was
found out to make a specifically constructed user map unbeatable.
- Make it easy to disable interpolation of a whole sector object in
case of a need. This is especially important if such an object
is controlled by a player in multiplayer, mostly since this
isn't compatible with the way player prediction is working.
A known issue, which also applies to existing settings like the voxel
toggle, is that its value gets written to the saved game, and when such
a game is loaded, the its value gets overwritten by the one in the
saved game. Options should move to settings.cfg later, anyway.
similar manner to what's done in Duke3D (with the addition of the angle).
There seem to be some jitters with this, mostly in Master/Slave mode.
Decreasing PAKRATE in mmulti.cpp might also increase the frequency
of this occuring in Peer-2-Peer mode.
less dependent on the frame rate.
It would probably be better to update this from the game loop side,
like in Duke3D, but it's still better than the preceding situation.
DoPlayerTurn/DoPlayerHorizon while input is tied to the frame rate:
Introduce the new player flags PF2_INPUT_CAN_TURN and PF2_INPUT_CAN_AIM.
Set PF2_INPUT_CAN_TURN if DoPlayerTurn can be called outside
of getinput. Similarly set PF2_INPUT_CAN_AIM if DoPlayerHorizon
can be called in this manner.
getinput will only call DoPlayerTurn/DoPlayerHorizon
if PF2_INPUT_CAN_TURN/PF2_INPUT_CAN_AIM is set. These flags are reset
right before the call to the player's current DoPlayerAction function.
For one example in which this assists, it's not always the
case that DoPlayerDeathFollowKiller may call DoPlayerTurn,
even if we assume that pp->input.q16angvel is never zero.
This fixes truncations of q16ang in MovePlayer. One known
fixed issue is a minor micro-shaking effect, reproduced
while standing on a non-moving SO (e.g., the bus in level 1).
The latter is also related to the use of camq16ang.
Based in idea on patch from mjr4077au.
is non-null seems to resolve the newly introduced interpolation
issue for looking up/down while controlling a sector object.
We can also remove the PF_DEAD test, since
game.cpp:getinput should lock any kind of aiming.
src/src/game.cpp:getinput: We now, however, need to further
lock turning here while controlling a sector object.
sector. This re-introduces the angle interpolation in drawscreen
while sector object interpolation is in use.
A side-effect of this is that looking up/down is now less smooth
while controlling a sector object (e.g., a turret).
PACKED macro. This is more consistent with the current Duke3D codebase,
and further fixes build with older versions of MinGW GCC, in which
attribute packed is broken without specifying -mno-ms-bitfields.
draw.cpp: Fix the lack of interpolation while walking on a sector
object, like the bus roof or the floor of the train in Seppuku Station.
track.cpp: Make sure the player's location and angle aren't mistakenly
interpolated while standing on a moving sector object as a consequence.
While it is understandable that avel and horz came from Duke3D,
having both q16horiz and q16horz in the updated SW_PACKET struct
can be confusing, and the alternative notation is more consistent
with the original struct field names of angvel and aimvel, as well
as the differing uses of the name angvel still present in player.cpp.
for them to modify the player's camq16ang/camq16horiz field
instead of q16ang/q16horiz. Additionally, pass to them the
change in angle/horiz via a parameter, as an alternative
to direct access to the corresponding player input field.
Add the camq16ang and camq16horiz fields to the player struct.
With the exception of DoPlayerTurn and DoPlayerHorizon, whenever
code in player.cpp updates player's q16ang/q16horiz, also write
the updated values to camq16ang/camq16horiz. These variables'
preceding values are never used in these functions.
related to the definitions of RANDOM_NEG in bunny.cpp, ripper.cpp
and ripper2.cpp. Do so in a way that isn't re-introducing compiler
warnings. This partially fixes compatibility with demos made for SW 1.2.
Additionally, replace the 3 separate definitions of RANDOM_NEG
with a common one within game.h.
From-SVN: r8798
This reverts commit e878c5bab8.
Revert "SW: Use Q16.16 for horiz."
This reverts commit f07a0ae01e.
Revert "SW: Use Q16.16 for angle."
This reverts commit 1ecc74c2ec.
Revert "SW: Minor repairs for Q16.16 implementation."
This reverts commit d78d046bad.
Revert "SW: Process input at frame rate."
This reverts commit c162014dab.
Revert "SW: Amendments to accommodate changes in master."
This reverts commit eaa51138ad.
Revert "SW: Fix incorrectly declared function input type."
This reverts commit 1cdd5b08d8.
Revert "SW: Amend scaleAdjustmentToInterval() with correct value for SW."
This reverts commit d4dd737cd5.
Revert "SW: Refinements to new input code."
This reverts commit 5ebc65a1fb.
Revert "SW: Adjust look and snap up/down keys and slightly tune PLAYER_TURN_AMOUNT."
This reverts commit 2852536dbf.
Revert "SW: Get PLAYER_TURN_SCALE to be just right."
This reverts commit 4630c8a0b7.
Revert "SW: Make map follow mode work better."
This reverts commit 8e94c48eff.
Revert "SW: Remove line accidentally left from 'MoveScrollMode2D()'."
This reverts commit 5db8047b41.
Revert "Fix multiplayer desync after the change to q16 angle and horiz."
This reverts commit 3bc46078b8.
Revert "SW: Revert commented out horiz->q16horiz renames in DSPRINTF strings"
This reverts commit 537313f620.
Revert "sw/src/draw.cpp:drawscreen: We can set the pp->si* fields just once,"
This reverts commit d2e9595980.
Revert "sw/src/game.cpp:LoadLevel: Rename q16ang -> ang"
This reverts commit a178961a3e.
Revert "SW: Minor tweaks."
This reverts commit 377ba68344.
Revert "SW: Further refine turning and optimise horizon adjustment."
This reverts commit 039022d9ac.
Revert "SW: Don't process input at frame rate if ScrollMode2D is true."
This reverts commit 1aa1e62c4d.
Revert "SW: Use a bit more Q16.16 in places."
This reverts commit 40ca656f38.
Revert "SW: Use the old interpolation path in drawscreen if player is dead"
This reverts commit 2d73466425.
Revert "SW: Smooth out 180 degree turn landing and replace some fix16_min/max with fix16_clamp."
This reverts commit 0996e87f79.
Revert "Change Next/Previous Weapon button handling for Shadow Warrior."
This reverts commit f6b8ca6a22.
Revert "SW: Make "Center_View" key return smoothly."
This reverts commit 23c401fbc2.
Revert "SW: Use the old interpolation path in drawscreen if player is dead"
This reverts commit 43ec16eb55.
Revert "Interpolation fixes for SW:"
This reverts commit ac8a7ecfbd.
Revert "SW: Reset the number of interpolations on level load"
This reverts commit 04bf8499e7.
Revert "Another change modifying saved game format in SW:"
This reverts commit e80888523e.
Revert "SW: Interpolate sector objects in non-demo, single player games."
This reverts commit 996ab77cf4.
Revert "- fixed merge errors in SW."
This reverts commit b8cfa94568.
Revert "- fix interpolation stutters when opening console for SW."
This reverts commit 99fdbfb6cb.
Revert "- reset buttonMap button states after returning from pause for SW (stops keys acting stuck down if down prior to pausing)."
This reverts commit 693b6955da.
Revert "SW: fix stupid input scaling bug"
This reverts commit 1c79e6e17c.
Revert "SW: Make vehicle input better."
This reverts commit 670a53c402.
Revert "SW: Change fix16_from_float() to fix16_from_int() that was changed in 4630c8a0b7 but should have been reverted in 377ba68344e34495638c6fa7685ff78c9a0ed6f8."
This reverts commit 423c9da071.
Revert "SW: Remove ScrollMode2D extern boolean and move into PLAYERp struct."
This reverts commit 31eb55c1fa.
- Define new boolean 'on_vehicle' in PLAYERp struct for use with interpolating while on vehicle and other checks.
- Move horizon code back into separate DoPlayerHorizon() function. Adjusting horizon while in vehicle must come at the end of the DoPlayerOperate*() function.
- Make DoPlayerHorizon() accessible in game.cpp.
- Change code in DoPlayerHorizon() to process according how 'pp->on_vehicle' is set.
- Make scaleAdjustmentToInterval available outside of getinput().
- Don't process input at frame-rate while on a vehicle. Vehicle code is too difficult to process outside of the game's clock.
Partially based on NY00123's upstream implementation of tying player input to frame-rate.
What 43ec16eb55 intends to do was already done via 2d73466425, however I applied the if statement in the opposite order so when it was cherry-picked again, the pathway was actually reversed - interpolating when alive and not when dead.
Rather than re-apply the opposite order, I've made the if statement match upstream for more consistency and to avoid further conflicts.
Let's see if this is breaking anything.
# Conflicts:
# source/sw/src/draw.cpp
# source/sw/src/game.cpp
# source/sw/src/game.h
# source/sw/src/interp.cpp
# source/sw/src/track.cpp
draw.cpp: Fix the lack of interpolation while walking on a sector
object, like the bus roof or the floor of the train in Seppuku Station.
track.cpp: Make sure the player's location and angle aren't mistakenly
interpolated while standing on a moving sector object as a consequence.
# Conflicts:
# source/sw/src/track.cpp
- Inline function returns a double, therefore we should use it and not potentially truncate the mantissa.
- Use divisors to get true numbers of some floats (3.333 -> 10/3, etc).
- Remove a few brackets/parentheses where possible from what are already exceedingly bracketed lines.
Since the same word gets used in text messages and local variables in the game code it is easier this way to search for it and facilitate its transition to the translation table management in PaletteContainer.
- Move DoPlayerTurn() into getinput(). Vehicle code remains external for now.
- Remove horizAdjust boolean and always do horizon code in getinput(). Eliminates single off frame at start of a new level until DoPlayerMove() is called at least once.
- Input was too fast following input code changes.
- Speed of input can now be changed with toggling the run key.
- Remove function 'MoveScrollMode2D()' and incorporate into 'getinput()' to reduce code duplication.
- Store map follow coordinates in PLAYERp struct and remove old globals.
- Original value was 12 and was far, far too high following the Q16.16 implementation.
- Value of 3 is too fast.
- Value of 2 is too slow.
- Value of 2.4 (12 / 5) feels just right.
- videoNextPage() moved to after restoring interpolations.
- Properly use Q16.16 in as many places as possible. This fixes the angle/X-axis issues.
- Remove unnecessary call to timerUpdate() in main loop, only needs calling once and is called by eventhandlers().
as done in r8766, since this breaks status bar output in tiled
overhead map with Polymost. Do add comment about this for now.
git-svn-id: https://svn.eduke32.com/eduke32@8779 1a8010ca-5511-0410-912e-c29ae57300e0
# Conflicts:
# source/sw/src/draw.cpp
This removes the last active use case for the software renderer and allows rendering the camera views at a higher resolution.
For Shadow Warrior this necessitated a split of JS_DrawMirrors, because it processed cameras and mirrors in the same loop which cannot be done with the hardware renderer.
later. This also turns out to fix a Polymost-specific bug revealed
in SVN r8711. Further remove a call to PicInView which does nothing.
git-svn-id: https://svn.eduke32.com/eduke32@8766 1a8010ca-5511-0410-912e-c29ae57300e0
params, but leave them for documentation. Note that currently, the
only use of ComboMissileSeek is in the saveable_weapon_code array.
git-svn-id: https://svn.eduke32.com/eduke32@8698 1a8010ca-5511-0410-912e-c29ae57300e0
the functions' signatures (often due to being used as callbacks/hooks)
git-svn-id: https://svn.eduke32.com/eduke32@8696 1a8010ca-5511-0410-912e-c29ae57300e0
# Conflicts:
# source/sw/src/jnstub.cpp
# source/sw/src/menus.cpp
# source/sw/src/panel.cpp
# source/sw/src/text.cpp
with (possible) side-effects is written to an unused var.
git-svn-id: https://svn.eduke32.com/eduke32@8688 1a8010ca-5511-0410-912e-c29ae57300e0
# Conflicts:
# source/sw/src/console.cpp
# source/sw/src/jnstub.cpp
# source/sw/src/save.cpp
# source/sw/src/sounds.cpp
# source/sw/src/swconfig.cpp
For ambient sounds that can be cleanly restarted a new 'transient' flag was added so that these do not get written out.
Tested on SW so far, other games yet to do.