FastHumanoid | Deterministic Player Controller (PC and Mobile)

FastHumanoid is a fast and deterministic player character controller that uses Actors, UnreliableRemoteEvents and buffer serialization to make sure that it is the fastest it can be :slight_smile:

I made this module after seeing how slow physics-based Humanoids can be with alot of players, and is overall just a proof of concept of what can be.

I do not recommend using this module for anything other than experimenting/small games for now as it is still being developed and as I said still pretty much just a proof of concept.

Flaws

Character movement is not replicated to the server.
This is because of server-client replication, since the client is already setting their characters CFrame on their side, setting it again on the server would cause stuttering.

However, the FastHumanoid module has a .CFrame property which lets you see where the player is based on information from the client :slight_smile:

Known Issues

Currently there is this weird bug where the FastHumanoid ModuleScript isn’t being cached after being required by the inner scripts Client and Server, so if you for example try to do this in an outside script:

require(...FastHumanoid).Died:Connect(function()
    print("Died!")
end)

It will never fire because that script and the inner scripts don’t have the same version of the FastHumanoid module (which usually isn’t the case!!)

If anyone knows how to fix this, let me know :cry:

Properties

Testing:

Test place seen in video →

Rbxm download →
FastHumanoid.rbxm (25.1 KB)

Feel free to edit the module to your liking, and maybe even help me fix some of the flaws and bugs :slight_smile:

9 Likes

I have an issue, Faster FPS (200-300+) causes the player to jump like a maniac.

1 Like

Since the physics loop uses .Heartbeat higher fps causes higher deceleration

1 Like

I honestly dont really know how to fix it atm :sweat_smile:

1 Like

that is an awesome module

I understand that UnreliableRemoteEvents is used for this to optimize the character replication, but UnreliableRemoteEvents have a chance of failing which is fine but not ideal for pvp games

heartbeat passes a delta time argument which can be used to make the jump height the same across any fps

RunService.Heartbeat:Connect(function(dt)
	(hight * dt/60)
end)
1 Like

Just use delta time to slow down the fast deceleration.


Setup the module, just get teleported into the void after a few seconds of spawning

This happens if i stand still for a few seconds

This is the gravity deceleration:

Multiplying gravity by dt doesn’t really do anything other than making jump heights inconsistent

The lerping to the new deceleration already uses deltatime

I would honestly like to know how you’d fix this, I can’t think of a way :cry:

1 Like

Oof, did you change the .CFrame value in the module? It is initialised to the first spawn location, I would also disable any scripts affecting the position of the Character as it may or may not interfere with how the module works.

I didn’t use the lerp method before but you should multiply dt it by 60 instead of 3

Summary

if you are running on 60 fps then (dt * 60) will be 1 but it will run 60 times per second
if you are running on 120 fps then (dt * 60) will be .5 but it will run 120 times per second
if you are running on 240 fps then (dt * 60) will be .25 but it will run 240times per second
etc…

1 Like

completely new baseplate place, havent touched anything

1 Like

Can you show how you have placed the module?

Unfortunately multiplying by 60 only made the gravity deceleration extremely buggy :sweat_smile: I’ll try finding a way to fix this in the next patch

1 Like

image
here you go

Alright, if you can send a place download I’ll see if I can replicate your issue and find a fix

I just went back to play the same place again without closing it or anything and now it works? Guess it was just a weird fluke.

Huh, yeah I guess it does that for some reason (hence the warning to not use it in any actual games yet!!!)

I’ll be pushing the next patch sometime within this week to fix reliability and fps issues