FastCast server hit reg delay

I have been working on this FPS for a while now, and theres one really annoying problem that keeps ruining the game.

the server bullet hit reg is really bad and delayed, e.g. you could be aiming straight at their torso, fire the gun, and the server bullet will go straight through them like they are not there, meaning you would need to aim quite far ahead up close, or at any ranges, just to hit them, and it really is annoying and ruins the guns, but i cant use the client bullets to handle hit reg because it will be really buggy and inaccurate (unless they fixed that then tell me), i have tried alot of “solutions” but none work, the delay and inaccurracy is always there, if you have any solutions that might work, please tell me, the answer that works will be put as the solution, i can provide videos of the problem if needed.

– Rumple

I recommend what you should do is have a remote fire the projectile to the client(s), and then visualize the projectile on the client.

RemoteServer:FireServer(Info.StoredId,{
					Hit = hit;
					Humanoid = HUM;
					TEAM = Team;
					Position = Projectile.Position;
				})

Once the projectile hits its target or hits an object, you should fire important information you’ve gathered to the server. To prevent the damage inflicted multiplying by the amount of players, you can either didsconnect the function after its fired once or have a HumanoidTable in which you can insert alreaddy targetted humanoids:

-- First option 
local Connection
Connection = Remote.OnServerEvent:Connect(function()
   Connection:Disconnect() --Disconnects it so it doesnt fire more than once
   --Your functions here
end)

--Second option
local HumanoidTable = {}
local Connection
Connection = Remote.OnServerEvent:Connect(function(Humanoid)
   if table.find(HumanoidTable,Humanoid) then return end
   table.insert(HumanoidTable,Humanoid)
   -- Your functions here
end)

This is how I do my projectile system using FastCast, and it works quite well.

I dont understand that very well, can you be a little more specific? sorry.

Thats fine. I can show you an example of it in execution.

Do note that this system out here is quite outdated, and you should probably be able to make one that works much better. This is the ServerSided version, and i can go into more depth on how it works and show you how i also did the client sided part as well.

function module:Projectile(Info)
	local hum, pos, Hit, Color = nil,nil,nil,nil
	local Finished = false
	local Bindable = Instance.new("BindableEvent")
	local Connection
	local function Disconnect()
		if not Finished then
			if Connection then
				Connection:Disconnect() 
				Connection = nil
			end
		end
	end
	local function SetVariables(Humanoid, Position, hit, color)
		if not Finished then
			Finished = true
			hum,pos,Hit,Color = Humanoid,Position,hit,color
			Bindable:Fire()
		end
	end
	local StoredId = http:GenerateGUID(false)
    Connection = Remotes.Projectile.OnServerEvent:Connect(function(plr, ID, Humanoid, Position, hit, Color) --This will fire when the projectile hits an object
		if StoredId == ID then
			Disconnect()
			SetVariables(Humanoid,Position,hit,Color)
			if Humanoid ~= nil and Info.CanDamage == true then
				Humanoid:TakeDamage(Info.Damage)
			end
		end
	end)
	Remotes.Projectile:FireAllClients(Info,StoredId) --This visualizes the projectile on all of the clients
	spawn(function()
		wait(Info.Duration)
		Disconnect() --After a certain amount of time that you specify, the projectile will destroy itself.
	end)
	Bindable.Event:Wait()
	Bindable:Destroy()
	Bindable = nil
	return hum, pos, Hit, Color
end```

It sounds like you’re experiencing frustrating issues with hit registration in your FPS game, where server-side bullet hits are delayed or inaccurate, leading to a less than satisfactory gameplay experience. This is indeed a common problem in online multiplayer games, but there are several approaches you can take to address it. Here are some potential solutions you might consider:

  1. Optimize Server Tick Rate: Ensure that your game server is running at an optimal tick rate. A higher tick rate allows for more frequent updates between the server and clients, which can help improve the accuracy of hit registration.
  2. Interpolation and Lag Compensation: Implement interpolation techniques to smooth out player movements on the client side. Additionally, consider implementing lag compensation algorithms to account for network latency and reduce the impact of delays on hit registration.
  3. Prediction and Client-Side Bullet Tracing: While you mentioned concerns about using client-side bullet tracing due to potential inaccuracies, it may still be worth exploring this option. Implement predictive algorithms on the client side to estimate the impact of bullet trajectories based on player movements and other variables.
  4. Server-Side Validation and Verification: Implement thorough server-side validation and verification checks to ensure the legitimacy of player actions and prevent cheating or exploitation of hit registration mechanics.
  5. Network Optimization: Evaluate and optimize your game’s network code to minimize latency and packet loss, which can significantly impact hit registration accuracy.
  6. Hitbox and Collision Detection: Review and fine-tune your game’s hitbox and collision detection systems to ensure they accurately represent player models and environment geometry.
  7. Feedback and Testing: Gather feedback from players and conduct extensive testing, including stress testing under various network conditions, to identify and address any remaining issues with hit registration.
  8. Consultation with Experts: Consider seeking advice and guidance from experienced developers or networking specialists who may have encountered similar challenges in their own projects.

It’s important to note that addressing hit registration issues can be a complex and iterative process, requiring careful analysis and testing to achieve satisfactory results. Additionally, the effectiveness of different solutions may vary depending on the specific requirements and constraints of your game. By systematically exploring and implementing the suggestions outlined above, you can hopefully mitigate the impact of delayed and inaccurate hit registration and improve the overall gameplay experience for your players, sorry I tried.

thank you, ill look into these.