Commit graph

752 commits

Author SHA1 Message Date
Christoph Oelckers
f4fff5ee30 - moved sync structure into the playerstruct for easier maintenance. 2020-09-23 18:18:23 +02:00
Mitchell Richters
8690c633d8 - Blood: Add extra call to inputState.ClearAllInput() in StartLevel(). 2020-09-24 00:20:40 +10:00
Mitchell Richters
64113f8f9c - Blood/Duke/SW: Smooth out player's zpos adjustment while in 3rd person view. 2020-09-23 23:12:59 +10:00
Mitchell Richters
ce7af5fe0e - Duke: Fix security cameras skewing over time.
* Fixes regression from e1ee9bc83c. +='ing the angle by 16 gave a noticeable hiccup, but was keeping the poor math before in-check so the angle didn't drift.
* Using more temp data fields in hittype, properly define a min/max using the initial camera angle and the hitag which is conveniently the camera's viewing arc.
2020-09-23 18:31:12 +10:00
Christoph Oelckers
5784ff6ef7 - fixed damage type of incinerator's fireball.
A one-liner, what else... :D
2020-09-23 07:37:08 +02:00
Mitchell Richters
470f481619 - Duke: Simplify entire camera angle setup. 2020-09-23 15:34:03 +10:00
Mitchell Richters
ed9c8af82f - Duke: Move changes performed in 53038e1b29 from FinalizeInput() to processInputBits(). 2020-09-23 15:03:34 +10:00
Mitchell Richters
53038e1b29 - Duke: Don't allow looking left/right when on a security camera screen. 2020-09-23 15:00:33 +10:00
Mitchell Richters
88608e0682 - Duke: Interpolate camera sprite angle in animatecamsprite(). Fixes a "fixme". 2020-09-23 14:42:33 +10:00
Christoph Oelckers
5e6317b8b9 Merge remote-tracking branch 'remotes/Github_private/Blood_InputReworking' 2020-09-22 23:32:28 +02:00
Christoph Oelckers
2a2209b085 - cleanup and minor fixes. 2020-09-22 23:07:11 +02:00
Christoph Oelckers
880b811e0d - rewrote map loader to work independently of data structure sizes.
This is needed to extend a few fields that are too narrow - e.g. the texture offset fields have no room for interpolating scrolling textures.
Blood not done yet, will also need to be changed to get rid of the limits.
2020-09-22 22:40:53 +02:00
Mitchell Richters
ac635ebd0f - Blood/RR: Replace a few playerSet*() calls with playerAdd*(). Because the setters continually set until target is reached, can cause some perceivable smoothness issues if ticker re-targets's player's angle/horizon before input code has reached target. 2020-09-22 22:50:27 +10:00
Mitchell Richters
d40a2d3e95 Merge branch 'back_to_basics2' into Blood_InputReworking
# Conflicts:
#	source/blood/src/hudsprites.cpp
#	source/exhumed/src/status.cpp
#	source/games/duke/src/game_misc.cpp
#	source/sw/src/draw.cpp
2020-09-22 07:34:39 +10:00
Mitchell Richters
9859571ded - DrawCrosshair(): Factor in Blood's adjustable horizon which defaults to 90.
* Fixes https://forum.zdoom.org/viewtopic.php?f=340&t=69920.
2020-09-22 07:29:52 +10:00
Mitchell Richters
59e4fae064 - Game input: Fix miscellaneous issues.
* Duke/RR: Fix `SB_CENTERVIEW` not clearing while `cl_syncinput 1`.
* Duke/RR: Remove superfluous call to `apply_seasick()`.
* RR: Change two calls from `playerSetAngle()` to `playerAddAngle()` Updated version of `playerSetAngle()` doesn't stop setting angle until target is reached, a bit too strict for this and compromised vehicle turning.
* `applylook()`: Remove dead flag. Was only used with Duke, no other game called the function when dead anyway. Since the input helpers are processed outside of `applylook()` now this is not needed.
* `applylook()`: Extend function with a bit of commentary.
2020-09-21 17:12:53 +10:00
Mitchell Richters
f806cdcec6 - Blood/Duke/RR/SW: Unify the player's angle/horizon helper functions. 2020-09-21 17:12:51 +10:00
Mitchell Richters
7bf1cacc7f - Blood/Duke/RR/SW: Unify the player's angle function.
* For Blood/SW, exposes `SB_LOOK_LEFT`/`SB_LOOK_RIGHT` to games, hooking up `q16look_ang` and `q16rotscrnang` within.
* For SW, use Duke & Blood's return to center function and remove `PF_TURN_180` bit.
* For RR, replace a few misused bits with some bools inside of `player_struct`.
* Since bulk of functionality is sourced from Duke (30Hz), apply proper scaling so SW speed matches (40Hz).
2020-09-21 17:12:26 +10:00
Mitchell Richters
0ab3b33a6c - Blood/Duke/RR/SW: Unify the player's horizon function.
* For Duke/SW, we continually apply `SB_CENTERVIEW` only if it was previously a toggled action, similar to Blood.
* For SW, we remove two SW-specific bits (`PF_LOCK_HORIZ` and `PF_LOOKING`) that are no longer needed.
* For Duke, we remove `return_to_center` and just use the `SB_CENTERVIEW` action bit as required.
* For `sethorizon()`, feature set and adjustment speeds are an averaged out accumulation across Duke/SW:
** GameTicRate is factored in for adjustment decisions to provide consistency for SW being the faster game.
** Adjustment amounts are half way between Duke/SW.
2020-09-20 20:01:36 +10:00
Mitchell Richters
1900cf1fcc - Move Duke's getincangle() function to the backend, create Q16.16 variant (getincangleq16()) and replace Shadow Warrior's discrete implementations shared versions.
* Need SW's input helpers available for Blood but therefore also need an angle delta function that does not seem to exist in Blood.
* Realise that gamecontrol.h/cpp might not be the most appropriate place, but it's a shared location and these will go into binaryangle.h when its utilisation can be more realised.
* Because SW's logic was reversed, in that param #1 was the new angle and param #2 was the current, all calls have been reversed.
* By happenstance, also fixes an issue with multiple 180° turns in quick succession.
2020-09-20 16:21:13 +10:00
Christoph Oelckers
af298411df - added widescreen titlepic for Duke Nukem 3D:
Also made some tweaks to the intro sequence drawer so that it recognizes image formats not depending on the game palette.
2020-09-17 23:20:50 +02:00
Christoph Oelckers
f5d14f826a - added the SHOOT event and fixed some issues with poor code generation for the game data accessors.
They created different code depending on the passed index, this was changed to always emit the optional parameter, even when not needed, so that the interpreter does not need to second-guess.
2020-09-17 23:06:54 +02:00
Christoph Oelckers
8fa5d3d9d2 - added the remaining CON features from EDuke 2.x
Not everything will do something, though. This was some incredibly careless code operating without a safety net allowing uncontrolled write access to the map structure.
Most of the critical fields have been made read-only, which has been the only mode of access in the mods I checked.

Note that this does not enable scripting of the weapon sprite drawer, only the gameplay related features were done.
2020-09-17 23:06:54 +02:00
Mitchell Richters
e1ee9bc83c - Duke: Fix camera advancing angle by 16 instead of 8 under circumstances. 2020-09-17 18:31:09 +10:00
Christoph Oelckers
6776508239 - widescreen asset setup and consolidation of .def file loading. 2020-09-16 19:13:06 +02:00
Christoph Oelckers
2095e9e3c6 - code changes for last commit - they were not picked up automatically.
# Conflicts:
#	source/build/src/defs.cpp
2020-09-16 19:13:05 +02:00
Mitchell Richters
ce82eaf899 - Duke/RR: Address weapon drawer interpolation concerns raised in #403. 2020-09-16 21:01:09 +10:00
Christoph Oelckers
867b8f006f Reverted key input changes from yesterday.
At least the SW version did not work right so let's take no chances here.
2020-09-15 21:54:10 +02:00
Christoph Oelckers
1f4594b450 - Duke: Only read keyboard input for movement when called for the actual tic.
Since the added values are not scaled, doing this per frame has the potential risk of achieving too high total velocity when combined with other means of input.
The change here was kept as simple as possible.
2020-09-14 21:10:34 +02:00
Christoph Oelckers
0e58203d92 - fixed rintersect and removed some unused bits from engine.cpp. 2020-09-13 20:15:46 +02:00
Christoph Oelckers
a4754d7f34 - rewrote the map hack parser using sc_man.
This unexpectedly turned out a complete rewrite so now it is under my own license.
Also moved the remaining parts of map hack loading into the engine.

Overall I have to say that the feature is not what I expected, it's merely used to fudge the positioning of model sprites and for adding Polymer lights.
2020-09-13 13:01:44 +02:00
Christoph Oelckers
1f7bc6d69e - interpolation fix from EDuke: "Patch from Striker to improve sprite interpolation"
Fixes #109
2020-09-11 22:54:52 +02:00
Christoph Oelckers
aba91b4f09 - avoid uninitialized data. 2020-09-11 21:16:29 +02:00
Christoph Oelckers
19b5e2464e - For World Tour allow falling back on the classic sounds if the Oggs cannot be found 2020-09-11 21:04:47 +02:00
Christoph Oelckers
b7f0e2c3c3 - added sound FX remapping for World Tour so it can use the original VOCs.
Fixes #353
2020-09-11 20:17:36 +02:00
Christoph Oelckers
8716fabe9c - fixed E5L1 sky definition having gone MiA.
Fixes #389
2020-09-11 19:56:20 +02:00
Christoph Oelckers
38cc094ac3 - adapt ClearAllInput to new globalized code. 2020-09-10 23:35:42 +02:00
Christoph Oelckers
d5b9a9ee43 Merge remote-tracking branch 'remotes/Github_private/InputStuffs' into back_to_basics2 2020-09-10 23:25:43 +02:00
Christoph Oelckers
f829bc96c8 - Duke: Fixed E5L4's sky 2020-09-10 22:06:43 +02:00
Christoph Oelckers
f4bd30b972 - Duke: Fixed noclip cheat message. 2020-09-10 21:50:22 +02:00
Christoph Oelckers
9ce8202eb1 - Duke: Added a file check for the map to be entered when ending a level.
World Tour contains a map definition for E5L9 but no map for it.
2020-09-10 21:39:52 +02:00
Christoph Oelckers
83eba019b8 - added support for Megaton's widescreen assets.
Fixes #386
2020-09-10 00:05:10 +02:00
Christoph Oelckers
b52a2b0d9a - set up the loadscreen code.
This isn't active, though, because load times are so short these days that all this results in is an irritating screen flash before the level starts.
It may be activated later when hires assets are in use.

Fixes #10 (or not...? ;) )
2020-09-09 22:42:01 +02:00
Mitchell Richters
6570366a97 - Duke: Fix camera interpolations following uplift in 9615308fb3. 2020-09-09 20:46:17 +02:00
Mitchell Richters
ee5689b07e Merge branch 'back_to_basics2' into InputStuffs 2020-09-09 21:04:42 +10:00
Christoph Oelckers
d6c6561309 - that was for testing only. 2020-09-09 00:01:14 +02:00
Christoph Oelckers
9615308fb3 - Duke: fixed camera views glitching when changing their targets.
A nearly typical problem of this code. Not all relevant properties of the camera target were changed at once - there was a two frame discrepancy in which the camera pointed in some undefined direction after the change.

Fixes #15
2020-09-08 23:47:30 +02:00
Christoph Oelckers
cef1f8275b - fixed backing off of monitor screens.
Although this is a blocking condition, it must not neutralize movement because it is needed to move away from the screen and end the camera view.
2020-09-08 23:09:40 +02:00
Mitchell Richters
b72a3326d0 Merge branch 'back_to_basics2' into InputStuffs
# Conflicts:
#	source/core/d_net.cpp
2020-09-09 06:56:27 +10:00
Christoph Oelckers
f15657cc6d - fixed missing widescreen sprite for shrinker/grower and bad light level for the incinerator.
Fixes #380
2020-09-08 22:50:38 +02:00