From 01688db2e2eae994a05a862aa6dcd0bfe56085db Mon Sep 17 00:00:00 2001 From: minenice55 Date: Tue, 14 Oct 2025 21:50:25 -0400 Subject: [PATCH 01/15] I'ma jumpstart this --- src/doomdef.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/doomdef.h b/src/doomdef.h index 02a2bfd1e..781310abf 100644 --- a/src/doomdef.h +++ b/src/doomdef.h @@ -201,7 +201,7 @@ extern char logfilename[1024]; // The maximum number of players, multiplayer/networking. // NOTE: it needs more than this to increase the number of players... -#define MAXPLAYERS 16 +#define MAXPLAYERS 32 #define PLAYERSMASK (MAXPLAYERS-1) #define MAXPLAYERNAME 21 #define MAXSPLITSCREENPLAYERS 4 // Max number of players on a single computer From 32311ac45de9d78f3004928bd573f953db7f9aef Mon Sep 17 00:00:00 2001 From: minenice55 Date: Tue, 14 Oct 2025 22:42:20 -0400 Subject: [PATCH 02/15] port rankings intermission from neptune will 100% need cleanup --- src/y_inter.c | 88 ++++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 70 insertions(+), 18 deletions(-) diff --git a/src/y_inter.c b/src/y_inter.c index e16c1afb9..b5d18b537 100644 --- a/src/y_inter.c +++ b/src/y_inter.c @@ -459,6 +459,10 @@ void Y_IntermissionDrawer(void) INT32 y = 41, gutter = ((data.numplayers > NUMFORNEWCOLUMN) ? 0 : (BASEVIDWIDTH/2)); INT32 dupadjust = (vid.width/vid.dupx), duptweak = (dupadjust - BASEVIDWIDTH)/2; const char *timeheader; + + boolean manyplayers16 = (data.numplayers > NUMFORNEWCOLUMN*2); + boolean manyplayers8 = (data.numplayers > NUMFORNEWCOLUMN); + int y2; if (data.rankingsmode) @@ -492,7 +496,17 @@ void Y_IntermissionDrawer(void) if (data.encore) V_DrawCenteredString(-4 + x + BASEVIDWIDTH/2, 12-8, hilicol, "ENCORE MODE"); - if (data.numplayers > NUMFORNEWCOLUMN) + if (manyplayers16) + { + V_DrawFill(x+101, 24, 1, 158, 0); + V_DrawFill(x+207, 24, 1, 158, 0); + V_DrawFill((x-3) - duptweak, 182, dupadjust-2, 1, 0); + + V_DrawRightAlignedString(x+152, 24, hilicol, timeheader); + + y = 37; + } + else if (manyplayers8) { V_DrawFill(x+156, 24, 1, 158, 0); V_DrawFill((x-3) - duptweak, 182, dupadjust-2, 1, 0); @@ -502,11 +516,13 @@ void Y_IntermissionDrawer(void) V_DrawRightAlignedString(x+152, 24, hilicol, timeheader); } - - V_DrawCenteredString(x+6, 24, hilicol, "#"); - V_DrawString(x+36, 24, hilicol, "NAME"); - - V_DrawRightAlignedString(x+(BASEVIDWIDTH/2)+152, 24, hilicol, timeheader); + else + { + V_DrawCenteredString(x+6, 24, hilicol, "#"); + V_DrawString(x+36, 24, hilicol, "NAME"); + + V_DrawRightAlignedString(x+(BASEVIDWIDTH/2)+152, 24, hilicol, timeheader); + } for (i = 0; i < data.numplayers; i++) { @@ -520,14 +536,26 @@ void Y_IntermissionDrawer(void) if (dojitter) y--; - V_DrawCenteredString(x+6, y, 0, va("%d", data.pos[i])); + if (manyplayers16) + V_DrawPingNum(x+6, y+2, 0, data.pos[i], NULL); + else + V_DrawCenteredString(x+6, y, 0, va("%d", data.pos[i])); if (data.color[i]) { UINT8 *colormap = R_GetTranslationColormap(*data.character[i], *data.color[i], GTC_CACHE); patch_t *facerank = faceprefix[*data.character[i]][FACE_RANK]; - V_DrawMappedPatch(x+16+facerank->leftoffset, y-4+facerank->topoffset, 0, facerank, colormap); + if (manyplayers16) + { + // fixed_t scale = K_UseHighResPortraits() ? FRACUNIT/4 : FRACUNIT/2; + fixed_t scale = FRACUNIT/2; + V_DrawFixedPatch((x+8)<leftoffset, y-4+facerank->topoffset, 0, facerank, colormap); + } } if (data.num[i] == whiteplayer) @@ -547,7 +575,9 @@ void Y_IntermissionDrawer(void) y2 = y; - if (data.numplayers > NUMFORNEWCOLUMN) + if (manyplayers16) + V_DrawThinString(x+18, y, hilicol|V_ALLOWLOWERCASE|V_6WIDTHSPACE, strtime); + else if (manyplayers8) V_DrawThinString(x+36, y2-1, ((data.num[i] == whiteplayer) ? hilicol : 0)|V_ALLOWLOWERCASE|V_6WIDTHSPACE, strtime); else V_DrawString(x+36, y2, ((data.num[i] == whiteplayer) ? hilicol : 0)|V_ALLOWLOWERCASE, strtime); @@ -571,7 +601,9 @@ void Y_IntermissionDrawer(void) else snprintf(strtime, sizeof strtime, "(%d)", data.increase[data.num[i]]); - if (data.numplayers > NUMFORNEWCOLUMN) + if (manyplayers16) + V_DrawRightAlignedThinString(x+83+gutter, y, V_6WIDTHSPACE, strtime); + else if (manyplayers8) V_DrawRightAlignedThinString(x+133+gutter, y-1, V_6WIDTHSPACE, strtime); else V_DrawRightAlignedString(x+118+gutter, y, 0, strtime); @@ -580,7 +612,9 @@ void Y_IntermissionDrawer(void) snprintf(strtime, sizeof strtime, "%d", data.val[i]); } - if (data.numplayers > NUMFORNEWCOLUMN) + if (manyplayers16) + V_DrawRightAlignedThinString(x+100+gutter, y, V_6WIDTHSPACE, strtime); + else if (manyplayers8) V_DrawRightAlignedThinString(x+152+gutter, y-1, V_6WIDTHSPACE, strtime); else V_DrawRightAlignedString(x+152+gutter, y, 0, strtime); @@ -597,14 +631,18 @@ void Y_IntermissionDrawer(void) G_TicsToSeconds(data.val[i]), G_TicsToCentiseconds(data.val[i])); strtime[sizeof strtime - 1] = '\0'; - if (data.numplayers > NUMFORNEWCOLUMN) + if (manyplayers16) + V_DrawRightAlignedThinString(x+100+gutter, y, V_6WIDTHSPACE, strtime); + else if (manyplayers8) V_DrawRightAlignedThinString(x+152+gutter, y-1, V_6WIDTHSPACE, strtime); else V_DrawRightAlignedString(x+152+gutter, y, 0, strtime); } else { - if (data.numplayers > NUMFORNEWCOLUMN) + if (manyplayers16) + V_DrawRightAlignedThinString(x+100+gutter, y, V_6WIDTHSPACE, va("%i", data.val[i])); + else if (manyplayers8) V_DrawRightAlignedThinString(x+152+gutter, y-1, V_6WIDTHSPACE, va("%i", data.val[i])); else V_DrawRightAlignedString(x+152+gutter, y, 0, va("%i", data.val[i])); @@ -618,13 +656,27 @@ void Y_IntermissionDrawer(void) else data.num[i] = MAXPLAYERS; // this should be the only field setting in this function - y += 18; - - if (i == NUMFORNEWCOLUMN-1) + if (manyplayers16) { - y = 41; - x += BASEVIDWIDTH/2; + y += 10; + + if (i % 14 == 13) + { + y = 37; + x += BASEVIDWIDTH/3; + } } + else + { + y += 18; + + if (i == NUMFORNEWCOLUMN-1) + { + y = 41; + x += BASEVIDWIDTH/2; + } + } + #undef NUMFORNEWCOLUMN } } From c9ee96010b15ff23c4de458d47dfbbee0929a632 Mon Sep 17 00:00:00 2001 From: minenice55 Date: Tue, 14 Oct 2025 22:58:06 -0400 Subject: [PATCH 03/15] idem for minirankings --- src/k_hud.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/k_hud.c b/src/k_hud.c index 5ec05bfc7..561050f8e 100644 --- a/src/k_hud.c +++ b/src/k_hud.c @@ -2141,10 +2141,12 @@ static boolean K_drawKartPositionFaces(void) else { INT32 pos = players[rankplayer[i]].position; - if (pos < 0 || pos > MAXPLAYERS) - pos = 0; + // Draws the little number over the face - V_DrawScaledPatch(FACE_X-5, Y+10, V_HUDTRANS|V_SNAPTOLEFT, kp_facenum[pos]); + if (pos < 0 || pos > 16) + V_DrawPingNum(FACE_X+2, Y+10, V_HUDTRANS|V_SNAPTOLEFT, pos, NULL); + else + V_DrawScaledPatch(FACE_X-5, Y+10, V_HUDTRANS|V_SNAPTOLEFT, kp_facenum[pos]); } Y -= 18; From 810d6a16e0ddd4df12060ebfc2d2694a6be8c774 Mon Sep 17 00:00:00 2001 From: minenice55 Date: Tue, 14 Oct 2025 22:59:35 -0400 Subject: [PATCH 04/15] fuck it the intermission rankings can fit this much --- src/doomdef.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/doomdef.h b/src/doomdef.h index 781310abf..b617215fe 100644 --- a/src/doomdef.h +++ b/src/doomdef.h @@ -201,7 +201,7 @@ extern char logfilename[1024]; // The maximum number of players, multiplayer/networking. // NOTE: it needs more than this to increase the number of players... -#define MAXPLAYERS 32 +#define MAXPLAYERS 42 #define PLAYERSMASK (MAXPLAYERS-1) #define MAXPLAYERNAME 21 #define MAXSPLITSCREENPLAYERS 4 // Max number of players on a single computer From b92417085ff9fcfea95bd0e31f8c024feff3ecef Mon Sep 17 00:00:00 2001 From: minenice55 Date: Tue, 14 Oct 2025 23:03:44 -0400 Subject: [PATCH 05/15] nuh uh --- src/p_mobj.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/p_mobj.c b/src/p_mobj.c index 67d2678bb..094a2b720 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -12741,9 +12741,9 @@ fixed_t P_GetMapThingSpawnHeight(const mobjtype_t mobjtype, const mapthing_t* mt static boolean P_SpawnNonMobjMapThing(mapthing_t *mthing) { -#if MAXPLAYERS > 32 - You should think about modifying the deathmatch starts to take full advantage of this! -#endif +// #if MAXPLAYERS > 32 +// You should think about modifying the deathmatch starts to take full advantage of this! +// #endif if (mthing->type <= MAXPLAYERS) // Player starts { // save spots for respawning in network games From 65dec93f7cd37cecd56ec9350e5803851ee384d9 Mon Sep 17 00:00:00 2001 From: minenice55 Date: Wed, 15 Oct 2025 14:34:13 -0400 Subject: [PATCH 06/15] add battle royale player start wrapping --- src/g_game.c | 10 +++++++--- src/p_mobj.c | 10 +++++----- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/src/g_game.c b/src/g_game.c index c9224d710..fa13030d7 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -3051,9 +3051,13 @@ mapthing_t *G_FindRaceStart(INT32 playernum) // Just spawn there. //return playerstarts[0]; - if (doprints) - CONS_Alert(CONS_WARNING, M_GetText("Could not spawn at any Race starts!\n")); - return NULL; + //this section courtesy of fickle - v1.1 battle royale + // screw collision chex + return playerstarts[pos % numcoopstarts]; + + // if (doprints) + // CONS_Alert(CONS_WARNING, M_GetText("Could not spawn at any Race starts!\n")); + // return NULL; } if (modeattacking != ATTACKING_ITEMBREAK) diff --git a/src/p_mobj.c b/src/p_mobj.c index 094a2b720..bc6b0b4bf 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -12794,11 +12794,11 @@ static boolean P_SpawnNonMobjMapThing(mapthing_t *mthing) { return true; // These are handled elsewhere. } - else if (mthing->type > MAXPLAYERS && mthing->type <= 32) // be wary of playerstarts size! playerstarts[MAXPLAYERS] - { - CONS_Alert(CONS_WARNING, "Excess player start detected %d\n", mthing->type); - return true; - } + // else if (mthing->type > MAXPLAYERS && mthing->type <= 32) // be wary of playerstarts size! playerstarts[MAXPLAYERS] + // { + // CONS_Alert(CONS_WARNING, "Excess player start detected %d\n", mthing->type); + // return true; + // } return false; } From da4add120f4b72d47cdb5eb100e2c8ace77d9195 Mon Sep 17 00:00:00 2001 From: minenice55 Date: Wed, 15 Oct 2025 14:47:06 -0400 Subject: [PATCH 07/15] ping num in neo tab ranking (will need additions later too) --- src/k_hud.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/k_hud.c b/src/k_hud.c index 561050f8e..3e3015a4c 100644 --- a/src/k_hud.c +++ b/src/k_hud.c @@ -2345,7 +2345,10 @@ INT32 K_DrawNeoTabRankings(INT32 x, INT32 y, playersort_t *tab, INT32 scorelines hightlightcolor = skincolors[players[tab[i].num].mo->color].chatcolor; } - V_DrawScaledPatch(x-5, y+1, 0, kp_facenum[pos]); + if (pos < 0 || pos > 16) + V_DrawPingNum(x+2, y+1, 0, pos, NULL); + else + V_DrawScaledPatch(x-5, y+1, 0, kp_facenum[pos]); x2 = netgame ? x + (BASEVIDWIDTH/20) : x; y2 = y; From 91924aac7d8cfab7ef11c8a5e9a383ce1004bf64 Mon Sep 17 00:00:00 2001 From: minenice55 Date: Wed, 15 Oct 2025 15:49:02 -0400 Subject: [PATCH 08/15] vote screen for high player count --- src/y_inter.c | 50 +++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 39 insertions(+), 11 deletions(-) diff --git a/src/y_inter.c b/src/y_inter.c index b5d18b537..67b190bfa 100644 --- a/src/y_inter.c +++ b/src/y_inter.c @@ -1224,7 +1224,7 @@ static fixed_t Y_CalculatePicScale(fixed_t picscale, INT32 hypoti) // void Y_VoteDrawer(void) { - INT32 rowval, i, lvls, x, picdiff, y = 0, height = 0; + INT32 rowval, i, px, lvls, x, picdiff, y = 0, height = 0; UINT8 selected[12]; fixed_t rubyheight = 0; fixed_t scale; @@ -1238,6 +1238,9 @@ void Y_VoteDrawer(void) fixed_t hypotf = 0; INT32 hypoti = 0; + INT32 numplayers = 0; + boolean highplayers = false; + // get the hypotenuse hypoti = (vidx*vidx) + (vidy*vidy); hypotf = FixedSqrt(hypoti); @@ -1481,8 +1484,25 @@ void Y_VoteDrawer(void) x = 20; y = 10; + for (px = 0; px < MAXPLAYERS; px++) + { + if (playeringame[px]) + { + numplayers++; + } + } + + highplayers = numplayers > 16; + for (i = 0; i < MAXPLAYERS; i++) { + INT32 bigaddx = 60; INT32 bigaddy = 30; + INT32 smalladdx = 42; INT32 smalladdy = 18; + INT32 smallfaceheight = 0; INT32 bigfaceheight = 9; + INT32 smallrectheight = 18; INT32 bigrectheight = 27; + INT32 smallrubyoffset = 4<width, scale))<width, scale))<leftoffset, y+9+facerank->topoffset, V_SNAPTOLEFT, facerank, colormap); + V_DrawMappedPatch(x+24+facerank->leftoffset, y+(highplayers ? smallfaceheight : bigfaceheight)+facerank->topoffset, V_SNAPTOLEFT, facerank, colormap); } if (!splitscreen && i == consoleplayer) { UINT8 cursorframe = (votetic / 4) % 8; patch_t *highlight = W_CachePatchName(va("K_CHILI%d", cursorframe+1), PU_CACHE); - V_DrawScaledPatch(x+24+highlight->leftoffset, y+9+highlight->topoffset, V_SNAPTOLEFT, highlight); + V_DrawScaledPatch(x+24+highlight->leftoffset, y+(highplayers ? smallfaceheight : bigfaceheight)+highlight->topoffset, V_SNAPTOLEFT, highlight); } } - y += 30; + y += highplayers ? smalladdy : bigaddy; if (y > BASEVIDHEIGHT-40) { - x += 60; + x += highplayers ? smalladdx : bigaddx; y = 10; } } From 0d079836eb152c46ea9899fb0459c1b1a87c4d3c Mon Sep 17 00:00:00 2001 From: minenice55 Date: Wed, 15 Oct 2025 19:28:17 -0400 Subject: [PATCH 09/15] 42 + server host (also use 42 playerinfo slots) --- src/doomdef.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/doomdef.h b/src/doomdef.h index c54224e8e..58a93fd23 100644 --- a/src/doomdef.h +++ b/src/doomdef.h @@ -103,7 +103,7 @@ extern "C" { // Special Hashing. //#define NOFILEHASH -//#define NOVERIFYIWADS +#define NOVERIFYIWADS // Uncheck this to compile debugging code //#define RANGECHECK @@ -201,7 +201,7 @@ extern char logfilename[1024]; // The maximum number of players, multiplayer/networking. // NOTE: it needs more than this to increase the number of players... -#define MAXPLAYERS 42 +#define MAXPLAYERS 43 // 42 + host slot #define PLAYERSMASK (MAXPLAYERS-1) #define MAXPLAYERNAME 21 #define MAXSPLITSCREENPLAYERS 4 // Max number of players on a single computer @@ -219,7 +219,7 @@ extern char logfilename[1024]; #define ENCOREFADECOLOR 209 // 122 // Master Server compatibility ONLY -#define MSCOMPAT_MAXPLAYERS (32) +#define MSCOMPAT_MAXPLAYERS (42) // State updates, number of tics / second. // NOTE: used to setup the timer rate, see I_StartupTimer(). From de3697dec052c2882e356cab5dfe6d8f310b1499 Mon Sep 17 00:00:00 2001 From: minenice55 Date: Thu, 16 Oct 2025 23:29:08 -0400 Subject: [PATCH 10/15] tweaks to intermission score tally --- src/y_inter.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/y_inter.c b/src/y_inter.c index 67b190bfa..ce2cf2b19 100644 --- a/src/y_inter.c +++ b/src/y_inter.c @@ -558,7 +558,7 @@ void Y_IntermissionDrawer(void) } } - if (data.num[i] == whiteplayer) + if (data.num[i] == whiteplayer && data.numplayers <= NUMFORNEWCOLUMN*2) { UINT8 cursorframe = (intertic / 4) % 8; patch_t *highlight = W_CachePatchName(va("K_CHILI%d", cursorframe+1), PU_CACHE); @@ -568,7 +568,16 @@ void Y_IntermissionDrawer(void) if ((players[data.num[i]].pflags & PF_NOCONTEST) && players[data.num[i]].bot) { // RETIRED!! - V_DrawScaledPatch(x+12, y-7, 0, W_CachePatchName("K_NOBLNS", PU_CACHE)); + patch_t *retire = W_CachePatchName("K_NOBLNS", PU_CACHE); + if (manyplayers16) + { + fixed_t scale = FRACUNIT/2; + V_DrawFixedPatch(x+6, y-3, scale, 0, retire, NULL); + } + else + { + V_DrawScaledPatch(x+12, y-7, 0, retire); + } } STRBUFCPY(strtime, data.name[i]); @@ -622,7 +631,7 @@ void Y_IntermissionDrawer(void) else { if (data.val[i] == (UINT32_MAX-1)) - V_DrawRightAlignedThinString(x+152+gutter, y-1, (data.numplayers > NUMFORNEWCOLUMN ? V_6WIDTHSPACE : 0), "NO CONTEST."); + V_DrawRightAlignedThinString(x+(manyplayers16 ? 100 : 152)+gutter, y-1, (manyplayers8 ? V_6WIDTHSPACE : 0), "NO CONTEST."); else { if (intertype == int_race || intertype == int_battletime) From ff7dea704c9158eb14e4b4edc7c21c649547ad17 Mon Sep 17 00:00:00 2001 From: minenice55 Date: Fri, 17 Oct 2025 15:25:21 -0400 Subject: [PATCH 11/15] thing saturn 126p does --- src/d_clisrv.c | 2 +- src/doomdef.h | 2 +- src/i_net.h | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/d_clisrv.c b/src/d_clisrv.c index 256f5dfe1..36b474201 100644 --- a/src/d_clisrv.c +++ b/src/d_clisrv.c @@ -4495,7 +4495,7 @@ static void HandlePlayerInfo(SINT8 node) { (void)node; doomdata_t *netbuffer = DOOMCOM_DATA(doomcom); - for (INT32 i = 0; i < MAXPLAYERS; i++) + for (INT32 i = 0; i < MSCOMPAT_MAXPLAYERS; i++) { playerinfo[i] = netbuffer->u.playerinfo[i]; } diff --git a/src/doomdef.h b/src/doomdef.h index eaa694e4e..84e5327de 100644 --- a/src/doomdef.h +++ b/src/doomdef.h @@ -207,7 +207,7 @@ extern char logfilename[1024]; #define ENCOREFADECOLOR 209 // 122 // Master Server compatibility ONLY -#define MSCOMPAT_MAXPLAYERS (42) +#define MSCOMPAT_MAXPLAYERS (32) // State updates, number of tics / second. // NOTE: used to setup the timer rate, see I_StartupTimer(). diff --git a/src/i_net.h b/src/i_net.h index 1d85d860a..aeb2ffc69 100644 --- a/src/i_net.h +++ b/src/i_net.h @@ -22,10 +22,10 @@ /// \def MAXPACKETLENGTH /// For use in a LAN -#define MAXPACKETLENGTH 1450 +#define MAXPACKETLENGTH 2048 /// \def INETPACKETLENGTH /// For use on the internet -#define INETPACKETLENGTH 1024 +#define INETPACKETLENGTH 1450 #define NO_BAN_TIME (time_t)(-1) From 27b22fee94c247e85328fa66dd40a076aea5c2a4 Mon Sep 17 00:00:00 2001 From: GenericHeroGuy Date: Fri, 17 Oct 2025 21:39:22 +0200 Subject: [PATCH 12/15] I have a better idea... --- src/d_clisrv.c | 14 ++++++-------- src/d_clisrv.h | 17 ++--------------- src/doomdef.h | 5 ++--- src/i_net.h | 4 ++-- src/m_menu.c | 2 +- src/p_enemy.c | 4 ++-- src/p_mobj.c | 4 ++-- src/typedef.h | 1 - 8 files changed, 17 insertions(+), 34 deletions(-) diff --git a/src/d_clisrv.c b/src/d_clisrv.c index 36b474201..fc945fc7c 100644 --- a/src/d_clisrv.c +++ b/src/d_clisrv.c @@ -85,6 +85,8 @@ #define MAX_REASONLENGTH 30 #define FORCECLOSE 0x8000 +I_StaticAssert(sizeof(doomdata_t) < MAXPACKETLENGTH); // can't send a packet larger than the max packet length! + boolean server = true; // true or false but !server == client #define client (!server) boolean nodownload = false; @@ -93,7 +95,7 @@ INT32 serverplayer = 0; char motd[254], server_context[8]; // Message of the Day, Unique Context (even without Mumble support) UINT8 playerconsole[MAXPLAYERS]; -plrinfo playerinfo[MAXPLAYERS]; +plrinfo playerinfo[MAXPLAYERINFO]; // Server specific vars UINT8 playernode[MAXPLAYERS]; @@ -1067,7 +1069,7 @@ static void SV_SendPlayerInfo(INT32 node) doomdata_t *netbuffer = DOOMCOM_DATA(doomcom); netbuffer->packettype = PT_PLAYERINFO; - for (i = 0; i < MSCOMPAT_MAXPLAYERS; i++) + for (i = 0; i < MAXPLAYERINFO; i++) { if (i >= MAXPLAYERS || playernode[i] == UINT8_MAX || !playeringame[i]) { @@ -1081,10 +1083,6 @@ static void SV_SendPlayerInfo(INT32 node) netbuffer->u.playerinfo[i].name[MAXPLAYERNAME] = '\0'; - //fetch IP address - //No, don't do that, you fuckface. - memset(netbuffer->u.playerinfo[i].address, 0, 4); - if (G_GametypeHasTeams()) { if (!players[i].ctfteam) @@ -1108,7 +1106,7 @@ static void SV_SendPlayerInfo(INT32 node) netbuffer->u.playerinfo[i].data = 0; //players[i].skincolor; } - HSendPacket(node, false, 0, sizeof(plrinfo) * MSCOMPAT_MAXPLAYERS); + HSendPacket(node, false, 0, sizeof(plrinfo) * MAXPLAYERINFO); } /** Sends a PT_SERVERCFG packet @@ -4495,7 +4493,7 @@ static void HandlePlayerInfo(SINT8 node) { (void)node; doomdata_t *netbuffer = DOOMCOM_DATA(doomcom); - for (INT32 i = 0; i < MSCOMPAT_MAXPLAYERS; i++) + for (INT32 i = 0; i < MAXPLAYERINFO; i++) { playerinfo[i] = netbuffer->u.playerinfo[i]; } diff --git a/src/d_clisrv.h b/src/d_clisrv.h index f1c876dff..e138b3dba 100644 --- a/src/d_clisrv.h +++ b/src/d_clisrv.h @@ -327,7 +327,6 @@ struct plrinfo { UINT8 num; char name[MAXPLAYERNAME+1]; - UINT8 address[4]; // sending another string would run us up against MAXPACKETLENGTH UINT8 team; UINT16 skin; UINT8 data; // Color is first four bits, hasflag, isit and issuper have one bit each, the last is unused. @@ -335,17 +334,6 @@ struct plrinfo UINT16 timeinserver; // In seconds. } ATTRPACK; -// Shortest player information for join during intermission. -struct plrconfig -{ - char name[MAXPLAYERNAME+1]; - UINT16 skin; - UINT16 color; - UINT32 pflags; - UINT32 score; - UINT8 ctfteam; -} ATTRPACK; - struct filesneededconfig_pak { INT32 first; @@ -392,8 +380,7 @@ struct doomdata_t serverinfoupdate_pak serverinfoupdate; askinfo_pak askinfo; msaskinfo_pak msaskinfo; - plrinfo playerinfo[MSCOMPAT_MAXPLAYERS]; - plrconfig playerconfig[MAXPLAYERS]; + plrinfo playerinfo[MAXPLAYERINFO]; INT32 filesneedednum; filesneededconfig_pak filesneededcfg; netinfo_pak netinfo; @@ -580,7 +567,7 @@ extern char motd[254], server_context[8]; extern UINT8 playernode[MAXPLAYERS]; /* consoleplayer of this player (splitscreen) */ extern UINT8 playerconsole[MAXPLAYERS]; -extern plrinfo playerinfo[MAXPLAYERS]; +extern plrinfo playerinfo[MAXPLAYERINFO]; extern SINT8 joinnode; #define SERVMUS_1 "SRVMS1" diff --git a/src/doomdef.h b/src/doomdef.h index 84e5327de..ee9e6c2d9 100644 --- a/src/doomdef.h +++ b/src/doomdef.h @@ -190,7 +190,6 @@ extern char logfilename[1024]; // NOTE: it needs more than this to increase the number of players... #define MAXPLAYERS 43 // 42 + host slot -#define PLAYERSMASK (MAXPLAYERS-1) #define MAXPLAYERNAME 21 #define MAXSPLITSCREENPLAYERS 4 // Max number of players on a single computer #define MAXGAMEPADS (MAXSPLITSCREENPLAYERS * 2) // Number of gamepads we'll be allowing @@ -206,8 +205,8 @@ extern char logfilename[1024]; #define FADECOLOR 0 // 120 #define ENCOREFADECOLOR 209 // 122 -// Master Server compatibility ONLY -#define MSCOMPAT_MAXPLAYERS (32) +// the highest number of playerinfo entries we can fit into a single packet +#define MAXPLAYERINFO 42 // State updates, number of tics / second. // NOTE: used to setup the timer rate, see I_StartupTimer(). diff --git a/src/i_net.h b/src/i_net.h index aeb2ffc69..1d85d860a 100644 --- a/src/i_net.h +++ b/src/i_net.h @@ -22,10 +22,10 @@ /// \def MAXPACKETLENGTH /// For use in a LAN -#define MAXPACKETLENGTH 2048 +#define MAXPACKETLENGTH 1450 /// \def INETPACKETLENGTH /// For use on the internet -#define INETPACKETLENGTH 1450 +#define INETPACKETLENGTH 1024 #define NO_BAN_TIME (time_t)(-1) diff --git a/src/m_menu.c b/src/m_menu.c index ad10169a9..7bd5751ee 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -8790,7 +8790,7 @@ void MD_DrawViewServer(void) if (playeramount > 0) { - for (i = 0; i < MAXPLAYERS; i++) + for (i = 0; i < MAXPLAYERINFO; i++) { if (playerinfo[i].num < 255) { diff --git a/src/p_enemy.c b/src/p_enemy.c index f7bfe41cd..36ce44d69 100644 --- a/src/p_enemy.c +++ b/src/p_enemy.c @@ -449,9 +449,9 @@ boolean P_LookForPlayers(mobj_t *actor, boolean allaround, boolean tracer, fixed actor->lastlook %= MAXPLAYERS; - stop = (actor->lastlook - 1) & PLAYERSMASK; + stop = (actor->lastlook - 1) % MAXPLAYERS; - for (; ; actor->lastlook = (actor->lastlook + 1) & PLAYERSMASK) + for (; ; actor->lastlook = (actor->lastlook + 1) % MAXPLAYERS) { // done looking if (actor->lastlook == stop) diff --git a/src/p_mobj.c b/src/p_mobj.c index 0649e71ef..3af1c872b 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -4296,9 +4296,9 @@ boolean P_BossTargetPlayer(mobj_t *actor, boolean closest) // first time init, this allow minimum lastlook changes if (actor->lastlook < 0) actor->lastlook = P_RandomByte(); - actor->lastlook &= PLAYERSMASK; + actor->lastlook %= MAXPLAYERS; - for( ; ; actor->lastlook = (actor->lastlook+1) & PLAYERSMASK) + for( ; ; actor->lastlook = (actor->lastlook+1) % MAXPLAYERS) { // save the first look so we stop next time. if (stop < 0) diff --git a/src/typedef.h b/src/typedef.h index 9db93cd6a..9db777746 100644 --- a/src/typedef.h +++ b/src/typedef.h @@ -66,7 +66,6 @@ TYPEDEF (serverinfoupdate_pak); TYPEDEF (askinfo_pak); TYPEDEF (msaskinfo_pak); TYPEDEF (plrinfo); -TYPEDEF (plrconfig); TYPEDEF (filesneededconfig_pak); TYPEDEF (doomdata_t); TYPEDEF (serverelem_t); From dffc6eb3e3a2831fc3588606e4ba06498b05d5bc Mon Sep 17 00:00:00 2001 From: minenice55 Date: Fri, 17 Oct 2025 22:21:43 -0400 Subject: [PATCH 13/15] get this to actually run in a netgame capping to 32 now because netsync breaks with more players --- src/doomdef.h | 4 ++-- src/i_net.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/doomdef.h b/src/doomdef.h index ee9e6c2d9..b65ed0527 100644 --- a/src/doomdef.h +++ b/src/doomdef.h @@ -189,7 +189,7 @@ extern char logfilename[1024]; // The maximum number of players, multiplayer/networking. // NOTE: it needs more than this to increase the number of players... -#define MAXPLAYERS 43 // 42 + host slot +#define MAXPLAYERS 32 // 32 + host slot #define MAXPLAYERNAME 21 #define MAXSPLITSCREENPLAYERS 4 // Max number of players on a single computer #define MAXGAMEPADS (MAXSPLITSCREENPLAYERS * 2) // Number of gamepads we'll be allowing @@ -206,7 +206,7 @@ extern char logfilename[1024]; #define ENCOREFADECOLOR 209 // 122 // the highest number of playerinfo entries we can fit into a single packet -#define MAXPLAYERINFO 42 +#define MAXPLAYERINFO 32 // State updates, number of tics / second. // NOTE: used to setup the timer rate, see I_StartupTimer(). diff --git a/src/i_net.h b/src/i_net.h index 1d85d860a..aeb2ffc69 100644 --- a/src/i_net.h +++ b/src/i_net.h @@ -22,10 +22,10 @@ /// \def MAXPACKETLENGTH /// For use in a LAN -#define MAXPACKETLENGTH 1450 +#define MAXPACKETLENGTH 2048 /// \def INETPACKETLENGTH /// For use on the internet -#define INETPACKETLENGTH 1024 +#define INETPACKETLENGTH 1450 #define NO_BAN_TIME (time_t)(-1) From 6d0a7552b2f9b318f103da79c91ac7222f6e417c Mon Sep 17 00:00:00 2001 From: minenice55 Date: Sat, 18 Oct 2025 15:01:06 -0400 Subject: [PATCH 14/15] max GP players --- src/doomdef.h | 2 ++ src/k_grandprix.c | 28 ++++++++++++++-------------- 2 files changed, 16 insertions(+), 14 deletions(-) diff --git a/src/doomdef.h b/src/doomdef.h index b65ed0527..5e13511e3 100644 --- a/src/doomdef.h +++ b/src/doomdef.h @@ -201,6 +201,8 @@ extern char logfilename[1024]; #define MAXCOLORNAME 32 #define NUMCOLORFREESLOTS 32768 +#define MAXGPPLAYERS 16 // max players in Grand Prix only + // surely nobody's gonna change the palette a second time :Clueless: #define FADECOLOR 0 // 120 #define ENCOREFADECOLOR 209 // 122 diff --git a/src/k_grandprix.c b/src/k_grandprix.c index 464655449..70ab3acf1 100644 --- a/src/k_grandprix.c +++ b/src/k_grandprix.c @@ -104,7 +104,7 @@ UINT8 K_GetGPPlayerCount(UINT8 humans) // 3P -> 12 total // 4P -> 16 total - return max(min(humans * 4, MAXPLAYERS), 8); + return max(min(humans * 4, MAXGPPLAYERS), 8); } /*-------------------------------------------------- @@ -117,7 +117,7 @@ void K_InitGrandPrixBots(void) const UINT16 defaultbotskin = K_BotDefaultSkin(); const UINT8 startingdifficulty = K_BotStartingDifficulty(grandprixinfo.gamespeed); - UINT8 difficultylevels[MAXPLAYERS]; + UINT8 difficultylevels[MAXGPPLAYERS]; UINT8 playercount = 8; UINT8 wantedbots = 0; @@ -128,13 +128,13 @@ void K_InitGrandPrixBots(void) UINT16 usableskins, skincount = numskins; UINT16 grabskins[MAXSKINS+1]; - UINT16 botskinlist[MAXPLAYERS]; + UINT16 botskinlist[MAXGPPLAYERS]; UINT16 botskinlistpos = 0; UINT8 newplayernum = 0; UINT16 i, j; - memset(competitors, MAXPLAYERS, sizeof (competitors)); + memset(competitors, MAXGPPLAYERS, sizeof (competitors)); memset(botskinlist, defaultbotskin, sizeof (botskinlist)); // Init usable bot skins list @@ -144,7 +144,7 @@ void K_InitGrandPrixBots(void) } grabskins[usableskins] = MAXSKINS; -#if MAXPLAYERS != 16 +#if MAXGPPLAYERS != 16 I_Error("GP bot difficulty levels need rebalanced for the new player count!\n"); #endif @@ -178,7 +178,7 @@ void K_InitGrandPrixBots(void) { if (playeringame[i]) { - if (players[i].bot == true) + if (players[i].bot == true || i > MAXGPPLAYERS) { // Remove existing bots. CL_RemovePlayer(i, KR_LEAVE); @@ -298,7 +298,7 @@ static INT16 K_RivalScore(player_t *bot) roundsleft = grandprixinfo.cup->numlevels - grandprixinfo.roundnum; } - for (i = 0; i < MAXPLAYERS; i++) + for (i = 0; i < MAXGPPLAYERS; i++) { if (!playeringame[i] || players[i].spectator) { @@ -335,7 +335,7 @@ void K_UpdateGrandPrixBots(void) UINT16 newrivalscore = 0; UINT8 i; - for (i = 0; i < MAXPLAYERS; i++) + for (i = 0; i < MAXGPPLAYERS; i++) { if (!playeringame[i] || !players[i].bot) { @@ -346,7 +346,7 @@ void K_UpdateGrandPrixBots(void) } // Find the rival. - for (i = 0; i < MAXPLAYERS; i++) + for (i = 0; i < MAXGPPLAYERS; i++) { if (!playeringame[i] || players[i].spectator || !players[i].bot) { @@ -382,7 +382,7 @@ void K_UpdateGrandPrixBots(void) } // Find the bot with the best average of score & difficulty. - for (i = 0; i < MAXPLAYERS; i++) + for (i = 0; i < MAXGPPLAYERS; i++) { UINT16 ns = 0; @@ -440,7 +440,7 @@ static UINT8 K_BotExpectedStanding(player_t *bot) UINT8 pos = 1; UINT8 i; - for (i = 0; i < MAXPLAYERS; i++) + for (i = 0; i < MAXGPPLAYERS; i++) { if (i == (bot - players)) { @@ -589,7 +589,7 @@ void K_RetireBots(void) newDifficulty = 1; } - for (i = 0; i < MAXPLAYERS; i++) + for (i = 0; i < MAXGPPLAYERS; i++) { player_t *bot = NULL; @@ -608,7 +608,7 @@ void K_RetireBots(void) } } - for (i = 0; i < MAXPLAYERS; i++) + for (i = 0; i < MAXGPPLAYERS; i++) { player_t *bot = NULL; @@ -660,7 +660,7 @@ void K_FakeBotResults(player_t *bot) UINT8 numplayers = 0; UINT8 i; - for (i = 0; i < MAXPLAYERS; i++) + for (i = 0; i < MAXGPPLAYERS; i++) { if (playeringame[i] && !players[i].spectator) { From 2a09d1628201e7b24623dc975cbf7d983d22001d Mon Sep 17 00:00:00 2001 From: minenice55 Date: Sat, 18 Oct 2025 15:05:16 -0400 Subject: [PATCH 15/15] don't touch non-gp methods that are in the gp class (lol) --- src/k_grandprix.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/k_grandprix.c b/src/k_grandprix.c index 70ab3acf1..9122e8104 100644 --- a/src/k_grandprix.c +++ b/src/k_grandprix.c @@ -589,7 +589,7 @@ void K_RetireBots(void) newDifficulty = 1; } - for (i = 0; i < MAXGPPLAYERS; i++) + for (i = 0; i < MAXPLAYERS; i++) { player_t *bot = NULL; @@ -608,7 +608,7 @@ void K_RetireBots(void) } } - for (i = 0; i < MAXGPPLAYERS; i++) + for (i = 0; i < MAXPLAYERS; i++) { player_t *bot = NULL; @@ -660,7 +660,7 @@ void K_FakeBotResults(player_t *bot) UINT8 numplayers = 0; UINT8 i; - for (i = 0; i < MAXGPPLAYERS; i++) + for (i = 0; i < MAXPLAYERS; i++) { if (playeringame[i] && !players[i].spectator) {