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

I’m experiencing a major lag spike that occurs when a player is holding down shoot. This seems to be happening when using the Roblox app downloaded through the Microsoft Store (client on the right side in the video, left is normal default Roblox app). The core SecureCast script has not been edited and code being ran after the cast (such as the CameraShake visible in the video) has no impact to performance when disabled, leading me to believe it is SecureCast itself

Could you provide me with a microprofiler dump from the client? I can’t do much with just the video alone.

1 Like

How do I pass additional arguments unrelated to the bullet itself? Modifiers are not working for what I want to do (pass a gun configuration so I can do damage)

Version 1.2.0

BREAKING CHANGES

  • System now uses GetServerTimeNow() internally for the snapshot timestamp, please switch all code interacting with it to use GetServerTimeNow().
    Check out documentation examples for guidance.

Added

  • Added support for NPCs
  • Added support for extra user defined data in modifiers (@Visuile , this is what you’re looking for)
  • Added new DrawHitboxes and HitboxLifetime setting to aid with debugging

Fixes

  • Fixed the position passed to OnIntersection being wrong
9 Likes

Hello,

Is anyone using this in a production real game with many players?

Is there a .rbxl or open source place to check this out with the latest release? perhaps with a projectile missile and grenade?

Like I see above you posted a .rbxl… but can there be one weapon at least ? Like a basic gun or anything that is a tool ?

Also in your docs, what does this mean, if I am trying to do a PVP solo?

I have to have teams of 1 player per team?

(is there a limit on the total number of teams, which then would be the limit of how many solo players can be in a game playing, ((if they have to be in a team)) ) ?

Thanks

Here’s the dump. Thanks for reaching back

microprofile-20240723-164241.html (869.2 KB)

In the Simulation module included within SecureCast there are multiple checks that you can remove or modify. Start with the function IsPlayerFriendly. Do not create a team for every single player

Hello, I checked out the dump, it doesn’t contain any sort of stutters as showed in the video (screen completely freezing for a second), the slowest frame took around 11 ms (90 FPS), the spike in frame time being unrelated to SecureCast.

1 Like

Hate to ask, does this project include part caching, or are their plans to add it?
Ik there are the other optimizations but I’m curious.

It does not, I might add it down the line.

2 Likes

Sorry to ask another question, but is SecureCast an “Extendable Class”? As in I can make my own “Gun” class that extends from SecureCast, Originally I was looking for a custom projectile engine to cram into my own class but that seems to hard.

I don’t understand what you’re trying to do, SecureCast isn’t a class, you just call SecureCast.Cast in your weapons fire code.

2 Likes

R6 hitboxes are not working using the latest version

Specifically, function OnIntersection isn’t run. RaycastAABB returns false after the player is killed for the first time. I can’t seem to figure out the issue!

Thanks for the reply, lemme just get to my “root” question, the only thing I gotta know is: do you create the caster once and fire multiple times with he same caster, or do you have to create a new one every time you shoot?

Hey,

I plan on using this module for a knife projectile, and I have some questions.

The modifier part is a bit confusing, is there a way I can make the projectile (knife) spin? Also can I disable the bullet drop/gravity? I want to lower the velocity to make the knife be thrown slower, but not have gravity pull it down until it hits something (or someone).

Last question, after something is hit, how can I replace the blue orb thingy?

image

I will look into it!

Again SecureCast isn’t a class, there is no OOP involved, you require the module in the place you want to use it and call SecureCast.Cast + Replicate the cast. There’s an example’s section in the documentation you can check out for an example.

You can set Gravity to 0 in your projectile definition. There isn’t a way to make the knife spin built into the system.

Go into the projectile definition module and remove the draw utility call within OnImpact.

4 Likes

I’m not sure whether or not I changed something, but it appears I cannot see any other player’s projectiles.

Could you point me to what specifically in the code handles the creation of other player’s projectiles? I feel I might have broken or incorrectly changed something while converting things to work with my client event “subway” system that obfuscates and hide events from exploiters.

Nothing in the code handles other players projectiles, that is left up to the developer. You can check out the “Simulation” page under the “Getting Started” section in the docs for an example of replicating projectiles.

2 Likes

Hello. I like this module but I am having 2 issues.
Firstly, how can I disable the penetration but retain ricochet?
Secondly, where exactly is the speed and gravity of the projectile stored? I want to have independent values for each weapon.
Thank you.

Set Power to 0 in your projectile settings module.

You can use modifiers to give each bullet modified attributes based on the weapon it’s being fired from, you can find the layout of the modifier table here (Hovering over the underlined parts will give you a tip with what they do).

3 Likes