Commit graph

243 commits

Author SHA1 Message Date
GenericHeroGuy
e61c43a852 Merge branch 'blankart-dev' into newinput 2025-03-10 23:26:30 +01:00
NepDisk
1935895f88 Remove Unused ACS code and rename POSITION script type 2025-03-10 12:44:21 -04:00
NepDisk
58e243a20c Don't Do levelstart or Map Music in Titlemap 2025-03-09 11:22:00 -04:00
NepDisk
8ed52a3a9d G_Ticker fixes from RR
ab0094b8d0 95216563a6
2025-03-09 11:09:01 -04:00
GenericHeroGuy
f419ccee57 New input handling (port of cd8862f0)
More or less a port with gamecontrols left untouched.

Some notable differences:
* ev_joystick now has a separate data1 for each axis, rather than having you
  check which of data2/3 is INT32_MAX and which one isn't
  (pissed me off when updating menu code...)
* Gutted the 1.6 upgrade code, since we're not upgrading from anything :P
* G_GetControlForKey, a helper for menu code
* Turn smoothing code left unused as a reminder to fix it
* Various small fixes so this commit is playable and doesn't segfault

Menu changes:
* Max 4 binds, joystick axes are now bindable like any other button
* The gamepad options submenu has been replaced by its two remaining options
  after the removal of axis cvars (gamepad select and deadzone)

See cd8862f0's message for more details
2025-03-07 00:05:35 +01:00
NepDisk
b0bbf07bdb Custom gametype and gametyperules additions
Many new options have been added.

You can now specify "menucolor" when creating a gametype. This accepts a V_ colorchar flag (IE V_PURPLEMAP) and will be used to color hud elements in menus and on the HUD.

Encore is now controlled by GTR_ENCORE. This allows for custom modes that don't accept encore.

Itemodds are now controlled by GTR_RACEODDS and GTR_BATTLEODDS respectively. If neither is specified on gametype creation, completely random items will be rolled.

General GTR_FREEROAM adjustments
2025-03-02 11:41:30 -05:00
NepDisk
8b142ceb62 Add kartstats
4942db2806
2025-02-25 14:00:10 -05:00
NepDisk
92d86be813 Implement distance based itemodds when legacy waypoints are in play 2025-01-22 13:15:42 -05:00
Alug
ce693aa912 dont use portals for skyboxes on binary maps
resolves alot of performance issues on some maps
2024-12-30 20:30:14 +01:00
NepDisk
f996d869db misc fixes
Fix time limit, disable mobjscramble, fix paranoia compile, clean up refernces code, fix driftdust negative refernces
2024-12-17 23:53:51 -05:00
NepDisk
e1720e7b3a Remove overtime stuff 2024-12-17 00:47:36 -05:00
NepDisk
049c182288 Massive warning clean up 2024-10-23 00:01:03 -04:00
NepDisk
4cd76db297 Fix encore music replacing start music 2024-10-21 23:14:22 -04:00
NepDisk
509fda70d5 Revert P_InitThinkers: Centralise/tidy global mobj pointer handling
This reverts commit 19da924b5e.
2024-10-21 15:54:21 -04:00
James R
24c6cded2a PARANOIA: add debug to P_SetTarget if references go negative
Prints mobj address, mobj type, thinker function,
reference count and source code line number.
2024-10-18 14:59:25 -04:00
NepDisk
19da924b5e P_InitThinkers: Centralise/tidy global mobj pointer handling 2024-10-18 13:22:50 -04:00
toaster
bdc50487b7 thinker_era
A first pass in attempts to fix crashes when ACS causes map changes.
Frustratingly still got a crash, but I think this is definitely the right foundation to work with.
2024-10-15 22:15:30 -04:00
Sally Coolatta
d29e3f2f6f Implement thing special
Executes when an object is killed.
2024-10-15 21:57:27 -04:00
Sally Coolatta
4ccdf8f43f Add additional script types
- POSITION: Runs when POSITION period ends. Has no activator.
- OVERTIME: Runs when the time limit runs out. Has no activator.
- EMERALD: Runs when the Special Stage UFO's Chaos Emerald is grabbed. The activator object is set to the player that grabbed it.
2024-10-15 16:30:38 -04:00
Sally Coolatta
8637dc3ce3 Fully port the ACS integration to C++ and make it build 2024-10-15 06:01:14 -04:00
Sally Coolatta
629b0aa77a ACS basic implementation
- BEHAVIOR lumps successfully load & run from maps. Currently they do not get unloaded between maps, though.
- Print and Timer are the only implemented CallFuncs. All of the base language functions (Delay, etc) are already implemented by the VM though.
- ACS compiler files are included, for use with GDCC. (Picked instead of ACC because it's less ZDoom-centric)
- Additionally, also added the configs for Zone Builder to be able to compile it in editor. Syntax highlighting is very incomplete atm.
2024-10-10 01:41:24 -04:00
NepDisk
d23ad3f6fb Small fixes for GTR_FREEROAM, make spinning wheels check for player speed only 2024-10-07 20:40:49 -04:00
NepDisk
01c015e560 Don't fade kstart 2024-09-18 10:17:35 -04:00
NepDisk
6df955cdc3 Revert Track skybox within player struct
This was done to make lua scripts that change the skybox work again!

This reverts commit 196dc77e6faafe41203ef132580c3178ad4562de.
2024-09-10 14:43:00 -04:00
NepDisk
878391906f Allow waypoints and boss3 to work t the same time 2024-09-04 12:51:21 -04:00
Sal
f54ba922a9 Merge branch 'fix-reset-interpolation' into 'master'
P_Ticker: update view interpolation at the start of a tic

See merge request KartKrew/Kart!1192
2024-09-04 01:05:12 -04:00
James R
049c03456a Refactor player waypoint code
- Condense K_GetPlayerNextWaypoint and
  K_UpdateDistanceFromFinishLine into slightly smaller
  functions
- Rename K_GetPlayerNextWaypoint to
  K_SetPlayerNextWaypoint
- Add K_UpdatePlayerWaypoints
2024-09-02 07:08:44 -04:00
James R
9c8cde2737 Merge branch 'fix-perfstats-4' into 'master'
Fix perfstats 4 not working properly

See merge request KartKrew/Kart!932
2024-08-21 18:57:24 -04:00
toaster
9925d4c238 Move starting countdown sounds to p_tick.c
Fixes an issue where the starting countdown wouldn't play in spectator mode or hitlag
2024-08-21 17:30:56 -04:00
NepDisk
c7cad1c14a adjust to start at 0 instead of 3 2024-08-21 16:59:53 -04:00
NepDisk
a733ea2baa Port Use SDL Game Controllers API by Eidolon 2024-08-16 21:18:18 -04:00
NepDisk
2ace452df6 Stop calling P_NullPrecipThinker
9eab5317f3
2024-08-01 16:00:12 -04:00
Gustaf Alhäll
a047144c4d Cache and reuse removed mobjs when spawning mobjs 2024-08-01 14:21:41 -04:00
Sal
1d8475a958 Merge branch 'hooklib-port' into 'master'
Hooklib refactor ported and (mostly) squashed

See merge request KartKrew/Kart!662
2024-07-31 02:30:20 -04:00
James R
da1e2a7e98 Merge branch 'oldcmd' 2024-07-31 01:46:58 -04:00
NepDisk
611009a545 Remove P_PreTicker 2024-07-30 22:21:10 -04:00
NepDisk
ec09f8a7e5 Make legacy checkpoints work along with respawn 2024-07-30 04:26:40 -04:00
NepDisk
9b307973ef Assorted stuff
Things include brining back kstart music, removing position etc
2024-07-30 00:13:53 -04: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
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
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
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
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