Improving Lightsaber addon

Hello Facepunch,

I’m running a server which uses this addon: https://steamcommunity.com/sharedfiles/filedetails/?l=german&id=111412589

The addon is doing this in a think hook:



	local trace = util.TraceHull( {
		start = startpos,
		endpos = startpos + dir * self:GetBladeLength(),
		filter = self,
		/*mins = Vector( -1, -1, -1 ) * self:GetBladeWidth() / 2,
		maxs = Vector( 1, 1, 1 ) * self:GetBladeWidth() / 2*/
	} )

	if ( trace.Hit ) then
		rb655_DrawHit( trace.HitPos, trace.HitNormal )
		rb655_LS_DoDamage( trace, self )
	end


Because my server is running at 16 tick with around 60-80 players, the lightsaber feels kinda laggy and is not doing damage everytime it should do.

My question is whether I can optimize the lightsaber somehow to do the damage more often when it should do.

Upgrade the server

I’m not sure whether I can find a better server.
The server I’m using is running an Intel i7-6700K overclocked to 4.7GHz.

[editline]22nd October 2016[/editline]

I thought about making a wider TraceHull, would that be useful?

You could run tests to see what works for you.

I’m sure you can go up to 64 ticks

I will try a higher tickrate, but I always thought that every server with more than 30 players should stick with 16 tickrate.

Lightsaber damage is based around tickrate, If the server doesnt have stable tickrate damage will not apply properly. Also, how does the lightsaber feel “laggy” fps or serverside?

When you have higher tickrate you deal more checks for damage, you could try to compensate and make the hull wider aswell though.

It feels laggy in the way that the damage is not dealt even though it shouldbe dealt.
I have increased the tickrate from 16 to 33, the lightsaber works much better now. I just hope the server can handle 33 tick.