How does FastCast remove server delay?

I’ve been having an issue where whenever I clone a bullet on the server, add a bodyvelocity and then parent it, it always delays. It looks really stupid and I’ve been wondering how @EtiTheSprirt’s FastCast gets past this?

I have no issues with raycasting delay or anything else. I just notice that using cosmetic bullets on the server is very unstable and unreliable.

Any advice would be greatly appreciated!

1 Like

I haven’t dug much into FastCast, although I’m guessing what happens is that there’s a client-sided replication of the bullet so it’s immediate when the player fires their gun, and if I could take a guess, it creates a bullet for every other client in the game from the server. Then I believe the server handles raycasting to actually deal damage in a secure manner.

FastCast actually uses raycasting entirely to create an illusion of a bullet moving with velocity; it’s pretty clever.

1 Like

Interesting. But how would you calculate the path and visuals of tons of other bullets? It seems like it can be very lag inducing. I also only see that it clones a single bullet instead of multiple like you say it might.

I’ve also noticed that the bullet from other’s screen is rather far from the muzzle, which could mean that he waits a bit to parent the bullet.

Thank you for the answer, I appreciate it.

1 Like

I’d recommend replicating the bullets to the client. The only delay will be the ping (a little more for execution and security). It allows way smoother movement for physics and doesn’t use the server to replicate it. What you are probably experiencing is the unanchored part moving in between network owners?

2 Likes

It might be far from the muzzle due to the delay it takes for the client to fire a remote to the server, then for the server to fire all clients to draw a bullet.

And raycasting is generally very lightweight to use, making it extremely efficient to use in weapon systems.

2 Likes

I normally would create the bullet on the client, because there is no delay. SO you’re saying the only delay comes from the ping? I am creating the bullet from a remote event when I do it on the server, but it still looks bad.

1 Like

Woops accidentally delete my post again.

There will always be server delay with any connection that isn’t between a LAN.

What I recommend doing is;

  • CMD is issued from Client
  • On that same Client, create the bullet for no delay for the user
  • On the Server do your hit detection and damage, then fire all the clients except the one who issued the command
  • Create the bullet on the fired clients

To my knowledge this may be your best shot!

Wow, thanks! I’ll absolutely look farther into this. As for right now, my server sided bullets look like garbage.