Commit graph

24 commits

Author SHA1 Message Date
Eidolon
be021baa02 Add extern "C" in C++ to all headers 2022-12-30 19:26:16 -06: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
01b1a9d3a7 Prevent poh-bees on no-respawn waypoints 2022-09-15 21:44:45 -04:00
Sally Coolatta
5107160a27 Circuit pathfinding
An alternative to the standard pathfind function. Instead of pathfinding to a specific waypoint, it always goes towards the finish line waypoint, but also won't stop when it reaches it. It only stops when it travels a far enough distance.

This is basically a cleaner, less hacky, and optimized version of the pathfinding I gave to the bots; instead of doing 1-2 full pathfinds to do this (depending on if they are near the finish line or not), it will instead always do a single small pathfind. I also need it for shrink laser behavior.
2022-09-10 03:52:31 -04: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
James R
7c9824dc56 Multiply the default radius of 384 by mobjscale, but not user set radiuses 2020-05-04 17:54:43 -07:00
James R
e2d4ddcec2 SOC: DefaultWaypointRadius in the level header picardy 2020-05-04 17:39:11 -07:00
James R
89a2f8ec8d Thing type 2002, MT_WAYPOINT_RISER - Raise tagged waypoints in sector to FOF sorted by height
Thing height refers to the index of FOF. FOF are sorted by top height, lowest
to highest. Set Object Flip to sort highest to lowest.

If the waypoint thing set Object Flip, it will be placed on the bottom of the
FOF. The sorting remains the same though.

Set Ambush to raise the waypoint to the same z position.
2020-04-04 01:20:38 -07:00
Sryder
956222ad86 Fix joining netgames not loading up waypoints correctly.
Mobjs get deleted and loaded from net save. The mobjs in the waypoints need to load into the correct waypoints again.
This doesn't save/load the entire waypoints, so they still cannot be edited/added/removed mid-game.
2020-03-30 20:43:01 +01:00
Sryder
5cd1296505 Include license/copyright headers on new files. 2020-03-22 00:16:32 +00:00
Sally Cochenour
721fb369fd Move changes to K_GetBestWaypointForMobj so that K_GetClosestWaypointToMobj can stay the same 2020-03-03 18:34:17 -05:00
TehRealSalt
0fdcc22d93 - Only update to waypoints you're in the radius of (applies to players & spb)
- Player direction value uses momentum angle rather than facing angle (fixes weird nextwaypoint/position flickering while drifting)
- Raise default radius to 384
2019-10-22 16:44:56 -04:00
Sryder
19a2962413 Just remembered there's supposed to be a flag to determine if a waypoint can be spawned at 2019-06-30 22:14:20 +01:00
Sryder
6eca35aae1 SPB Now follows the track.
You better watch out, You better watch out, You better watch out!
2019-06-28 22:43:34 +01:00
Sryder
10adecb4a6 Improvements to player finish distances
Figure out the circuit length on map load
player->distancetofinish is now a total distance on circuit maps
some hacky alterations around circuit finish lines to correctly calculate distancetofinish
2019-06-28 21:11:26 +01:00
Sryder
49a8b0ac38 Add player's nextwaypoint to the player struct
Network synchronised(?) nextwaypoint in player struct
Make the waypointheap actually a heap and not allocate memory for every individual waypoint.
No need to store id in the waypoint struct, since it can be gotten from the waypointheap now.
2019-06-16 17:58:28 +01:00
Sryder
e937e35a78 Split pathfinding itself into its own module. 2019-06-12 23:43:55 +01:00
Sryder
4c26589d5c Add support for Finishline, shortcut, and disabled waypoints.
Remove warning that should be impossible to trip, and doesn't describe problem anymore.
2019-06-10 00:02:48 +01:00
Sryder
e9786fa956 Waypoint pathfinding exists!
Includes some small refactoring of older functions - single return is a bit safer and easier to debug.
Still needs doing are: Finish Line Waypoint, Shortcut waypoints, disabled waypoints.
The actual A* method itself is a bit of a monster, but I can't figure out how to refactor it too much more.
2019-06-09 19:49:21 +01:00
Sryder
ce4ba3141f Update to search functions to make them more extendable
Some more minor formatting changes
2019-02-04 21:50:14 +00:00
Sryder
79f381ebd4 Add visual debugging mode for waypoints
Fix some compiler warnings
2019-02-02 21:35:21 +00:00
Sryder
5fba15a58b Make waypoints setup on map load
Refactor some things to make slightly clearer code
Change comments to use completely tabs
Add extra error checks to methods for helpful debugging and safety
Use a heap of waypoints during creation to be able to search for them to make links, to not freeze the game
Add a way to clear waypoints so that the methods don't error after more than one map load
Flip the ambush flag so that adding it will make the waypoint unable to be respawned at when the feature happens
Temporarily disable K_UpdateKartPosition so that it doesn't crash on map load
2019-02-02 13:50:22 +00:00
Sryder
d1a10d70f5 Initial step of Waypoints
Basically just copied what I planned out months ago and put it into code for now
Also changed waypointcap to be made from MT_WAYPOINTs and definitely broke position in this commit from that.
2018-12-07 23:40:28 +00:00