Stupid simple fast character position replication

Using buffers seems overkill. CFrames are already stored as f32 and you aren’t going to get better bandwidth if you just reconstruct them.

Here’s my version:

FastCharacterReplicate.rbxm (2.1 KB)

2 Likes

I had this in mind, you wouldn’t have to send all the components if your game wont ever have the character rotate in some ways.

I noticed a drop in bandwidth usage sending a single cframe on blink, might have been some variance or unknown variable then, I have removed it now.

1 Like

I would recommend sending on Heartbeat, as that would send the latest simulated character position right after physics have completed simulating.
PreSimulation would be sending the previous physics simulation position
I would also keep the network send rate cap on 120hz, as sending more than that would be wasteful.

1 Like

Holy jesus, thank you so much for this!
Will definitively be trying to use it on the game I’m working on, thank you!

2 Likes

Just watch out for this, I found this out just now.
edit: nvm just do Humanoid:ChangeState(Enum.HumanoidStateType.Physics)

3 Likes

Sending remote events every frame is one of the most normal things ever, and its literally why unreliable remote events were made.

2 Likes

double replication means double the network use, even with unreliable remotes
idk if im just a perfectionist or something but that feels bad

im not 100% sure how unreliable remotes work, but even if the packets get easily dropped thats a lot of requests, regardless of whether they arrive or not, which feels like clogging network usage to me

again, im unsure if this is just me nitpicking and this really doesnt matter at all in the grand scheme of things, but it still feels wrong

This is essentially how most games handles positional updates (advanced ones do a lot more: 2. Networked physics overview · jpetanjek/NextGenNetGames Wiki · GitHub)

Until recently, Roblox didn’t support UDP networking. All networking had to be ordered, and Roblox would resend dropped packets, which led to additional congestion and lag.

Unreliable events have resolved this issue to some extent. It’s not recommended to send large amounts of data on each heartbeat with it though. For smaller things like transmitting a single CFrame or a key input stream, it’s more than capable of handling it.

For example, here’s a project that sends updates almost every frame. It’s created by someone with lots more knowledge of Roblox replication: Chickynoid: Server Authoritative Character Replacement

A good read for people looking into the replication subject: Snapshot Compression | Gaffer On Games

1 Like

Roblox devs have this tendency to think if you do X thing every frame its a bad practice.

Doing a lot of things every frame is not a bad practice, in fact its literally how most systems within the roblox engine work already, humanoids have to constantly raycast to get the Humanoid.Floor property, roblox already sends positonal updates every frame, hell rendering is done every frame, physics are also done every frame.

Just make sure to optimize whatever you are running every frame and not waste unecesary resources, an example here would be to serialize/compress the data before sending it to clients to not waste bandwith.

6 Likes

i see, forgive my concern lol. im so used to normal remotes that sending a request every frame, unreliable or not just kinda manifested itself as “this is bad” in my head

Hey! I’ve seen you quite often on the Chikynoid forum post and I’m wondering if I should just ditch trying to learn Chikynoid for this. The implementation seems 100x more intuitive and doesn’t require extensive networking knowledge just to get started with it. Only advantages I can think of are that Chikynoid is server-authoritative (pseudo-eliminates movement exploits) and can do far more when it comes to state management. I’ve spent weeks trying to rewrite my movement-heavy fighting game into Chikynoid, while I can implement this module into virtually any of my games and get it working within a day or two.

No, you aren’t going to regret learning how Chickynoid works once you’ve learned it.

2 Likes

Not convinced… Mostly because of the lack of features and documentation. Sure I can write in these custom systems, but it will certainly take a few weeks (and a few headaches). One specific deal breaker for me is the lack of features regarding animations such as adjusting it’s weight and playing multiple at the same time. Keystrokes and input buffering is another headache where I don’t even know where to begin. Don’t get me wrong, Chikynoid is a phenomenal resource with far-reaching applications, but the lack of documentation and feature updates have stalled my interest. I sure do hope the Roblox physics team cooks up their own server-authoritative framework within the next 5 years :pray:

Suit yourself but as someone who has gone fully into Chickynoid, it’s really not that complicated, and adding the animation stuff you’re talking about is not complicated either. But yeah the lack of documentation is the main issue I had when learning to use Chickynoid.

Anyways, you seem pretty set on not using it, but one bit of advice I would have if you do use it would be do stuff the “Chickynoid” way and everything is easy. I’ve moved my game to Chickynoid and now the entire game is only a couple of client/server mods.

1 Like

Honestly, id say dont use chickynoid, my game is in dev hell thanks to it, it lacks a lot of features and you have to code them yourself, it also strips you away from using roblox’s advanced physics engine.

I only use it because i like to push the engine to its limits

1 Like

This is so cool! Can’t wait to put this into use. Thank you!

I’m looking to turning fast_p2p on and off dynamically per player when that player is climbing a climbable wall. But turning it off has been tricky.

Let me know if you had an intended solution. Otherwise, here’s what I’m gonna try. I will need to add a Remote event to tell all other players I’m leaving the climbing wall. Then all other players would set the player character to HumanoidState.Running and no longer receive CFrame updates. At the point Roblox’s normal replication would take over. Does that seem like an alright general approach?

Hello, could you add me on discord, i would like to talk with you regarding this project:

jjcavalli

Thank you!

PERRFFECT! That’s what I’ll use for 0 delay in my games. Thank you very much kind sir, I would give you my life.