Commit graph

232 commits

Author SHA1 Message Date
toaster
ed10cd102f Missing header reference 2022-11-03 14:57:27 +00:00
toaster
ea0bf216c5 Newview hack crash fixes
- Renderer should exist
- Player mo should exist
2022-11-03 14:50:46 +00:00
Eidolon
4b57159475 Ensure view interpolates between T-1 to T 2022-10-27 19:21:30 -05:00
James R
bc7d52ab3c Revert "Ensure view interpolates between T-1 to T"
This reverts commit aa7bfab0fc.
2022-10-26 22:34:32 -07:00
Oni
95096fbc9a Merge branch 'special-stages' into 'master'
[Special stage prep] GP Bonus Stages + timelimit rework + Hitlag ticking fixes

Closes #236

See merge request KartKrew/Kart!739
2022-10-27 03:10:37 +00:00
Sal
38e36d3e77 Merge branch 'fix-menu-button-bleed' into 'master'
Fix menu and replay save dialog opening while chat is open

Closes #300

See merge request KartKrew/Kart!734
2022-10-26 03:48:12 +00:00
Eidolon
aa7bfab0fc Ensure view interpolates between T-1 to T 2022-10-25 19:35:56 -05:00
James R
8e62531ff9 Fix replay save dialog activating while chat is open 2022-10-23 13:54:54 -07:00
toaster
6c9c6eeaf8 Also tick (almost) all karthud array timers even during hitlag
Only exception is timers relating to ring usage, as that's intended to signify ring boost power (which is obviously paused during hitlag)
2022-10-15 16:49:51 +01:00
toaster
c8471c7c27 Rework exit timing nittygritty
- exitcountdown is now used for both No Contest and regular exits
    - Set in P_DoPlayerExit
    - Handles sending XD_EXITLEVEL in P_Ticker
- player->exiting is now 0 or 1 (we can make it a bool or a new timer later)
- Fixes a longstanding bug where failing a GP round could restart multiple times
Also:
- Fix a possible waiting-in-the-wings issue where mapchanges would occour client-side in K_CheckBumpers
- Add `gptest` cheat - sets numlaps to 1 lap on mapload for quick but legitimate(ish) progression
2022-10-13 17:37:35 +01:00
Sally Coolatta
4ee46c74d7 Basic start on Special Stages 2022-10-01 21:32:55 -04:00
James R
b5cdf25298 Add P_LerpFlip 2022-09-28 02:01:37 -07:00
AJ Martinez
e10d6124d6 Merge remote-tracking branch 'origin/master' into new-spb 2022-09-23 22:20:24 -07:00
Sally Coolatta
f89d8d15c2 Properly separate SPB & Shrink cooldowns
Also refactors some of the result -> type & amount code
2022-09-23 03:35:18 -04:00
James R
7251ed5d9e Add player.oldcmd -- ticcmd from previous tic 2022-09-22 08:43:40 -07:00
toaster
3064b2cb7a Fixes for the replay post-game save interface (NOT THE ACTUAL REPLAYS OR HUT, THAT'LL BE LATER)
- `(B) or (X)` for replay saving instead of Press Lookback (HUD) or `(Y)` (input)
- Don't activate while closing pause menu if either of those buttons is shared for menu open/close
2022-09-12 16:01:37 +01:00
Sal
94d7c497b0 Merge branch 'hooklib-port' into 'master'
Hooklib refactor ported and (mostly) squashed

See merge request KartKrew/Kart!662
2022-09-11 06:30:07 +00:00
James R
37c3a55dda Fix conflicts 522467a88 2022-09-05 11:56:30 -07:00
toaster
d963dea4f9 Merge branch 'master' into new-menus
# Conflicts:
#	src/Sourcefile
#	src/deh_soc.c
#	src/m_menu.c
#	src/p_user.c
#	src/r_data.h
#	src/r_skins.h
2022-05-25 15:12:51 +01:00
Sally Coolatta
c8718b25ff REMOVE hyubgone + all of the other bullshit we did to try and make it show up less 2022-05-22 21:17:14 -04:00
toaster
54b9f3b7cc Merge branch 'master' of https://git.do.srb2.org/KartKrew/Kart.git into new-menus
# Conflicts:
#	src/Sourcefile
#	src/f_finale.c
#	src/m_menu.c
#	src/y_inter.c
2022-05-22 17:22:49 +01:00
Eidolon
25e9815d82 Update interpolation during objectplace 2022-05-21 14:41:06 -05:00
Sally Coolatta
5ae8664b70 Try putting lagless camera stuff back 2022-05-19 16:51:26 -04:00
Eidolon
f7ec2f182f Uncapped (squashed v2)
Squashed SRB2 2.2 Public uncapped without UDMF merge

Implement interpolation at the renderer level

Instead of interpolating thinkers, we interpolate mobjs inside the
renderer. Further interpolation is TBI.

Place Frame Interpolation in "Experimental" video options header

This seems like an appropriate way to describe the feature for now.

Add smooth level platter under interpolation, `renderdeltatics`

`renderdeltatics` can be used as a standard delta time in any place,
allowing for smooth menus. It will always be equal to `realtics`
when frame interpolation is turned off, producing consistent
framerate behavior everywhere it is used.

Add smooth rendering to save select screen

Add smooth rendering to Record/NiGHTS Attack, F_SkyScroll

Ensure viewsector is accurate to viewx/viewy

This fixes a potential crash in OpenGL when changing between levels.

Ensure + commands get executed before map start

Always have precise_t defined

Fix misc dropshadow issues

Reset view interpolation on level load

Remove unnecessary precipmobj thinker hack

Add reset interpolation state functions

Reset precip interpolation on snap to ceil

Reset mobj interp state on TeleportMove

Only swap view interp state if a tick is run

Run anti-lag chasecam at tic frequency

Fixes jittery and unstable chasecam in high latency netgames

Homogenize mobj interpolations

Add sector plane level interpolations

Add SectorScroll interpolator

Add SideScroll interpolator

Add Polyobj interpolator

Intialize interpolator list at a better time

Delete interpolators associated with thinkers

Interpolate mobj angles and player drawangle

Interpolate HWR_DrawModel

Add functions to handle interpolation

Much less code duplication

P_InitAngle, to fix angle interpolation on spawning objects

Fully fix drop shadows

It used the thing's floorz / ceilingz directly -- that wouldn't account for interpolated coordinates.

Do not speed up underwater/heatwave effect in OpenGL

Closer OpenGL underwater/heatwave effect to Software

Interpolate from time of previous tic

Previously interpolated from last 35th of a second, which
may be offset from game time due to connection lag.

Consider this the proper fix to 6ecac4159a too.

Calculate FPS stuff even if frame is skipped

I decided ultimately to actually keep the frame skip optimization disabled, because I think it is actually a little bit helpful that you can still get accurate rendering perfstats while paused, however if we decide otherwise then we can have this optimization back without making the game act like it's lagging.

Keep rect in memory

Feel better about this than creating one all da time

Lots of FPS stuff

- Disabled VSync, due to the numerous problems it has.
- Instead, added an FPS cap.
- Frame interpolation is now tied to fpscap != 35.
- By default, the FPS cap is set to the monitor's refresh rate.
- Rewrote the FPS counter.

(This also consolidates several more commits ahead of this
fixing various issues. -eid)

Misc changes after Kart cherry-picks

Fix renderdeltatics with new timing data

Update mobj oldstates before all thinkers

Allow FPS cap values

Adjust how FPS cap is checked to improve FPS stability

Fix precip crash from missing vars

Improve the framerate limiter's timing for extreme stable FPS

Handle the sleep at the end of D_SRB2Loop instead of the start

Simplifies logic in the other parts of the loop, and fixes problems with it frequently waiting too long.

Reset mobj interp state on add

Add mobj interpolator on load netgame

Move mobj interpolators to r_fps

Dynamic slope interpolators

I_GetFrameTime to try and improve frame pace

(It doesn't feel that much better though.)

Move I_FinishUpdate to D_SRB2Loop to sync screen updates with FPS cap, use timestamps in I_FrameCapSleep to simplify the code

Fix plane interpolation light level flickering

Fix flickering plane interpolation for OpenGL in the exact same way

Funny OpenGL renderer being at least 50% copy-pasted Software code :)

P_SetOrigin & P_MoveOrigin to replace P_TeleportMove

Convert P_TeleportMove use to origin funcs

Revert "P_InitAngle, to fix angle interpolation on spawning objects"

This reverts commit a80c98bd164a2748cbbfad9027b34601185d93f5.

Waypoint polyobjects interpolate z & children

Add interpolation to more moving plane types

Adds interpolation to the following:
- Crumbling platforms
- Mario blocks
- Floatbob platforms (this one works really strangely due to two thinkers, maybe double-check this one?)

Reset overlays interp states each TryRunTics

Interpolate model interpolation (lol)

Use interp tracer pos for GL linkdraw

Papersprite angle interpolation

Makes the ending signpost smooth

Move intermission emerald bounce to ticker

Bring back shadows on polyobjects

Also optimizes the method used so rings can show their shadows too. Using just the subsector is a tad bit imprecise admittedly but any more precise methods get really laggy.

Fix a bunch of ticking in hu_ drawing functions

Revert "Reset overlays interp states each TryRunTics"

This reverts commit a71a216faa20e8751b3bd0157354e8d748940c92.

Move intro ticking out of the drawer

Adjust 1up monitor icon z offsets

Fixes interpolation issues with 1up monitors.

Delta time choose player menu animations

Add drawerlib deltaTime function

Interpolate afterimages further back

Use old sleep in dedicated mode

Clamp cechotimer to 0

Fixes issues with cechos staying on-screen and glitching out
(NiGHTS items for example).

Revert "Remove unnecessary precipmobj thinker hack"

This reverts commit 0e38208620d19ec2ab690740438ac2fc7862a49e.

Fix frame pacing when game lags behind

The frame timestamp should've been made at the start of the frame, not the end.

Fix I_FrameCapSleep not respecting cpusleep

Jonathan Joestar bruh

Allow dedicated to use precise sleep timing again

Instead of only using one old sleep, just enforce framerate cap to match TICRATE.

Make Lua TeleportMove call MoveOrigin

Reset Metal fume interp state on appear

Add interpdebug

Put interpdebug stuff in perfstats instead

Add timescale cvar

Slow the game down to debug animations / interpolation problems! Speed it up if you need to get somewhere quickly while mapping!

Enable timescale outside of DEVELOP builds

It has NETVAR, so it should be fine -- put an end to useful debugging features excluded in multiplayer!

Force interpolation when timescale != 1.0

Reset old_z in MT_LOCKON think

Fixes interpolation artifacting due to spawn pos.

Fix cutscenes in interp

Fix boss1 laser in interp

Interpolate mobj scale

Precalculate refresh rate

Slower PCs can have issue querying mode over and over. This might kinda suck for windowed mode if you have different refresh rate displays but oh well

Fix interp scaling crashing software

Reset interp scale when Lua sets .scale

Disable angle interp on fresh mobjs

Fix interp scale crash for hires sprites

Interp shadow scales

Copy interp state in P_SpawnMobjFromMobj

Fix multiplayer character select

Don't interpolate mobj state if frac = 1.0

Fix Mario block item placement

Interpolate spritescale/offset x/y

Fix offset copies for SpawnMobjFromMobj

THANKS SAL

Add Lua HUD drawlists

Buffers draw calls between tics to ensure hooks
run at the originally intended rate.

Rename drawerlib deltaTime to getDeltaTime

Make renderisnewtic is false between tics

I know what I'm doing! I swear

Completely refactor timing system

Time is now tracked internally in the game using I_GetPreciseTime
and I_UpdateTime. I_Time now pulls from this internal timer. The
system code no longer needs to keep track of time itself.

This significantly improves frame and tic timing in interp mode,
resulting in a much smoother image with essentially no judder at
any framerate.

Ensure mobj interpolators reset on level load

Ensure view is not interpolated on first frame

Disable sprite offset interpolation (for now)

Refactor timing code even more

System layer is greatly simplified and framecap
logic has been moved internally. I_Sleep now
takes a sleep duration and I_SleepDuration
generically implements a precise sleep with spin
loop.

Adjust spawned mobj z by gravity inversion

Only check VERTICALFLIP for old_z calc

Fix Marathon Mode menu for uncapped

Move screenshot code before timing

Only play emerald hunt sounds on new tics

Restore deleted zofs (fixes signpost sparkles etc)

Revert to before screenUpdate boolean was added

Was done this way for the sake of an older version of uncapped's timing; now that the new timing is much better, I decided it should remain as close to pre-uncapped as it can be.

Run UpdateLevelInterpolators in preticker

Fixes KartKrew/Kart-Public#10

Run UpdateMobjInterpolators in preticker

Reset view interp in preticker

Add per-split player view resets
2022-05-06 22:47:39 -05:00
toaster
73dabaeab6 Merge branch 'master' into new-menus
# Conflicts:
#	src/d_clisrv.c
#	src/deh_soc.c
#	src/lua_baselib.c
#	src/m_cheat.c
#	src/m_menu.h
#	src/y_inter.c
2022-03-29 17:14:38 +01:00
toaster
8de92e8dca Merge branch 'master' into boss
# Conflicts:
#	src/k_bot.c
2022-03-17 16:58:42 +00:00
toaster
fcb6a4e1ab Disable the vanilla-sourced "keepbody" (rejointimeout) feature. 2022-03-14 16:33:03 +00:00
toaster
c1f3237157 Boss API + assorted relevant bugfixes, will go over the featureset of this branch with a fine toothed comb when it's time to write the merge request description so this is all you're getting right now 2022-02-24 21:19:03 +00:00
James R
9095261a18 POSITION music
Play SA2 "shwing" at title card; play POSITION music once
camera is steady (instantly in 1v1).

Encore: play portal warp sound instead of "shwing"; play
portal drone instead of POSITION music, always start
instantly.
2022-02-15 15:51:47 -08:00
James R
bcabe6d43d Include k_director.h 2022-02-14 14:27:12 +01:00
AJ Martinez
99e8ab9b58 Director cam barebones functionality 2022-02-14 14:27:09 +01:00
James R
8a2be85563 Include k_director.h 2022-01-20 04:50:11 -08:00
AJ Martinez
be33a1b659 Director cam barebones functionality 2022-01-18 22:41:07 -06:00
Sally Coolatta
0179466107 Finalize char select multiplayer
- Add menu control fallbacks.
    - If it could not find a bind using your existing keys, then it looks at default controls.
    - If it could not find it then, and you're P1, then it looks through gamepads, and then lastly settles for keyboard.
    - Changed around the order of operations on the character select menu, to accommodate for this change.
- Added initroutine to menu_t, which is called every time without question when going to a new menu. This solves many, many minor bugs you could experience in the character select menu when changing between menus, due to things only being properly reset when selecting the character select menu option.
2021-12-28 12:02:31 -05:00
Sally Coolatta
7d0597d864 Merge branch 'master' into profiles 2021-12-04 15:46:28 -05:00
Sally Coolatta
c66e85700b Merge branch 'master' into profiles 2021-11-29 10:32:14 -05:00
Eidolon
1550210188 Implement interpolation at the renderer level
Instead of interpolating thinkers, we interpolate mobjs inside the
renderer. Further interpolation is TBI.
2021-11-29 06:43:46 -05:00
James R
5f625437a8 Move level music check out of player thinker
Hitlag during this tic will skip playing the music.
2021-11-26 18:20:16 -08:00
Sally Coolatta
cd8862f0bc New input handling
Events have a player ID instead of adding billions of keys for separate gamepads. Axis movement (mouse movement, analog sticks) now are counted as keys, so axes don't need to be separately implemented for all controls. Game controls emulate a Saturn controller (some of the external functions like screenshot / gif should be readded, but I got lazy)

This will allow later us to save a config for a controller that can be reused for any player slot, which is one of the main goals for profiles.

Only just enough was made to use the new input system to make it compile. Menus in this branch should aim to move to using PlayerInputDown entirely, instead of using hardcoded keys & simply remapping to those
2021-11-26 14:56:25 -05:00
Sally Coolatta
48c8843feb Merge branch 'master' into stair-janking 2021-04-21 21:44:23 -04:00
toaster
b3d006b093 structs gunched 2021-04-17 00:27:13 +01:00
James R
2b173f1ec0 Rumble the jart when stepping on staircases
- Sprite tilts back and forth 5.625 degrees, two tics each
  side, for 17 tics (half a second).
- Turning is ignored--as if in the air--every other tic
  during those 17 tics.
2021-04-10 03:22:23 -07:00
James R
1eca138b21 Revert "Rumble rumble"
This reverts commit c82ac33c0c.
2021-04-06 16:25:25 -07:00
James R
04b6911e21 Merge branch 'sloped-camera' into 22-merge-again 2021-04-01 20:55:22 -07:00
Sally Coolatta
9d7ec0ab8f Merge SRB2 next
Probably doesn't compile yet, but I got rid of all of the conflicts for anyone who wants to take a stab at it.
2021-02-27 05:18:36 -05:00
Sally Coolatta
d63b428565 Merge Kart-Public next 2021-02-27 02:16:21 -05:00
Sally Coolatta
10319386c2 Do starttime calculation on second tick instead
Attempts to fix replays & adding bots.
2021-02-11 20:25:22 -05:00
Sally Coolatta
90ca38acb0 Store where the finish line beam should be displayed
Instead of figuring out where it should be every tick while it's visible, store where it'll be at the start of the map.

Also moved finish line beam into a new file, k_race.c/h, for any Race-specific code.

A few unused variables for sprint map support later too
2021-02-05 01:24:23 -05:00
Sally Coolatta
237f86749d Merge branch 'master' into finish-line-beam 2021-02-01 23:31:19 -05:00
James R
2e649de64f Merge branch 'high-resolution-timer-2' into next 2020-12-10 02:55:02 -08:00