Commit graph

195 commits

Author SHA1 Message Date
toaster
45f8f1c89f Remove a bunch of unused emerald stuff inherited from SRB2
All superseded by M_CheckCupEmeralds + GTR_POWERSTONES stuff
2023-06-25 23:49:20 +01:00
Sal
0f909bdb46 Merge branch 'gacha-prep' into 'master'
Add FF_REVERSEANIM and FF_INVERT, extern P_InstaScale

See merge request KartKrew/Kart!1285
2023-06-14 00:25:50 +00:00
Sal
7b98752b67 Merge branch 'refactor-mapthing' into 'master'
Read-only mapthing_t

See merge request KartKrew/Kart!1252
2023-06-14 00:07:42 +00:00
James R
c50e63ccd7 p_mobj.c: add P_InstaScale function
Previously was in objects/broly.c
2023-06-13 14:42:00 -07:00
James R
018f6f3410 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.
2023-06-05 20:00:35 -07:00
Sally Coolatta
9d80323a3a Read-only mapthing_t
Map things are writeable in Lua, which I am pretty certain is a mistake because mapthings are not sent over the network at all. I considered making them net-synced (it would be relatively easy), but it also aligns with another, more "philosophical" issue: Doom generally copies over properties from mapthing_t into mobj_t, and then only refers to it again when needing to respawn an object -- mapthing_t is not really intended to be referred to very often at runtime. At best it's slightly annoying since some objects rely on a spawnpoint for behavior changes, at worst it may make ACS more confusing in the future since Thing and Mobj tags are mixed together or less useful since they wouldn't be able to modify behaviors of objects that are based on args.

So I decided to solve these two issues at the same time; just treat mapthing_t as something to copy values from, like OG Doom does it. This basically just means that special and args are also part of the mobj now instead of the mapthing, which should fill any desire to edit this stuff from Lua, and reduces the number of instances where objects need to check for their spawnpoint to function properly.
2023-05-25 14:40:55 -04:00
James R
9eab5317f3 Stop calling P_NullPrecipThinker
In levels with tens of thousands of precipmobjs, the
overhead of running a thinker for all of them is too much,
no matter how small the thinker is.

ALL thinking is done inside the renderer now, where it can
be limited by distance. Precipmobjs track the last
leveltime they thunk, so interpolated frames don't think
twice.
2023-04-08 13:34:42 -07:00
James R
bced5ecbc5 Render precip through blockmap instead of during BSP
There can be very many precipmobjs in a sector. During BSP
rendering, for each sector reached by BSP (the entire
visible level at least), all the precipmobjs would be
iterated and their distance from the camera calculated, to
determine whether they are within draw distance.

The issue with the old approach is that there really are
too many precipmobjs in each sector. By iterating the
blockmap within a certain range instead, precipmobjs
out of view are not iterated at all, saving some time.

Caveat: drawdist_precip is no longer respected as an
exact value, since it must round to the precision of the
blockmap.

List of potentially scary changes:

- Removes snext/sprev for precipmobj_t
- Removes preciplist for sector_t

- Adds bnext/bprev for precipmobj_t
  - mobj_t and precipmobj_t field offsets are symmetrical

- Modified P_SetPrecipitationThingPosition and P_SetThingPosition
  - The syntax in these functions is kind of wacky
2023-04-06 05:41:06 -07:00
James R
1c9ccab159 Use foflayer when spawning mapthings
- foflayer offsets the thing from an FOF in its sector.
  - foflayer 0 uses the base sector heights.
  - foflayer 1 uses the lowest FOF top height, or highest
    FOF bottom height when the thing is flipped.
  - foflayer 2 uses the second lowest / second highest and
    so on.
2023-03-29 22:23:56 -07:00
James R
61abb7a82e Add MF_DRAWFROMFARAWAY flag, renders objects up to 2x drawdist 2023-03-26 22:01:25 -07:00
James R
629614710c Free MF_AMBIENT 2023-03-26 21:52:31 -07:00
James R
264e445f0c Add MF2_ALREADYHIT; don't deal damage for multiple wombos within the same tic
These wombos still create hitlag.
2023-03-11 05:39:07 -08:00
James R
49bb2a377e Add P_SpawnItemLine, spawn a row of mapthings between two points 2023-02-28 19:14:35 -08:00
James R
061e5b01ec Refactor trackercap
- Don't clear every tic. This is what P_RemoveTracker is
  for.
- Link in P_SpawnMobj. Should cover all cases.
- Remove excess objects. These were leftover from when
  Shrink destroyed items. Just track Jawz, SPB and Break
  the Capsules.
2023-02-21 18:27:46 -08:00
James R
be4c341316 Rename kitemcap to trackercap 2023-02-21 17:48:14 -08:00
Sally Coolatta
345e7f83b0 Copy first mapthing tag to their mobjs
Allows the ThingCount and ThingSound ACS functions to fully work now, and adds significantly more possibilities for scripting later.
2023-01-01 17:07:46 -05:00
Sally Coolatta
a0adb05c9b Merge branch 'master' into acs 2022-12-31 15:04:51 -05:00
Sally Coolatta
d5155e3d83 Add Hexen line activation flags
- Lines can be set to activate when crossing or bumping into them, with distinctions for players, enemies, and missiles+items.
- A new flag has been added to determine if a line special can activate more than once.
- Finish Line + Respawn Line are now handled like other specials. This means that:
    - They follow the new line activation rules (so you can potentially have a finish line that you have to bump instead of cross)
    - More importantly, they can be called as functions in ACS. (Player_FinishLine and Player_Respawn)
- Fixed linedef flags not being saved in save games.
2022-12-31 13:41:17 -05:00
Eidolon
be021baa02 Add extern "C" in C++ to all headers 2022-12-30 19:26:16 -06:00
James R
ba2a7744d1 Add half hitlag to invincible players if they would've been damaged 2022-12-21 08:35:26 -08:00
James R
d3b8f295b8 Fix not being able to play sounds from sector->soundorg 2022-12-18 21:10:31 -08:00
James R
051b4f8935 Always use typedef name instead of struct name
mobj_t instead of struct mobj_s
2022-11-27 17:21:40 -08:00
James R
b5310a1f68 Add typedef.h
All typedefs for structs that were present in other header
files have been moved to here. (Except node_t because the
renderer and netcode both define node_t LOL.)
2022-11-27 17:21:40 -08:00
Sally Coolatta
1688325c67 Banana angle crazy mode
- Randomize banana angles when thrown
- Spin bananas when mid-air
- Add MF_SLOPE flag to control whenever or not pitch/roll are set for an object (replaces MF_BOXICON)
2022-11-18 01:05:01 -05:00
Nev3r
5c9599f0a9 "UDMF: The whole thing" merged
See merge request STJr/SRB2!1714

Barely any RR features reimplemented
2022-10-09 01:13:37 -04:00
Sal
a094fe7d61 Merge branch 'unshitty-destroy-items-sectors' into 'master'
Let's define which items can die in a death sector in ONE PLACE

See merge request KartKrew/Kart!713
2022-09-29 18:06:18 +00:00
James R
ff05234783 Merge branch 'water-skip-conditions' into 'master'
Fun times at the pool

See merge request KartKrew/Kart!710
2022-09-29 17:18:15 +00:00
James R
e30232e103 Kill last of MF2_TWOD -- toggletwod, line action 432 2022-09-29 03:16:11 -07:00
James R
cf02646229 Add K_CanDeleteKartItem
HAKAI
2022-09-27 23:54:23 -07:00
James R
a3caba4f20 Add P_IsKartFieldItem, an item that is not attached to a player 2022-09-27 23:54:23 -07:00
Sally Coolatta
841bcf3619 Allow non-players to water skip/run
Water skipping is enabled for Orbinaut, Jawz, and Ballhog currently. Jawz can water run, as long as their target is on/above the plane they're at -- once their target goes into the water, they'll start skipping.
2022-09-27 12:31:33 -04:00
Sally Coolatta
0b98417d07 Terrain overlays
Customizable state to display when standing / moving on terrain. Intended to pair with floor clipping.
2022-09-15 07:26:08 -04:00
Sally Coolatta
0faf4d5f54 Add MF_APPLYTERRAIN
I gave it to all of our items, to give them footstep particles. Replaced MF_NIGHTSITEM.
2022-09-15 05:46:40 -04:00
James R
082d9206e8 Add a hitbox renderer to Software mode
renderhitbox
- Tangible - collision activating objects, minus rings
- All - every object
- Intangible - the opposite of Tangible, also no rings
- Rings - rings
2022-09-08 22:30:00 -07:00
Sally Coolatta
b9e3bdff94 Better tripwire leniency vfx 2022-08-29 16:26:58 +01:00
Sally Coolatta
6106ce1624 Add reversed weather
- Negative speed weather will spawn from a floor in a sector with a sky ceiling, and go up into the ceiling.
- (Not really the same as reverse gravity weather in that aspect, because that would be for sky floors.)
- Fixed invert precipitation flag for linedef type 8 being completely unimplemented. (How long has it been like this...?)
- Fix swapping weather on the fly having reversed momz
2022-06-05 05:39:35 -04:00
Sally Coolatta
5c35602d7f Fix different types from mobj_t 2022-06-01 00:36:53 -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
James R
2887385122 pedantic: ignore enums signed overflow 2022-02-20 03:25:46 -08:00
SinnamonLat
ba9ef23b31 Add MF_NOHITLAGFORME and DMG_WOMBO 2022-01-22 10:01:24 +01:00
Sally Coolatta
c203bbdce9 Merge branch 'master' into terrain-lump 2021-12-23 03:05:10 -05:00
James R
51941f5896 MF_NOSQUISH to disable K_Squish 2021-12-16 23:03:39 -08:00
Sally Coolatta
150faf9de6 Add terrain pointer to mobj_t 2021-12-09 00:56:05 -05:00
Sally Coolatta
83444ce5d5 Interpolate angle & nametags 2021-12-01 16:50:17 -05:00
James R
b479fdcef6 Merge branch 'jelly-racers' into 'master'
Squashing and stretching

See merge request KartKrew/Kart!420
2021-11-30 04:00:03 +00: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
696ca049d8 Apply momentum based squash and stretch to every object
Also netsave.
2021-11-28 22:43:48 -08:00
Sally Coolatta
cb5ea8b335 Add basic damage hitlag effects
- Invert high contrast greyscale colorization effect for damage hitlag
- Jitter is now also exclusive to damage-related hitlag
- Since jitter is now just tied to a flag, removed the old trick momentum hack
2021-11-27 13:38:45 -05:00
toaster
b3d006b093 structs gunched 2021-04-17 00:27:13 +01: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