CLIENT/SERVER: Spike peer review fixes

This commit is contained in:
cypress 2023-12-02 11:06:39 -05:00
parent 045914d984
commit 987628e791
12 changed files with 148 additions and 237 deletions

View file

@ -202,25 +202,10 @@ string buttonBind[MAX_BINDS];
string tempBind[MAX_BINDS];
// resolution
#define MAX_43 3
#define MAX_54 1
#define MAX_1610 5
#define MAX_169 10
#define MAX_219 2
float aspectratio;
float fullscreenval;
float active_swidth;
float active_sheight;
float screen_width_43[MAX_43];
float screen_height_43[MAX_43];
float screen_width_54[MAX_54];
float screen_height_54[MAX_54];
float screen_width_1610[MAX_1610];
float screen_height_1610[MAX_1610];
float screen_width_169[MAX_169];
float screen_height_169[MAX_169];
float screen_width_219[MAX_219];
float screen_height_219[MAX_219];
int platform_is_web;
@ -259,4 +244,54 @@ float hide_viewmodel;
// csqc player prediction by eukara
vector playerOrigin;
vector playerOriginOld;
vector playerVelocity;
vector playerVelocity;
//
// Screen sizes, self-explanatory.
//
var struct screenres_s
{
float width;
float height;
};
screenres_s screen_resolution_5x4[] =
{
{1280, 1024}
};
screenres_s screen_resolution_4x3[] =
{
{640, 480},
{800, 600},
{1024, 768}
};
screenres_s screen_resolution_16x9[] =
{
{640, 360},
{1280, 720},
{1360, 768},
{1366, 768},
{1536, 864},
{1600, 900},
{1920, 1080},
{2048, 1152},
{2560, 1440},
{3840, 2160}
};
screenres_s screen_resolution_16x10[] =
{
{1280, 800},
{1440, 900},
{1680, 1050},
{1920, 1200},
{2560, 1600}
};
screenres_s screen_resolution_21x9[] =
{
{2560, 1080},
{3840, 1440}
};

View file

@ -13,7 +13,7 @@ Available options:
-O - write to a different qc file
*/
#pragma noref 1
#pragma target FTE
#pragma target fte_5768
//#pragma flag enable logicops
#pragma warning error Q101 /*too many parms*/
#pragma warning error Q105 /*too few parms*/

View file

@ -103,61 +103,11 @@ noref void(float apiver, string enginename, float enginever) CSQC_Init =
buttonBind[12] = "+button3";
buttonBind[13] = "impulse 33";
// intialize screen resolutions
// default/current width and height
active_swidth = cvar("vid_width");
active_sheight = cvar("vid_height");
fullscreenval = cvar("vid_fullscreen");
// 5:4
screen_width_54[0] = 1280;
screen_height_54[0] = 1024;
//4:3
screen_width_43[0] = 640;
screen_height_43[0] = 480;
screen_width_43[1] = 800;
screen_height_43[1] = 600;
screen_width_43[2] = 1024;
screen_height_43[2] = 768;
//16:10
screen_width_1610[0] = 1280;
screen_height_1610[0] = 800;
screen_width_1610[1] = 1440;
screen_height_1610[1] = 900;
screen_width_1610[2] = 1680;
screen_height_1610[2] = 1050;
screen_width_1610[3] = 1920;
screen_height_1610[3] = 1200;
screen_width_1610[4] = 2560;
screen_height_1610[4] = 1600;
//16:9
screen_width_169[0] = 640;
screen_height_169[0] = 360;
screen_width_169[1] = 1280;
screen_height_169[1] = 720;
screen_width_169[2] = 1360;
screen_height_169[2] = 768;
screen_width_169[3] = 1366;
screen_height_169[3] = 768;
screen_width_169[4] = 1536;
screen_height_169[4] = 864;
screen_width_169[5] = 1600;
screen_height_169[5] = 900;
screen_width_169[6] = 1920;
screen_height_169[6] = 1080;
screen_width_169[7] = 2048;
screen_height_169[7] = 1152;
screen_width_169[8] = 2560;
screen_height_169[8] = 1440;
screen_width_169[9] = 3840;
screen_height_169[9] = 2160;
//21:9
screen_width_219[0] = 2560;
screen_height_219[0] = 1080;
screen_width_219[1] = 3440;
screen_height_219[1] = 1440;
// cvars for custom settings
autocvar(cl_adsmode, 0);
autocvar(cl_cinematic, 0);
@ -222,7 +172,7 @@ noref void() CSQC_WorldLoaded =
//precache_model("models/blood.iqm");
if(!player)
player = edict_num(player_localnum);
player = findfloat(world, entnum, player_localnum);
if(!vmodel)
vmodel = spawn();
if(!v2model)
@ -511,6 +461,12 @@ void() Update_Vmodel =
float Player_PreDraw() =
{
self.lerpfrac -= frametime*10;
while(self.lerpfrac < 0) {
self.frame2 = self.frame;
self.lerpfrac += 1;
}
if (self.entnum == player_localentnum) {
self.movetype = MOVETYPE_WALK;
// Prepare rollback
@ -586,26 +542,29 @@ noref void(float isnew) CSQC_Ent_Update =
self.origin_x = readcoord();
self.origin_y = readcoord();
self.origin_z = readcoord();
self.angles_x = readcoord();
self.angles_y = readcoord();
self.angles_z = readcoord();
self.angles_x = readangle();
self.angles_y = readangle();
self.angles_z = readangle();
self.velocity_x = readshort();
self.velocity_y = readshort();
self.velocity_z = readshort();
self.playernum = readfloat();
self.model = readstring();
self.playernum = readbyte();
self.modelindex = readshort();
self.frame = readbyte();
self.movetype = readshort();
self.flags = readfloat();
self.stance = readbyte();
self.scale = 1.4;
setmodel(self, self.model);
setmodelindex(self, self.modelindex);
if (self.stance == 2)
setsize(self, [-16, -16, -32], [16, 16, 40]);
setsize(self, PLAYER_MINS_STANDING, PLAYER_MAXS_STANDING);
else
setsize(self, [-16, -16, -32], [16, 16, 4]);
setorigin(self, self.origin);
setsize(self, PLAYER_MINS_CROUCHING, PLAYER_MAXS_CROUCHING);
//setorigin(self, self.origin);
} else {
if(isnew)
addentity(self);
@ -653,241 +612,162 @@ string() LoadScreen_GiveTip =
{
case 1:
return "Released in 1996, Quake is over 25 years old!";
break;
case 2:
return "Use the Kar98k to be the hero we need!";
break;
case 3:
return "Lots of modern engines are based on Quake!";
break;
case 4:
return "NZ:P began development on September 27 2009!";
break;
case 5:
return "NZ:P was first released on December 25, 2010!";
break;
case 6:
return "NZ:P Beta 1.1 has over 300,000 downloads!";
break;
case 7:
return "NZ:P has been downloaded over 500,000 times!";
break;
case 8:
return "A lot of people have worked on NZ:P!";
break;
case 9:
return "Blubswillrule, or \"blubs\", is from the US.";
break;
case 10:
return "Jukki is from Finland.";
break;
case 11:
return "Ju[s]tice, or \"tom\" is from Lithuania.";
break;
case 12:
return "This game has given us bad sleeping habits!";
break;
case 13:
return "We had a lot of fun making this game!";
break;
case 14:
return "Pro Tip: you can make your own custom map!";
break;
case 15:
return "Try Retro Mode, it's in the Graphics Settings!";
break;
case 16:
return "Tired of our maps? Go make your own!";
break;
case 17:
return "Slay zombies & be grateful.";
break;
case 18:
return "Custom maps, CUSTOM MAPS!";
break;
case 19:
return "Go outside & build a snowman!";
break;
case 20:
return "Please surround yourself with zombies!";
break;
case 21:
return "Don't play for too long.. zombies may eat you.";
break;
case 22:
return "That was epic... EPIC FOR THE WIIIN!"; //why
break;
case 23:
return "FTEQW is an awesome Quake Engine!";
break;
case 24:
return "You dead yet?";
break;
case 25:
return "Now 21% cooler!";
break;
case 26:
return "your lg is nothink on the lan!"; //what
break;
case 27:
return "I'm not your chaotic on dm6!";
break;
case 28:
return "Shoot or knife zombies to kill them, up to you!";
break;
case 29:
return "How many people forgot to Compile today?";
break;
case 30:
return "ggnore";
break;
case 31:
return "NZ:P is also on PC, Switch, Vita, and PSP!";
break;
case 32:
return "Submerge your device in water for godmode!";
break;
case 33:
return "10/10/10 was a good day.";
break;
case 34:
return "Also check out \"FreeCS\" by eukara!";
break;
case 35:
return "CypressImplex, or \"Ivy\", is from the USA.";
break;
case 36:
return "Zombies don't like bullets.";
break;
case 37:
return "Thanks for being an awesome fan!";
break;
case 38:
return "Removed Herobrine";
break;
case 39:
return "Pack-a-Punch the Kar98k to get to round 100000.";
break;
case 40:
return "I feel like I'm being gaslit.";
break;
case 41:
return "Heads up! You will die if you are killed!";
break;
case 42:
return "Zombies legally can't kill you if you say no!";
break;
case 43:
return "Please help me find the meaning of . Thanks.";
break;
case 44:
return "Discord is ONLY for Thomas the Tank Engine RP!";
break;
case 45:
return "\"Get rid of the 21% tip, it's an MLP reference.\"";
break;
case 46:
return "You're playing on FTE!";
break;
case 47:
return "Don't leak the beta!";
break;
case 48:
return "Jugger-Nog increases your health!";
break;
case 49:
return "greg was here";
break;
case 50:
return "Where the hell is the Mystery Box?!";
break;
case 51:
return "Zombies like getting shot.. I think.";
break;
case 52:
return "pro tip: aiming helps";
break;
case 53:
return "\"my mom gave me plunger money\"";
break;
case 54:
return "dolphin dive on top of your friend for god mode";
break;
case 55:
return "no free rides. ass, grass, or cash!";
break;
case 56:
return "https://nzp.gay/";
break;
case 57:
return "im an mlg gamer girl so its pretty guaranteed";
break;
case 58:
return "this is a w because you cant have enough fnaf";
break;
case 59:
return "i hope santa drops bombs on the uk";
break;
case 60:
return "Hoyl shit, bro! You fucking ported fortnite!";
break;
case 61:
return "icarly feet futtishist.";
break;
case 62:
return "Well, it's impossible to play, I'm disgusted.";
break;
case 63:
return "I like my women to not be cartoons";
break;
case 64:
return "Plot twist: NZP was always broken";
break;
case 65:
return "testing some think.";
break;
case 66:
return "fnaf is older than gay marriage in the us";
break;
case 67:
return "i want that twink Obliterated";
break;
case 68:
return "i think he started the femboy transition process";
break;
case 69:
return "nice";
break;
case 70:
return "He's FUCKING annoying";
break;
case 71:
return "yeah pog female bikers";
break;
case 72:
return "Its either a stroke of genius or just a stroke";
break;
case 73:
return "Play some Custom Maps!";
break;
case 74:
return "Real OGs play on Win9X Machines!";
break;
case 75:
return "Adding this tip improved framerate by 39%!";
break;
case 76:
return "The NZ in NZP stands for New Zealand!";
break;
case 77:
return "The P in NZP stands for Professional!";
break;
case 78:
return "Remember to stay hydrated!";
break;
case 79:
return "cofe";
break;
}
return "wut wut";
};
@ -1327,7 +1207,8 @@ noref void() CSQC_Parse_Event =
// originally was view_angles, but thats only what is reported
// to the server, weapon kick is NOT reported, so offset continued
// to grow.
makevectors(getproperty(VF_ANGLES));
getinputstate(servercommandframe);
makevectors(input_angles);
local vector offset = vmodel.origin + vmodel_muzzleoffset;
local vector muzzlepos, muzzle_offset;
muzzlepos = getviewprop(VF_ORIGIN);

View file

@ -425,24 +425,24 @@ void() settings_ro = {
void() UpdateResolutions = {
switch(aspectratio) {
case 0:
active_swidth = screen_width_43[0];
active_sheight = screen_height_43[0];
active_swidth = screen_resolution_4x3[0].width;
active_sheight = screen_resolution_4x3[0].height;
break;
case 1:
active_swidth = screen_width_54[0];
active_sheight = screen_height_54[0];
active_swidth = screen_resolution_5x4[0].width;
active_sheight = screen_resolution_5x4[0].height;
break;
case 2:
active_swidth = screen_width_169[0];
active_sheight = screen_height_169[0];
active_swidth = screen_resolution_16x9[0].width;
active_sheight = screen_resolution_16x9[0].height;
break;
case 3:
active_swidth = screen_width_1610[0];
active_sheight = screen_height_1610[0];
active_swidth = screen_resolution_16x10[0].width;
active_sheight = screen_resolution_16x10[0].height;
break;
case 4:
active_swidth = screen_width_219[0];
active_sheight = screen_height_219[0];
active_swidth = screen_resolution_21x9[0].width;
active_sheight = screen_resolution_21x9[0].height;
break;
}
}
@ -484,97 +484,97 @@ void() settings_re = {
switch(aspectratio) {
case 0:
if (active_swidth == screen_width_43[MAX_43-1]) {
neww = screen_width_43[0];
newh = screen_height_43[0];
if (active_swidth == screen_resolution_4x3[screen_resolution_4x3.length - 1].width) {
neww = screen_resolution_4x3[0].width;
newh = screen_resolution_4x3[0].height;
} else {
for(float i = 0; i < MAX_43; i++) {
if (active_swidth == screen_width_43[i]) {
neww = screen_width_43[i+1];
newh = screen_height_43[i+1];
for (int i = 0; i < screen_resolution_4x3.length; i++) {
if (active_swidth == screen_resolution_4x3[i].width) {
neww = screen_resolution_4x3[i + 1].width;
newh = screen_resolution_4x3[i + 1].height;
}
}
// if still 0, different aspect ratio
if (neww == 0) {
neww = screen_width_43[0];
newh = screen_height_43[0];
neww = screen_resolution_4x3[0].width;
newh = screen_resolution_4x3[0].height;
}
}
break;
case 1:
if (active_swidth == screen_width_43[MAX_54-1]) {
neww = screen_width_54[0];
newh = screen_height_54[0];
if (active_swidth == screen_resolution_5x4[screen_resolution_5x4.length - 1].width) {
neww = screen_resolution_5x4[0].width;
newh = screen_resolution_5x4[0].height;
} else {
for(float i = 0; i < MAX_54; i++) {
if (active_swidth == screen_width_54[i]) {
neww = screen_width_54[i+1];
newh = screen_height_54[i+1];
for (int i = 0; i < screen_resolution_5x4.length; i++) {
if (active_swidth == screen_resolution_5x4[i].width) {
neww = screen_resolution_5x4[i + 1].width;
newh = screen_resolution_5x4[i + 1].height;
}
}
// if still 0, different aspect ratio
if (neww == 0) {
neww = screen_width_54[0];
newh = screen_height_54[0];
neww = screen_resolution_5x4[0].width;
newh = screen_resolution_5x4[0].height;
}
}
break;
case 2:
if (active_swidth == screen_width_169[MAX_169-1]) {
neww = screen_width_169[0];
newh = screen_height_169[0];
if (active_swidth == screen_resolution_16x9[screen_resolution_16x9.length - 1].width) {
neww = screen_resolution_16x9[0].width;
newh = screen_resolution_16x9[0].height;
} else {
for(float i = 0; i < MAX_169; i++) {
if (active_swidth == screen_width_169[i]) {
neww = screen_width_169[i+1];
newh = screen_height_169[i+1];
for (int i = 0; i < screen_resolution_16x9.length; i++) {
if (active_swidth == screen_resolution_16x9[i].width) {
neww = screen_resolution_16x9[i + 1].width;
newh = screen_resolution_16x9[i + 1].height;
}
}
// if still 0, different aspect ratio
if (neww == 0) {
neww = screen_width_169[0];
newh = screen_height_169[0];
neww = screen_resolution_16x9[0].width;
newh = screen_resolution_16x9[0].height;
}
}
break;
case 3:
if (active_swidth == screen_width_1610[MAX_1610-1]) {
neww = screen_width_1610[0];
newh = screen_height_1610[0];
if (active_swidth == screen_resolution_16x10[screen_resolution_16x10.length - 1].width) {
neww = screen_resolution_16x10[0].width;
newh = screen_resolution_16x10[0].height;
} else {
for(float i = 0; i < MAX_1610; i++) {
if (active_swidth == screen_width_1610[i]) {
neww = screen_width_1610[i+1];
newh = screen_height_1610[i+1];
for (int i = 0; i < screen_resolution_16x10.length; i++) {
if (active_swidth == screen_resolution_16x10[i].width) {
neww = screen_resolution_16x10[i + 1].width;
newh = screen_resolution_16x10[i + 1].height;
}
}
// if still 0, different aspect ratio
if (neww == 0) {
neww = screen_width_1610[0];
newh = screen_height_1610[0];
neww = screen_resolution_16x10[0].width;
newh = screen_resolution_16x10[0].height;
}
}
break;
case 4:
if (active_swidth == screen_width_219[MAX_219-1]) {
neww = screen_width_219[0];
newh = screen_height_219[0];
if (active_swidth == screen_resolution_21x9[screen_resolution_21x9.length - 1].width) {
neww = screen_resolution_21x9[0].width;
newh = screen_resolution_21x9[0].height;
} else {
for(float i = 0; i < MAX_219; i++) {
if (active_swidth == screen_width_219[i]) {
neww = screen_width_219[i+1];
newh = screen_height_219[i+1];
for (int i = 0; i < screen_resolution_21x9.length; i++) {
if (active_swidth == screen_resolution_21x9[i].width) {
neww = screen_resolution_21x9[i + 1].width;
newh = screen_resolution_21x9[i + 1].height;
}
}
// if still 0, different aspect ratio
if (neww == 0) {
neww = screen_width_219[0];
newh = screen_height_219[0];
neww = screen_resolution_21x9[0].width;
newh = screen_resolution_21x9[0].height;
}
}
break;

View file

@ -557,14 +557,14 @@ float Player_SendEntity( entity ePVEnt, float flChanged ) {
WriteCoord( MSG_ENTITY, self.origin_x ); // Position X
WriteCoord( MSG_ENTITY, self.origin_y ); // Position Y
WriteCoord( MSG_ENTITY, self.origin_z ); // Position Z
WriteCoord( MSG_ENTITY, self.angles_x ); // Angle X
WriteCoord( MSG_ENTITY, self.angles_y ); // Angle Y
WriteCoord( MSG_ENTITY, self.angles_z ); // Angle Z
WriteAngle( MSG_ENTITY, self.angles_x ); // Angle X
WriteAngle( MSG_ENTITY, self.angles_y ); // Angle Y
WriteAngle( MSG_ENTITY, self.angles_z ); // Angle Z
WriteShort( MSG_ENTITY, self.velocity_x ); // Velocity X
WriteShort( MSG_ENTITY, self.velocity_y ); // Velocity X
WriteShort( MSG_ENTITY, self.velocity_z ); // Velocity X
WriteFloat( MSG_ENTITY, self.playernum ); // Player ID
WriteString( MSG_ENTITY, self.model ); // Player Model
WriteByte( MSG_ENTITY, self.playernum ); // Player ID
WriteShort( MSG_ENTITY, self.modelindex ); // Player Model
WriteByte( MSG_ENTITY, self.frame ); // Player's Frame
WriteShort( MSG_ENTITY, self.movetype ); // Player Movetype
WriteFloat( MSG_ENTITY, self.flags ); // Flags, important for physics

View file

@ -26,7 +26,7 @@
*/
#ifndef STANDARD
#pragma target FTE
#pragma target fte_5768
#endif // STANDARD
#define true 1
@ -248,8 +248,8 @@ void Set_W_Frame (float startframe, float endframe, float duration, float funcca
void() SUB_Null = {};
void() SUB_Null2 = {};
#define VEC_HULL_MIN '-16 -16 -32'
#define VEC_HULL_MAX '16 16 40'
#define VEC_HULL_MIN '-16 -16 -36'
#define VEC_HULL_MAX '16 16 36'
#define VEC_HULL2_MIN '-32 -32 -24'
#define VEC_HULL2_MAX '32 32 64'

View file

@ -353,12 +353,6 @@ void (entity who, float version)
#define VEC_ORIGIN '0 0 0'
//Half Life 1 Hull Sizes ADDED BY BLUBS, COMMENTED ORIGINAL QUAKE BBOX SIZS OUT
#define VEC_HULL_MIN '-16 -16 -32'
#define VEC_HULL_MAX '16 16 40'
#define VEC_HULL2_MIN '-32 -32 -24'
#define VEC_HULL2_MAX '32 32 64'
// protocol bytes
#define SVC_BAD 0
#define SVC_NOP 1

View file

@ -35,14 +35,6 @@ void() rec_downed;
#define PLAYER_START_HEALTH 100
// 32x32x72
#define PLAYER_MINS_STANDING '-16 -16 -32'
#define PLAYER_MAXS_STANDING '16 16 40'
// 32x32x36
#define PLAYER_MINS_CROUCHING '-16 -16 -32'
#define PLAYER_MAXS_CROUCHING '16 16 4'
#define PLAYER_CROUCH_HEIGHT 25
#define PLAYER_PRONE_HEIGHT 23

View file

@ -67,6 +67,15 @@ const float EVENT_FLAME = 47;
#define FTE
#endif // STANDARD
// Player Hull Sizes
// 32x32x72
#define PLAYER_MINS_STANDING '-16 -16 -32'
#define PLAYER_MAXS_STANDING '16 16 40'
// 32x32x36
#define PLAYER_MINS_CROUCHING '-16 -16 -32'
#define PLAYER_MAXS_CROUCHING '16 16 4'
// Weapon Firetype definitions
#define FIRETYPE_FULLAUTO 0
#define FIRETYPE_SEMIAUTO 1

View file

@ -15,7 +15,7 @@ echo "========================"
echo " compiling FTE SSQC "
echo "========================"
echo ""
./fteqcc-cli-lin -srcfile ../progs/fte-server.src
./fteqcc-cli-lin -O2 -srcfile ../progs/fte-server.src
echo ""
echo "========================"
echo " compiling STANDARD QC "

View file

@ -15,7 +15,7 @@ echo "========================"
echo " compiling FTE SSQC "
echo "========================"
echo ""
./fteqcc-cli-mac -srcfile ../progs/fte-server.src
./fteqcc-cli-mac -O2 -srcfile ../progs/fte-server.src
echo ""
echo "========================"
echo " compiling STANDARD QC "

View file

@ -15,7 +15,7 @@ echo ========================
echo compiling FTE SSQC
echo ========================
echo.
fteqcc-cli-win.exe -srcfile ../progs/fte-server.src
fteqcc-cli-win.exe -O2 -srcfile ../progs/fte-server.src
echo.
echo ========================
echo compiling STANDARD QC