Commit graph

34 commits

Author SHA1 Message Date
Sryder
5cd1296505 Include license/copyright headers on new files. 2020-03-22 00:16:32 +00:00
Sryder
e874af3e43 Very minor fix to WRONG WAY
More opaque waypoint markers for kartdebugwaypoints
Looks like whitespace got murdered in k_kart.c again
2020-03-21 23:24:04 +00:00
Sryder
738d1f1940 Make kartdebugwaypoints far more clear to use for the debugging lines
Fix memory reallocation issue that I don't think could be seen currently
2020-03-21 21:32:40 +00:00
Sryder
3d3b8b6bc6 Replace many cases of if else if statements with I_Asserts.
This is done specifically on static functions that aren't used as callbacks.
This is done to keep the code cleaner, and the I_Asserts get compiled out in Release builds.
Logic is left in the "public" functions to avoid crashes as a result of the modules.
2020-03-21 19:00:00 +00:00
Sally Cochenour
263ef8f92c Use divide/multiply for waypoint closest calculations 2020-03-20 19:33:41 -04: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
Sally Cochenour
7fff21acd4 Instead of vertical cap, quadruple z axis distance
Far more natural results!
2020-03-03 16:58:09 -05:00
Sally Cochenour
ac1d40d6c5 Sight check for player waypoints 2020-03-03 16:14:19 -05:00
Sally Cochenour
1cbb4bea6b Limited vertical range on player waypoints 2020-03-03 15:47:02 -05:00
TehRealSalt
34e0b4b991 Radius was not made more coarse when I did the big-maps fix, so you were considered in every waypoint, meaning it worked exactly before I made this change in the first place
https://youtu.be/csnS0nszyuA
2019-10-27 17:18:22 -04:00
TehRealSalt
ed007f34cc change colors, since orange & yellow are pretty indistinguishable 2019-10-24 16:55:13 -04:00
TehRealSalt
fc03012749 Use facing angle while still
Also comment some of my additions a little better
2019-10-24 08:21:45 -04:00
TehRealSalt
3137e6e54a Parathesis for defines
Also just caught the ;, which could've mess up the define(?)
2019-10-22 17:41:00 -04:00
TehRealSalt
add1fb8794 Reduce precision of distance checks
Fixes huge maps, such as Dark Race
2019-10-22 17:05:46 -04: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
TehRealSalt
bca4f30ee3 Use defines here instead
I got a "initializer element is not constant" error when compiling. From a quick Google search, it seems that const-type variables aren't totally considered constants in C. There may be a better way to fix this error.
2019-09-25 07:17:14 -04:00
Sryder
ae344fa2bc Fix silly issue 2019-07-04 17:55:41 +01: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
04966f5613 Add missing function header comments to k_waypoint.c 2019-06-28 09:59:19 +01:00
Sryder
fbd72c149b Use correct formatting for size_t in Printf 2019-06-16 22:25:58 +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
7efe868c99 Loop through all the waypoint mobjs when setting up waypoints always
This means all the mobjs have waypoints setup and debugvisualise can work better.
2019-06-09 21:49:48 +01:00
Sryder
379ef52c25 Correct no next waypoint warning message. 2019-06-09 20:37:47 +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
c38be00196 Calculate euclidean distances between each waypoint on map load.
Change some Debug prints to Alert prints for easier debugging for mappers.
2019-06-02 21:44:07 +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
3efbe62a41 Fix a comment and other minor edits 2018-12-08 20:34:38 +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