Commit graph

97 commits

Author SHA1 Message Date
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
Sally Coolatta
5022e2090b P_PathTraverse improvements
Many improvements that were in the raycast-physics branch, backported since that branch is probably dead, and if I ever revive it then it will be with a new approach. Many are sourced from PRBoom +ZDoom + Eternity Engine.
- Some line / divline comparison functions use const.
- P_PointOnLineSide and P_BoxOnLineSize use PrBoom's version.
- P_InterceptVector is more resistant to overflow.
- PIT_AddThingIntercepts checks against actual bounding box, instead of a corner-to-corner cross-section.
- P_TraverseIntercepts doesn't run the callback function on NULL intercepts.
- P_PathTraverse handles traces that go through blockmap corners properly.
- Removed unused earlyout flag to simplify logic.
- Added g_ prefix to trace.
2024-02-22 22:09:36 -08:00
Eidolon
af7800c17b C++ compat: rename tm -> g_tm
This one's not even C++. It's in the ISO C standard library. :(
2024-02-19 19:36:42 -06:00
James R
c0fff1a0c4 Activate sector each time / once actions when mobj touches the ground
Before

- Each time / once only activates when the mobj's sector
  changes
- The activation may depend on the mobj touching the floor
- If the mobj is in the air when the sector changes, the
  action will never be activated

After

- Each time / once actions that require floor touching
  also activate every time the mobj lands on the ground
  from the air (regardless of whether the sector changed)
2024-02-01 18:57:06 -08:00
Sally Coolatta
7cb0b74cac Use more explicit floor/ceiling FOF sort 2023-05-13 04:13:35 -04:00
Sally Coolatta
002e25905b Add FOF behavior switch to P_LineOpening
Finally fixes the very specific issue on Endless Mine ( https://cdn.discordapp.com/attachments/1006454720686202951/1106749881663631420/image.png )
2023-05-13 01:14:40 -04:00
Sally Coolatta
6fa821b2d3 Local P_LineOpening result + traversal leniency
P_LineOpening results are stored in a locally made struct instead of being a bunch of disorganized globals.

Waypoint traversals can go thru 1 line, if it was blocked by step-up rules, for free, similar concept to sound-blocking lines in Doom.
2023-05-13 00:39:36 -04:00
Sally Coolatta
66f0c7c9f0 Fix waypoint traversal with slopes 2023-05-12 23:10:56 -04:00
Sally Coolatta
b72b8f354e lowfloor/highceiling respects FOFs properly
Found while working on bot changes to respect step-up, lowfloor would occasionally be the floor below instead of the FOF. Also code cleanup to remove redundant / unused stuff.
2023-05-10 19:48:08 -04:00
Oni
f615b1a2f0 Merge branch 'acs-trigger-improvement' into 'master'
Improve ACS triggers

See merge request KartKrew/Kart!1131
2023-04-09 03:08:34 +00:00
Sally Coolatta
010fc344df Add equivalent of "Each Time" triggers for ACS 2023-04-06 18:05:05 +01: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
Sally Coolatta
dbedd66259 Fix solid midtextures
UDMF's ML_MIDPEG == Binary's (!!(linedef->flags & ML_DONTPEGBOTTOM) ^ !!(linedef->flags & ML_MIDPEG)). This is converted in P_ConvertBinaryLinedefFlags
2022-12-02 02:01:02 -05:00
Sally Coolatta
b31aa1bbb0 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.
2022-11-20 19:27:34 -05:00
Sally Coolatta
7ceab1f101 Fix solid midtextures not working
IDK which part was the fix, so I'm keeping all of it LOL
2022-10-10 06:44:55 -04:00
MascaraSnake
3b971835ee Add Lua backwards compatibility for FOF flags 2022-10-09 01:56:50 -04: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
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
James R
f52afc0491 Add P_GetMidtextureTopBottom 2022-08-01 07:16:53 -07:00
Sally Coolatta
d053d5f8ba Fix blockmap WILD inconsistency when it's not PIT_CheckThing
An optimized error check was put into P_BlockThingsIterator for tmthing, but this meant that anything that was not using or even setting this variable (the supermajority of them) would exit after finding 1 thing in each block.

To keep this error check & keep it optimized, the PIT_ functions were expanded to three options instead of two: BMIT_CONTINUE lets the search continue. If used as the last mobj, it will return true when the iterator finishes. BMIT_ABORT ends the search and forces the iterator to return false.
BMIT_STOP ends the search and forces the iterator to return true.
2022-05-23 17:37:29 -04:00
Sally Coolatta
bf4b47a2cf Merge branch 'master' into terrain-lump 2021-12-09 03:46:01 -05:00
Sally Coolatta
150faf9de6 Add terrain pointer to mobj_t 2021-12-09 00:56:05 -05:00
James R
9bde266f9f Water running
You can run on water in any case where you would have
slope resistance AND your speed is over 100%. You may run
on water regardless if you're speed is above 200%.
2021-12-05 22:41:25 -08:00
James R
8e20ca4c04 TRIPWIRE
Set a sidedef's midtexture to "TRIPWIRE" to turn that line
into a tripwire.

Players can't drive through a tripwire and will bounce
back at high speed if they're in one of the following
states:

1. Invincibility / Grow
2. Sneakers
3. Flame Shield dash
4. >200% on the speedometer

Hitting a tripwire plays a sound, sends you into hitlag,
then plays another sound when the hitlag is over. The
sounds used depend on whether you can drive through the
tripwire.
2021-11-28 03:03:43 -08:00
James R
130e1fc4f9 Windows??? 2021-02-15 23:12:30 -08:00
James R
82718216cc Respawn slightly before a waypoint, in the direction you came from, if the waypoint is exactly on a line
See notably the finish line. Basically respawning exactly on a line can let you
cross it twice, if you crossed it before respawning, or NOT cross it, depending
on which direction you drive after landing. So this just respawns very slightly
before the line so you can cross (or not cross) it normally.
2021-02-15 23:01:13 -08:00
Sally Coolatta
fc934b38e1 Merge public next 2020-11-10 15:32:48 -05:00
Sally Coolatta
f27a2b904b Use FixedHypot over P_AproxDistance
Not convinced that the small speed benefit from P_AproxDistance is worth the "aproximate"[sic] results it gives. Let's instead try a define to replace it with FixedHypot. In Lua, the function gives a deprecated warning.

Inspired by the hyperwall fix for vanilla, except for everything. From little testing, actively improves waypoint checks, bumping, speed checks, wall collisions, Jawz targetting, Lightning Shield attacks, so on.

The only way I see this as a potential downgrade is A_Look (and related functions) getting slower, which are barely used in Kart.
2020-11-07 19:47:50 -05:00
Sally Coolatta
9b6aa946ea Merge remote-tracking branch 'srb2/master' into the-scary-22-merge 2020-10-24 19:28:06 -04:00
James R
9fb7ba77e4 Midtexture step up/down 2020-10-15 14:47:10 -07:00
James R
0bf00aad35 Condense variables, rename 'diff' to 'step' 2020-10-15 14:23:02 -07:00
James R
1db22403bb Guard with mobj?? 2020-10-15 04:30:48 -07:00
James R
75b3fffc04 AAAAAAAAAAA 2020-10-15 04:23:28 -07:00
James R
9723283055 FOF step down 2020-10-15 03:33:37 -07:00
James R
894860b9bc Step up fake floors 2020-10-15 02:58:29 -07:00
James R
3a4a687da0 Use height difference between front and backside of line when stepping down
This should fix the janky falling off steep slopes and let you cling to them.
Because when falling off a sector the edge of the player must not intersect
the edge of the higher sector, it is trickier than step up. The height
difference at the line must be stored to be useful.
2020-10-14 21:10:02 -07:00
James R
dab116a0bd CODE 2020-10-13 21:44:48 -07:00
James R
0d116b39c5 Compare height for step up on edge of sector
This is for slopes. When moving across a slope the height changes. Therefore
compare the height at the edge where slopes meet so only a wall will block the
player, and not a very steep slope.
2020-10-13 20:27:36 -07:00
Sally Coolatta
b5fcd74ef9 Merge master
Slopes in a few maps are really broken ... think it's anchors, I'm gonna leave that to jart :V
2020-09-25 12:00:50 -04:00
FlykeSpice
2d9ec1687c Remove POLYOBJECTS POLYOBJECTS_PLANES #ifdefs(backport from srb2 2.2) 2020-08-20 13:02:13 -04:00
FlykeSpice
2424418390 Remove ESLOPE #ifdef(backport from srb2 2.2) 2020-08-20 13:02:13 -04:00
Sally Coolatta
135e9b9797 f_finale now compiles 2020-08-11 23:13:25 -04:00
Jaime Passos
c385eca5d2 Merge branch 'next' of https://git.magicalgirl.moe/STJr/SRB2 into pictureformats 2020-07-06 19:29:14 -03:00
Sally Coolatta
0e79ec29be p_map & p_maputl merge conflicts 2020-05-30 13:53:30 -04: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
Louis-Antoine
74fa35221d Merge branch 'next' of https://git.magicalgirl.moe/STJr/SRB2.git into slope-cleanup
# Conflicts:
#	src/hardware/hw_main.c
#	src/p_spec.c
2020-05-18 16:14:05 +02:00
Jaime Passos
c69a4f9ced Merge remote-tracking branch 'origin/next' into pictureformats 2020-05-15 01:34:54 -03:00
MascaraSnake
8efec04051 Remove POLYOBJECTS and POLYOBJECTS_PLANES defines 2020-05-02 12:08:31 +02:00
Louis-Antoine
29294a53cc Encapsulate plane height checks 2020-03-22 17:28:50 +01:00
Louis-Antoine
3cf315f6da Fix typo in camera handling code 2020-03-22 15:21:23 +01:00