[ARCHIVED] SecureCast, server-authoritative projectiles with lag compensation, multi-threading and more!

Why use this over fastcast? Does it have more features or something?

1 Like

Read the post. He explained everything

3 Likes

this looks nice but, other than the features you already talked about, what are the benifits over fastcast?

fastcast is performant and reliable and combined with PartCache makes it better. i looked through the api documentation and saw some things missing that are pretty important to me for customization of the bullet

is there a way to detect when it hits a wall and do a penetration test like fastcast’s CanRayPierce?

am i able to change the look of the bullet, create my own update function for how the bullet moves like fastcast’s OnRayUpdate?

(i could have missed these things in the api, if they were there)

1 Like

I also want to use this to control NPC interactions (NPCs shooting at players and players shooting at NPCs) I looked through the API and did not figure anything out… Can you share what you found or point me in the right direction?

Thanks

2 Likes

Hey Axen! Great module. I have something very similar but will be planning to this if more reliable than my current solution. Currently mine is about 90% accurate with moving and jumping players (that’s with a pretty big hitbox, using slow moving projectiles).

One question:

How does this module fare with jumping players?
From reading the source code you:

  1. Get the next frame based on the client tick/timestamp
  2. Get the current frame based on the client tick/timestamp
  3. Get a float value probably doing something like math.ceil(timestamp) - timestamp
  4. Use that to lerp for a more precise position

I’ve done this exact solution before but the hitboxes differ from the client by about 0.5~~ studs while jumping, this is including compensation for the built-in replication buffer that Roblox uses.

From my own testing that buffer is about 9/60s (0.15s) - I use 60 as thats the maximum number of ticks/s that servers can output. If your solution actually doesn’t have the issues I’ve laid out, I’d really appreciate having a chat about this!

Also a suggestion: try implementing a circular queue instead of using table.insert() and table.remove(). Will probably squeeze a bit more performance out of your code.

1 Like

Can add some example code in the documentation pls.

1 Like

There is example code in the documentation
Getting Started → Simulation
You can also find example code on the GitHub repository

3 Likes

Not really what i meant. I mean like a real “world?” example such as filling out all the parameters and vars.

2 Likes

please change the name convention to anything other than kebab case, it breaks imports

image

1 Like

Any plans to support Shapecasts with this?

2 Likes

yeah i need shapecasts for larger projectiles, especially when fastcast isnt being maintained anymore

1 Like

Is there anyway to do stuff like rockets/grenades onto it?

1 Like

Yes, for grenades set a projectile’s Angle to 360 and for rockets you can use the example bullet projectile with reduced velocity. The explosion will have to be handled by you as that is out of scope for the module, but you can still take advantage of the lag compensation using the Snapshots API.

4 Likes

Ogh I noticed that you can do it with OnImpact statement, so I used it when it’s not client to do some damage activiation. Enjoy this as a pure dopamine of explosives.

(Fixed some things up like lag compensation after the video).

5 Likes

Hi, love the idea of this module - making lag compensation with snapshots is so unbelievably difficult so I’m really hoping to get this working!

Player Hit Detection doesn’t work, even if I use the most stripped down example version you provided.

As you can see, the client registers the OnImpact event, but the server doesn’t fire the OnIntersection which I’m pretty sure would be the section handling player collision?
Infact, the TraverseVoxelGrid function isn’t returning any Player objects at all.

I’m using every default setting. The characters are on seperate teams and within a Characters folder. My only conclusion is that the voxels section isn’t working properly, but I’m confused why nobody else is having any issues so it’s probably something I’ve done haha.

Am I missing something?
Thanks.

1 Like

Hello! Looks like you’re using R6, you will have to modify the Parts and PartSizes arrays in the Settings module to correctly account for this. Here’s what they should look like:

Parts = {
    "Head",
    "Torso",
    "Left Arm",
    "Right Arm",
    "Left Leg",
    "Right Leg"
},
PartsSizes = {
    Vector3.new(1.161, 1.181, 1.161) / 2, -- Head
    Vector3.new(2, 2, 1) / 2, -- Torso
    Vector3.new(1, 2, 1) / 2, -- Left Arm
    Vector3.new(1, 2, 1) / 2, -- Right Arm
    Vector3.new(1, 2, 1) / 2, -- Left Leg
    Vector3.new(1, 2, 1) / 2 -- Right Leg
},
5 Likes

Brilliant, that works - thanks for the quick reply!

2 Likes

Does this support shapecasts? I’m planning to make a boomerang and these are flat cylinders. Need to take into account the shape.

1 Like

Unfortunately it currently only supports normal raycasts.

4 Likes

Hey, I believe I found a bug in the module

The only remedy I have for it is replacing the
Projectile.IncludeFilter:AddToFilter(Impact) on line 356 in Simulation with Projectile.RaycastFilter:AddToFilter(Impact) but im unsure if it’ll work in other cases

1 Like