blankart/src/k_cluster.hpp
yamamama 288add05ba Refactor clustering (again)
* For tinypop (6P or less), the cluster system activates as long as there are more than 3 players.
  * Tinypop clusters ignore the player in last and factor everyone in the lobby.
  * At around 5 to 6 players, clusters ignore the frontrunner.
  * In between 6 and 18 players, a "double cluster" system is in use that averages the distance of two cluster players and selects a cluster player from that.
  * The distance from the cluster necessary for Alt. Invin. to appear has been reduced to 6400 (this is a buff!)

Hoping this makes clustering way more reliable and fair
2025-12-14 00:02:55 -05:00

28 lines
No EOL
1.2 KiB
C++

#include "doomdef.h"
#include "d_player.h"
#include "m_fixed.h"
#ifdef __cplusplus
extern "C"
{
#endif
typedef boolean (playerfilter_f)(player_t *player, UINT32 filter_value);
extern player_t *closesttocluster;
fixed_t K_Distance3D(fixed_t x1, fixed_t y1, fixed_t z1, fixed_t x2, fixed_t y2, fixed_t z2);
UINT32 K_GetDTFDifference(player_t *source, player_t *destination);
// Literally allows any player to pass through.
boolean K_ClusterFilter_NoFilter(player_t *player, UINT32 fval);
boolean K_ClusterFilter_BaseFilter(player_t *player, UINT32 fval);
INT32 K_CountNeighboringPlayersByDistance(player_t *sourcePlayer, fixed_t eps, playerfilter_f *cluster_filter, UINT32 filterval, vector3_t *out, void *nodevec);
INT32 K_CountNeighboringPlayersByDTFEx(player_t *sourcePlayer, fixed_t eps, playerfilter_f *cluster_filter, UINT32 filterval, vector3_t *out, void *nodevec);
INT32 K_CountNeighboringPlayersByDTF(player_t *sourcePlayer, fixed_t eps, playerfilter_f *cluster_filter, UINT32 filterval, vector3_t *out);
INT32 K_CountNeighboringPlayers(player_t *sourcePlayer, fixed_t eps, playerfilter_f *cluster_filter, UINT32 filterval, vector3_t *out);
#ifdef __cplusplus
}
#endif