![]() |
|
limit c4's to 1 purchase per player - Printable Version +- Dinkleberg's GMod (https://www.dinklebergsgmod.com/site) +-- Forum: Trouble in Terrorist Town (https://www.dinklebergsgmod.com/site/forumdisplay.php?fid=3) +--- Forum: TTT Suggestions & Help (https://www.dinklebergsgmod.com/site/forumdisplay.php?fid=6) +--- Thread: limit c4's to 1 purchase per player (/showthread.php?tid=20317) |
limit c4's to 1 purchase per player - Sailboat495 - 08-31-2025 c4's just lag the server too much, it's genuinely pathetic that dinks wont upgrade the server beyond a 1994 pentium 2 laptop so this is the next alternative to having the server not become completely unplayable when eamtomlinson/A0 decides to plant 7 c4's in 1 round it's also not fun gameplay to have someone plant c4's in every t room/unreachable location (i.e. innomotel) but i'm used to playing versus cringe at this point, i'd just like a functioning server RE: limit c4's to 1 purchase per player - anxelic - 08-31-2025 bro might be onto something RE: limit c4's to 1 purchase per player - Nelluc9 - 08-31-2025 (08-31-2025, 09:25 PM)aaaaaaaa Wrote: c4's just lag the server too much, it's genuinely pathetic that dinks wont upgrade the server beyond a 1994 pentium 2 laptop so this is the next alternative to having the server not become completely unplayable when eamtomlinson/A0 decides to plant 7 c4's in 1 roundi guarantee there is more than a handful of people who would pay 20+ bucks to kickstart a better machine for the server RE: limit c4's to 1 purchase per player - jonifun92 - 09-01-2025 (08-31-2025, 10:28 PM)Nelluc9 Wrote:I would(08-31-2025, 09:25 PM)aaaaaaaa Wrote: c4's just lag the server too much, it's genuinely pathetic that dinks wont upgrade the server beyond a 1994 pentium 2 laptop so this is the next alternative to having the server not become completely unplayable when eamtomlinson/A0 decides to plant 7 c4's in 1 roundi guarantee there is more than a handful of people who would pay 20+ bucks to kickstart a better machine for the server RE: limit c4's to 1 purchase per player - murl - 09-01-2025 the 1 c4 limit is an OK suggestion, but if you really want to get to the root of the issue, you need to edit the base C4 entity that applies force to prop_physics, weapons, ammo crates, etc. I tested out a solution myself and it seemed to work pretty well. In the \ttt_c4\shared.lua, remove the line "dmginfo:SetDamageForce(center - ent:GetPos()" in the ENT:SphereDamage function. C4 will still hurt people through walls exactly as it did before, but it won't apply force to the entities surrounding it. The only downside is that C4s feel less fun and realistic, but given how much lag and how often the server crashes because of c4s, it might be worth it. I made a video demo of this in action: edit: there could be better ways of doing this, this is just a quick fix focused purely on optimization. I'll look into other solutions, like maybe only pushing actual props and ragdolls while ignoring no-collide objects like grenade, ammo, and weapon drops (which are probably causing most of the lag since a lot of maps like Eclipse have a thousand pickups) RE: limit c4's to 1 purchase per player - anxelic - 09-02-2025 (09-01-2025, 11:04 PM)murl Wrote: the 1 c4 limit is an OK suggestion, but if you really want to get to the root of the issue, you need to edit the base C4 entity that applies force to prop_physics, weapons, ammo crates, etc. wow murl is so cool and epic Something like this or this should be considered!!! RE: limit c4's to 1 purchase per player - Virunas - 09-02-2025 (09-02-2025, 06:35 AM)anxelic Wrote:(09-01-2025, 11:04 PM)murl Wrote: the 1 c4 limit is an OK suggestion, but if you really want to get to the root of the issue, you need to edit the base C4 entity that applies force to prop_physics, weapons, ammo crates, etc. Considered RE: limit c4's to 1 purchase per player - chibill - 09-02-2025 (09-02-2025, 06:35 AM)anxelic Wrote:(09-01-2025, 11:04 PM)murl Wrote: the 1 c4 limit is an OK suggestion, but if you really want to get to the root of the issue, you need to edit the base C4 entity that applies force to prop_physics, weapons, ammo crates, etc. Weridly SetDamageForce doesn't actually apply force to players. https://wiki.facepunch.com/gmod/CTakeDamageInfo:SetDamageForce See note on the wiki Likely it would be best to just remove it since the ENT:SphereDamage function only affects players since it uses player.Iterator() Entities appear to be shoved by the PhsyExplosion https://github.com/Facepunch/garrysmod/blob/master/garrysmod/gamemodes/terrortown/entities/entities/ttt_c4/shared.lua#L255 Asked over in the Garry's Mod discord to see if there is some reason this is even called. Since it honestly makes no sense at all to apply the damage force to players when it says it doesn't affect players. (And the loop only goes thru players.) EDIT: According to someone over on the Gmod Discord its used to make sure players rag dolls fly out from the explosion. Otherwise it doesn't actual affect the players and also never touches the props (since the loop only goes thru players) RE: limit c4's to 1 purchase per player - Nelluc9 - 09-03-2025 (09-02-2025, 08:54 PM)chibill Wrote: Weridly SetDamageForce doesn't actually apply force to players. https://wiki.facepunch.com/gmod/CTakeDamageInfo:SetDamageForce See note on the wikiYeah I tested murl's fix and from my experience (and what intuition is telling me) its definitely the env_physexplosion. it's the same entity that causes discombobulators to push props. the problem is if you remove the physexplosion players don't get jostled around by the c4 anymore. working on a potential fix rn https://steamcommunity.com/sharedfiles/filedetails/?id=3561317852 feel free anyone to subscribe to this and test it out. Beforehand C4 created a giant physics explosion with a magnitude of 200 for all props within a 1000-unit radius that ignored LOS this attempts to alleviate the problem by lowering the magnitude to 1. essentially this means that players still get the aimpunch effect when they're within 750-1000 units of a c4 (non-damaging/knockback range) Props within the 750-unit explosion range still get pushed by the explosion but only if they are within LOS of the c4. the only side effect that this might have besides potentially less cinematic explosions is players within this 750-1000 unit range will take less actual knockback from the c4 but that kind of seems like a non-issue RE: limit c4's to 1 purchase per player - murl - 09-03-2025 (09-02-2025, 08:54 PM)chibill Wrote: Weridly SetDamageForce doesn't actually apply force to players. https://wiki.facepunch.com/gmod/CTakeDamageInfo:SetDamageForce See note on the wiki oops I forgot I removed this too, I just did a bad job at tracking changes. Code: -- extra push |