Commit graph

105 commits

Author SHA1 Message Date
Eidolon
cb7f437e60 Merge public master 2025-02-13 15:48:11 -06:00
Eidolon
a4d304a1f5 Update copyright years to 2025 2025-02-13 15:32:26 -06:00
Sal
653766010d FRIENDCODE (aka, Teamplay) 2024-09-17 01:41:26 +00:00
Sally Coolatta
7dfa597c7d SRB2 -> DRRR copyright in src, acs, android folder
Be consistent with toaster's recent changes to copyright
2024-04-05 02:08:23 -04:00
James R
646701c55c Remove Lua Music API
In preparation for replacing music handling entirely.
Eventually, we can make a new Lua API.
2023-08-05 16:26:53 -07:00
Sally Coolatta
ffb65a3583 Experimental: Improve level load processing
- P_PreTicker ("defrosting") is dead. Levels now actually start on tic 0 instead of tic 2.
- Netxcmds are ran before G_Ticker, instead of after.
- All netxcmds are required to be processed before the level will finish loading (up to 5 gametics, to prevent any possible lock-up from malicious clients).
2023-03-22 10:59:29 -04:00
Sally Coolatta
a0adb05c9b Merge branch 'master' into acs 2022-12-31 15:04:51 -05:00
Eidolon
be021baa02 Add extern "C" in C++ to all headers 2022-12-30 19:26:16 -06:00
Sally Coolatta
3135d14387 Replace LinedefExecute hook
- It is now called the "SpecialExecute" hook, since it can be called from ACS in addition to linedef specials.
- The input arguments are completely different now. Instead of (line_t, mobj_t, sector_t), it's (activator_t, args array, stringargs array). activator_t is userdata containing valid, mo (mobj_t), line (line_t), side (side_t), sector (sector_t), and po (polyobject_t).
2022-12-27 09:24:59 -05:00
James R
37c3a55dda Fix conflicts 522467a88 2022-09-05 11:56:30 -07:00
James R
b4d1fade5f Apply b4fa98d2f to lua_hudlib.c
Continued from 544812a45
2022-09-05 11:56:30 -07:00
James R
ceeda5c826 Lua hooklib refactor squash
commit 8d382e49fb3411cad1a3ef5ee1e546030c3a9d93
Author: James R <justsomejames2@gmail.com>
Date:   Tue Nov 17 04:14:45 2020 -0800

    Big Large Lua Hooklib Refactor

    * Hooks are no longer a mess of lua boiler plate. Helper functions reduce hooks
      to, at the most basic level, only two calls.
    * Lua tables (the array part) are used to index hooks. Such tables contain only
      hooks of the same type.
    * Hook types are defined in one place so you no longer need to sync up the enum
      and name array.

commit 3f7c2ae0b0c450cb8993ffe7664ead05fd9f5000
Author: James R <justsomejames2@gmail.com>
Date:   Thu Dec 10 05:39:53 2020 -0800

    Avoid using multiple tables to fetch hook

    String hooks still use a table to fetch the id, but the id indexes a C array.

    Also I fixed a missing call in the MusicChange hook.

commit dbd8903a538e7b87061795ce27ec5c72c26743af
Author: James R <justsomejames2@gmail.com>
Date:   Thu Dec 10 08:50:23 2020 -0800

    Use ref for pushing error handler

commit 9ddeb5f5896de0407b2b6fce8c949295a9e6d5e4
Author: James R <justsomejames2@gmail.com>
Date:   Sat Dec 12 02:05:21 2020 -0800

    Resolve GameQuit hook conflicts

commit 93e4f43e4b3a24fc2d8032e8730cbf427e75b297
Author: James R <justsomejames2@gmail.com>
Date:   Sat Dec 12 03:06:57 2020 -0800

    Hooklib macros names -> uppercase + documentation

commit 80fe39bbd1433c91131d2cdb36ba709f37d3b5f3
Author: Steel Titanium <steeltitanium1@gmail.com>
Date:   Mon May 3 01:40:02 2021 -0400

    Fix MusicChange hook not returning some values correctly

commit 46ca9613c68422a26910cbb034a9f3e004a967c3
Author: James R <justsomejames2@gmail.com>
Date:   Thu Jun 10 18:09:39 2021 -0700

    Pop hook id fetched from table

commit a75d4a1c360874a3c301a494e38ea49cd89b6616
Author: James R <justsomejames2@gmail.com>
Date:   Tue Jul 6 18:42:08 2021 -0700

    Automatically count hook values

commit 331329306cad257d52f84e47a92d9214d9eaa8d3
Author: James R <justsomejames2@gmail.com>
Date:   Tue Jul 6 19:12:47 2021 -0700

    Refactor hook ref allocation

commit ae57b6ca8664e00ff4d9544339dbf29a41138040
Author: James R <justsomejames2@gmail.com>
Date:   Tue Jul 6 20:23:38 2021 -0700

    MORE MACROS

    I just can't stop myself!

commit b4fa98d2fbab180f487ce3efedb8ab715e5f3390
Author: James R <justsomejames2@gmail.com>
Date:   Wed Jul 7 00:23:51 2021 -0700

    Refactor hudlib hooks to hooklib

    HUD hooks now meet the standard of hooklib. HUD registry
    magic numbers are gone.

    HUD hooks may also be added using addHook.

        addHook('HUD', fn[, type])

    hud.add still exists, but the intention is to remove it
    eventually.

commit cb619fad5d762ba8d8dd20e9a979a04ced7c943f
Author: SMS Alfredo <65426124+SMS-Alfredo@users.noreply.github.com>
Date:   Wed Jul 7 19:57:28 2021 -0500

    Rebase on !1307

commit f271f88c7f3084523a03ca7f47060d6527724796
Author: LJ Sonic <lamr@free.fr>
Date:   Sun Dec 5 17:59:33 2021 +0100

    Fix MusicChange hook crashing when called

    BRUH MOMENT BRUH MOMENT
    PREPARE THE HALL OF SHAME

commit 0a0c17da7c793ec29e80c5bdaa66b02da0884078
Author: James R <justsomejames2@gmail.com>
Date:   Tue Feb 1 02:27:27 2022 -0800

    PARANOIA: I_Error if mobj hook is called with MT_NULL

commit 86336d6bed80bee6f8168078aa8856109091e50f
Author: katsy <katmint@live.com>
Date:   Mon Mar 7 18:33:15 2022 -0600

    remove MODID check from hooklib to fix compile issue
2022-09-05 11:56:04 -07: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
b3d006b093 structs gunched 2021-04-17 00:27:13 +01:00
Sryder
8344ac3489 Actually just get rid of seenplayer and NAMECHECK altogether. 2021-03-03 18:03:41 +00:00
James R
98bcfc7cac Conflicts e9bbdb8cc3 ef1ca357de 2021-02-27 03:35:38 -08: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
James R
956fd338f0 Merge branch 'oldguards' into 'next'
Kill remaining HAVE_BLUA and SEENAMES

See merge request STJr/SRB2!1319
2020-12-12 17:34:04 -05:00
James R
41f1b3b97c Kill SEENAMES 2020-12-12 02:11:23 -08:00
GoldenTails
ded87cb54c Send a quitting argument to the GameQuit Lua hook 2020-11-29 08:30:50 -06:00
James R
fe031088ae Lua: "defrosting" global to tell how many tics are processing in the preticker 2020-11-24 19:32:01 -08:00
Sally Coolatta
fc934b38e1 Merge public next 2020-11-10 15:32:48 -05:00
Zachary McAlpin
7efb33a38e Added PlayerThink hook 2020-11-05 21:23:22 -08:00
James R
cacca05ed3 PreThinkFrame and PostThinkFrame hooks
Changes from e4d1b9491c,
4456ff50ab,
20494c4c42,
ee0e68d8dc.
2020-11-05 21:04:25 -08:00
Steel Titanium
ef1ca357de Expose more music functions to Lua 2020-10-31 21:15:41 -04:00
Sally Coolatta
7c2bd0d1c2 Merge remote-tracking branch 'srb2/next' into the-scary-22-merge 2020-10-24 20:50:58 -04:00
Sally Coolatta
3e446a167c Restructure how damage works in kart COMPLETELY
Instead of doing its best to avoid P_DamageMobj, it embraces it, using the damagetype system to decide how the player takes damage. Overall less stupid.
2020-08-19 00:55:36 -04:00
Sally Coolatta
0dc21106e5 Lua stuff is done 2020-08-15 07:47:18 -04:00
Sally Coolatta
9a21b3a46b g_demo compiles 2020-08-12 23:08:31 -04:00
Sally Coolatta
e296e1309a YAY, round 2 2020-08-09 21:02:56 -04:00
SteelT
c5f9a586a0 Merge lua_hook.h 2020-08-04 00:58:37 -04:00
Zachary McAlpin
6877df94bc Ported Lat's PlayerCmd hook to vanilla SRB2 2020-07-17 00:08:38 -05:00
Sally Coolatta
63917ffccc The start of the scary 2.2 merge
All conflicts are left in-tact. We should be collaborating on solving these files one at a time.
2020-05-29 13:43:38 -04:00
Zachary McAlpin
b6a2c21db7 Merge branch 'next' of https://git.magicalgirl.moe/STJr/SRB2 into gamequit-hook 2020-04-09 20:12:11 -05:00
James R
61a4fe06d5 Merge branch 'bot-respawn-hook' into 'next'
BotRespawn hook

See merge request STJr/SRB2!804
2020-04-09 19:52:25 -04:00
Wolfy
1d1b1514b4 Remove stupid dumbfuck #ifdefs
WHY THE FUCK DID THESE BREAK IT AAAAAAAAAAAAAAAAAAA
2020-04-07 05:24:38 -05:00
Wolfy
e9bbdb8cc3 Reimplement the MusicChange hook
why the fuck was this removed
2020-04-05 12:09:44 -05:00
Zachary McAlpin
61447c20be Screw merge conflicts 2020-03-24 20:38:46 -05:00
Louis-Antoine
46df2b9551 Use HAVE_BLUA as fuel for my fireplace 2020-03-19 18:36:14 +01:00
fickleheart
2176136480 Rename hook to ShouldJingleContinue 2020-03-18 22:35:21 -05:00
Zachary McAlpin
9bb2aa262e Created GameQuit hook, but I need to decide where to execute it 2020-03-12 12:22:04 -05:00
Latapostrophe
af4922b53e VoteThinker Hook for Lua 2020-03-10 18:58:44 +01:00
fickleheart
5aebc0ed6d Add JingleStatus hook for carrying custom jingle tunes
The extra argument is the music name, as passed into
P_PlayJingleMusic(player, musname), to run the hook for, optional.
Arguments are (player, musname) - the latter to allow global hooks
that still differentiate between different tracks.
2020-02-23 17:20:44 -06:00
James R
2274129f57 Update copyright year to 2020 2020-02-19 14:08:45 -08:00
Sally Cochenour
4735788e60 BotRespawn hook
Lets you force when and when not to respawn the bot
2020-02-12 14:16:23 -05:00
Louis-Antoine
a997683d1c Merge branch 'next' of https://git.magicalgirl.moe/STJr/SRB2.git into keep-body
# Conflicts:
#	src/g_game.c
#	src/p_setup.c
2020-01-22 03:57:22 +01:00
Louis-Antoine
c2682ac1b6 Let clients rejoin the server without losing their status
This is accomplished by simply preserving
the player's body after disconnecting.

Bodies will despawn after the number of minutes
specified by the "rejointimeout" console variable (float).
A value of 0 disables the feature completely.

Clients rejoining are identified by their IP address,
and may rejoin even if the server is full or joins are disabled,
for as long as their body remains.

From a technical standpoint, when the user disconnects,
the player they were controlling does not leave,
the underlying player_t just keeps working normally,
except it does not receive any input anymore.
When the user reconnects, they are simply "relinked"
to their player_t.

Those "soulless" players can be identified through
their "quittime" field, which is the number of tics
elapsed since the user disconnected, or zero
if still connected. "quittime" is exposed to Lua.
2020-01-22 03:05:08 +01:00
Zachary McAlpin
6f60341aec Merge branch 'next' of https://git.magicalgirl.moe/STJr/SRB2 into playerthink-hook 2020-01-08 18:52:56 -06:00
James R
2a6cf10f79 Merge branch 'lua-neatstuff' into 'next'
Extra functionality for lua

See merge request STJr/SRB2!601
2020-01-05 20:54:17 -05:00