How do i make this more accurate or faster

  1. What do you want to achieve?
    – trying to figure out how to make my 2d player replication more accurate or fast, when players move it looks different then what its suppost to and i dont know what to do

  2. What is the issue?


    – video

  3. What solutions have you tried so far? Did you look for solutions on the Creator Hub?
    – i tryed switching from remote event to remote function; idk how else to go about this

–for refrence this is what i did (just half of it)

RunService.RenderStepped:Connect(function(Delta)

	local MoveX = 0
	local MoveY = 0
	
	-- theres other stuff before this that i removed but, it just moves the background for you,, other players get moved

	local MoveVector = Vector2.new(MoveX, MoveY)
	if MoveVector.Magnitude > 0 then
		MoveVector = MoveVector.Unit
	end

	local StepVelocity = MoveVector * MoveSpeed * Delta

	MoveOffset += StepVelocity

	Map.Position = UDim2.new(
		Map.Position.X.Scale,
		InitialOffsetX - MoveOffset.X,
		Map.Position.Y.Scale,
		InitialOffsetY - MoveOffset.Y
	)

	local success, result = pcall(function()
		getPosition:FireServer(Vector2.new(
			-Map.Position.X.Offset + InitialOffsetX,
			-Map.Position.Y.Offset + InitialOffsetY
			))
	end)
	
	--ths sends positions to server so other players can recieve and see you move
end)
1 Like

and yes the windows are the same size, i have scaled uis, and i checked fps and nothing changed too drastic

you need your World frame to be in offsets, it cant have scale at all, else it will mess up positions inside of it

you can use buffers, that will slightly make it faster
but overall you wont have ideal, cause it takes time for your data to travel to server, and the server data travel to everyone else

another thing what you are doing is using GuiObject position values, which is horrible

you need a good ECS with schedular start, i have a template for this i think and it has replication

1 Like

could you show me ? also i dont understand what ecs is

its sending the position every frame? how does it become out of sync then? switch to unreliable remote events instead, they are better for this sort of thing. u cant fully eliminate ping but the players not being in the same pos is a different issue from ping/latency.

all kind of overkill for how simple this is.

i dont know how it becomes out of sync but i send positions to the server so other players can recieve it, and i am using a unreliable event already

not overkill in the slightest, making 2D especially with UI syncing

ECS with proper pipeline is a standard for things like this

1 Like

there’s no need to pcall any remote calls btw, only web endpoint calls like fetching an asset information (so stuff like marketplace service)

I’d try getting data from movedirection of their characters since characters are being rendered first of all, so if player moves a stud(and he won’t see that), you will read that and change position with that locally since it replicates immediately.

this is a structural problem not network speed problem. you need network interpolation and lag compensation (aka input prediction). like if the other user does +Right at 100 units a second and gives also a position, and your client knows only the input and the latency it took, you can transpose their position by their acceleration/speed * their ping to put them further than they actually are - which will be where they likely already are.