From 724e202e115605b921ba6836fe906d7d30e80470 Mon Sep 17 00:00:00 2001 From: cypress Date: Mon, 13 Nov 2023 12:11:09 -0500 Subject: [PATCH] SERVER/FTE: Reduce bandwidth rate of zombies --- source/server/main.qc | 45 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/source/server/main.qc b/source/server/main.qc index 6f49aa4..639c944 100644 --- a/source/server/main.qc +++ b/source/server/main.qc @@ -362,6 +362,51 @@ void() RelinkZombies = if(ent.currentHitBoxSetup == 0)//empty bbox, we don't care to update continue; +#ifdef FTE + // This is just a weird hack we do to avoid spamming other clients in co-op with + // the update positions for limbs. Brings bandwidth from 90kbps->30kbps without + // a tick rate limit. 30kbps->12kbps with a tickrate of 20Hz. Basically, like we + // do other platforms for render speedups, if a zombie has all of its limbs dont + // bother drawing them all separately. draw one full mesh instead, then when it + // has been gibbed, then begin drawing separately -- cypress + if (ent.larm.deadflag && ent.rarm.deadflag && ent.head.deadflag) { + setmodel(ent.larm, ""); + setmodel(ent.rarm, ""); + setmodel(ent.head, ""); + + if (ent.crawling == 1) + setmodel(ent, "models/ai/zcfull.mdl"); + else + setmodel(ent, "models/ai/zfull.mdl"); + } else if (!(ent.crawling == 1 && ent.model == "models/ai/zbc%.mdl") || !(ent.model == "models/ai/zb%.mdl")) { + if (ent.crawling == 1) + setmodel(ent, "models/ai/zbc%.mdl"); + else + setmodel(ent, "models/ai/zb%.mdl"); + + if (ent.larm.deadflag) { + if (ent.crawling == 1) + setmodel(ent.larm, "models/ai/zalc(.mdl"); + else + setmodel(ent.larm, "models/ai/zal(.mdl"); + } + + if (ent.rarm.deadflag) { + if (ent.crawling == 1) + setmodel(ent.rarm, "models/ai/zarc(.mdl"); + else + setmodel(ent.rarm, "models/ai/zar(.mdl"); + } + + if (ent.head.deadflag) { + if (ent.crawling == 1) + setmodel(ent.head, "models/ai/zhc^.mdl"); + else + setmodel(ent.head, "models/ai/zh^.mdl"); + } + } +#endif // FTE + makevectors (ent.angles); for(i = 0; i < 3; i++)