Commit graph

152 commits

Author SHA1 Message Date
NepDisk
be5ca15812 Expose slopepitch and sloperoll 2026-01-18 17:20:33 -05:00
Indev
f33534df0e Fix assigning SPR_PLAY frames not applying frame flags in lua_compatmode
Signed-off-by: NepDisk <nepdisk@noreply.codeberg.org>
2025-12-14 11:28:51 -05:00
GenericHeroGuy
bcb0eb95cc More fastcmp cleanup 2025-12-11 21:58:37 +01:00
GenericHeroGuy
891459b53b Change all voice arrays to be exposed as arrays in Lua
For the sake of consistency and future expansion!
Also expose mobj->voice (read-only for now, hopefully), and fix missing
NOSET for player->voice_id
2025-12-01 22:29:34 +01:00
yamamama
7838c2311f Fix up some bugs introduced 2025-11-30 19:57:55 -05:00
NepDisk
1ae3ceaa4b Add mine kneecapper cvar and track lifetime of mobj 2025-11-08 18:14:47 -05:00
Anonimus
b67e9d07bb Prevent RF_DONTDRAW (and MF2_DONTDRAW) overrides due to eflags 2025-10-10 15:50:23 -04:00
Anonimus
324bd3b117 Back-compat: Even more visibility eflags fixes 2025-10-10 12:42:45 -04:00
GenericHeroGuy
3ac73cf9c7 Fix MK64 chars displaying incorrect sprite frames 2025-10-09 22:07:02 +02:00
Anonimus
6960c52e91 Rework eflags compat (closes #150) 2025-10-07 10:47:02 -04:00
NepDisk
d98dd3e2dd Add variables that bake 3D offsets into a sprite
https://git.do.srb2.org/KartKrew/RingRacers/-/merge_requests/63
2025-09-12 11:50:24 -04:00
NepDisk
cea4d86dea Disallow negative states to prevent crashes 2025-08-31 21:10:07 -04:00
GenericHeroGuy
aa1ccafaea Use G_GamestateUsesLevel everywhere (and actually use levelloaded) 2025-08-27 22:03:05 +02:00
NepDisk
ff74274e99 Merge branch 'blankart-dev' into replaycompat 2025-08-02 19:08:05 -04:00
GenericHeroGuy
60abb9f010 Deduplicate frame2spr2 2025-08-02 21:54:50 +02:00
NepDisk
32313adde6 Add mobj_t.gravity
https://codeberg.org/srb2classic/srb2classic/pulls/39
2025-08-01 16:45:51 -04:00
GenericHeroGuy
792bb65e9e Add compat for old P_SetScale behavior, fixes Malicious Metropolis 2025-07-21 18:13:37 +02:00
NepDisk
2f84779d41 Update rest of the existing files to use blankart branding 2025-07-01 00:23:30 -04:00
NepDisk
b087b5e372 Port JugadorXEI's Terrain library for Lua
Credits go to JugadorXEI for the code in this. https://git.do.srb2.org/KartKrew/RingRacers/-/merge_requests/103\#d1c6f6fa1ba8207cb6aaef9f4a47d9a0b6b8b5c1

Modifications have been made to account for extra terrainflags, new terraintypes and removal of Ring Racers specfic types
2025-06-02 14:38:33 -04:00
NepDisk
ea2677b3d4 Warning cleanup 2025-06-01 09:35:41 -04:00
NepDisk
7270ae178d Support for MF2_SHADOW 2025-03-22 16:57:35 -04:00
NepDisk
52b532f265 Make sloperoll+pitch toggleable and make cameratilt not rely on sloperoll toggle
The toggle is handled in renderer for both gl and software!
2025-03-11 22:48:02 -04:00
NepDisk
064be1b201 Merge branch 'bortsport' into blankart-dev 2025-02-26 19:43:22 -05:00
GenericHeroGuy
244cfa9538 Imagine relying on C23 features 2025-02-23 16:47:59 +01:00
NepDisk
51154e346c rename tm to g_tm to fix C conflict 2025-02-22 01:24:53 -05:00
GenericHeroGuy
3024a95ac1 Assorted Lua fixes, part 2 2025-01-28 17:52:08 +01:00
GenericHeroGuy
390fa8c30f Assorted Lua fixes, part 1 2025-01-28 02:29:43 +01:00
GenericHeroGuy
4288d0d3fe Update mobjlib frame/sprite setters for compatmode 2025-01-26 03:04:18 +01:00
NepDisk
28d8f15bfc Merge branch 'v2dev3' into ACS2 2024-11-16 14:27:34 -05:00
hayaunderscore
ac7ee79e22 add a fallback to set spr2 for manually set PLAY frames 2024-11-16 14:22:21 -05:00
NepDisk
1766932ea9 Improve mapthing mobjlib code and expose I_GetPreciseTime 2024-10-26 02:01:58 -04:00
Sally Coolatta
34c4a207c7 Separate script args from mapthing args
SRB2 uses a LOT of mapthing args compared to Hexen (which has none) and ZDoom (which only has them on objects that will never ever activate scripts). So we really badly needed to separate the two if we want attaching scripts to things to be useful.
2024-10-16 13:19:31 -04:00
NepDisk
b5c21c8d88 Read-only mapthing_t 2024-10-16 13:11:13 -04:00
Sally Coolatta
d29e3f2f6f Implement thing special
Executes when an object is killed.
2024-10-15 21:57:27 -04:00
Sally Coolatta
b21352d8ac Evict the wall gremlin
Gremlins happened whenever P_TryMove and P_SlideMove/P_BounceMove disagreed on what an object collided with. When TryMove said you collided with a line, but P_BounceMove said that you didn't, then you'd get gremlin'd.

To fix this, P_TryMove now can edit a struct to contain information on what it collides with. P_SlideMove and P_BounceMove no longer try to detect walls on their own and now requires this result from P_TryMove. If a slide/bounce is needed without moving the object, then you'd want to use P_CheckMove to get the result.

Nep Note: I tried implementing lua support, its probably shit lmao
2024-09-13 11:49:12 -04:00
Sally Coolatta
e4534dcf50 P_RestoreTMStruct 2024-09-13 11:32:41 -04:00
Sally Coolatta
55a8643dd3 Put tm* variables into a struct
This makes it significantly easier to save/restore the state of these variables, whenever we need to do so for calling movement functions in the middle of other movement functions. This will also make it easier to move it out of global variable hell if desired later.
2024-09-13 11:29:30 -04:00
James R
ed8b681949 Add lightlevel field to mobj_t
Adds r_spritefx.cpp

lightlevel should be -255 to 255, relative offset to
normal sector lightlevel.

If RF_ABSOLUTELIGHTLEVEL, mobj_t.lightlevel becomes an
absolute lightlevel in the range 0 to 255.
2024-09-05 21:39:06 -04:00
NepDisk
02189eb55f Make UDMF scale compatible with ZDoom's spec
eb72019426
2024-09-02 22:05:05 -04:00
NepDisk
8f3b2db7d3 Remove hitlag. 2024-07-29 03:24:40 -04:00
Sally Coolatta
b9e3bdff94 Better tripwire leniency vfx 2022-08-29 16:26:58 +01: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
Sally Coolatta
c6f69e8f59 Add required speed percent 2022-01-02 21:42:20 -05:00
Sally Coolatta
c43f8da5e6 P_SetOrigin & P_MoveOrigin to replace P_TeleportMove 2021-11-29 08:20:27 -05:00
toaster
40cbc30bff Mammoth commit, sorry.
All my work thus far on solving the drawflag/renderflag/additive/subtractive conundrum.

Outstandng problems:
* Bad additive/subtractive tables means that they appear opaque except under certain conditions.
* No support for FOFs, Polyobjects, or linedefs in OpenGL yet.
* All OpenGL support mostly done blind, may or may not function in practice.

If nothing else, the hard engineering problems are solved and it's just bug hammering...
2021-03-31 22:46:23 +01: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
James R
1c6133a39a Lua: taglist.add and taglist.remove for sector tag lists 2020-12-05 02:02:06 -08:00
James R
01e7c48630 Lua tag lists
Index and take length of tag lists like a table, 1-indexed. There are three
methods which may be used on tag lists:

list:iterate() - returns an iterator over the tags in the list
list:has(tag) - returns a boolean whether the tag is in the list
list.shares(list2) - returns whether two lists share a tag

"find" is also an alias to "has". Each method may be accessed from the global
taglist library too, e.g. taglist.iterate(list)

Tag lists may be compared with an equality operator too. This will tell you if
the two lists are composed of identical tags.

Accessible from sector.taglist, line.taglist and mapthing.taglist.
2020-12-04 13:53:27 -08:00
James R
775cb46f75 Lua taglib for accessing taggroups
The global "tags" can be iterated upon for every unique tag which is set in the
level. If a tag is set on a sector/line/thing, it will be included. Taking the
length of "tags" will give you the number of these unique tags. (If a tag is
set on multiple sectors/lines/things, it will only be counted once though.)

For sectors, lines and mapthings, call the field "tagged". This function takes
one argument, which is the tag. The return value can be iterated over for all
the sectors/lines/things with that tag. The length can also be taken for the
number of such objects. If no argument is given, the global tag is default.
2020-12-04 00:30:08 -08:00
Jaime Ita Passos
be274a4fa9 Merge branch 'next' into spritestuff2 2020-11-19 00:52:43 -03:00