Hello everyone, I’ve been inactive on the devforum for the past few weeks and stopped updating FastCast2 last month. I’d like to share my thoughts—what’s good, what needs improvement, and introduce a new API for FastCast2.
Please note that I’m currently unable to work on or update FastCast2 because my PC is on its last legs, and I don’t have enough money to repair it. I also haven’t switched to Linux yet. However, remember my promise: once I get my PC back, I’ll make one final update before switching to Linux.
Documentation updates
I think the documentation is already simple and easy to understand, but the API references alone don’t make it clear how to use it.
- Caster
- 1.1 How to construct and initialize Caster (
.new)
- 1.1.1 How does initialization works
- 1.1.2 ObjectCache
- 1.1.3 Motor6D Transform
- 1.1.4 Fields and properties, data
- 1.2 How to construct and initialize Caster (
.newParallel())
- 1.2.1 How does initialization works
- 1.2.2 numWorkers
- 1.2.3 What are FastCastVMs (aka VMsDispatcher)
- 1.2.4 ObjectCache
- 1.2.5 BulkMoveTo
- 1.2.6 Motor6D Transform
- 1.2.7 Fields and properties, data
- 1.3 Methods
- 1.3.1
.newBehavior()
- 1.3.1.1 How behavior works -> Ref TypeDef behavior
- 1.3.2
:RaycastFire(...)
- 1.3.3
:BlockcastFire(...)
- 1.3.4
:SpherecastFire(...)
- 1.3.5
GetVelocityCast(...)
- 1.3.6
GetAccelerationCast(...)
- 1.3.7
GetPositionCast(...)
- 1.3.8
SetVelocityCast(...)
- 1.3.9
SetAccelerationCast(...)
- 1.3.10
SetPositionCast(...)
- 1.3.11
PauseCast(...)
- 1.3.12
AddPositionCast(...)
- 1.3.13
AddVelocityCast(...)
- 1.3.14
AddAccelerationCast(...)
- 1.3.15
SyncChangesToCast(...)
- 1.3.15.1 Why
SyncChangesToCast
- 1.3.16
TerminateCast(...)
- 1.3.17
:SetBulkMoveEnabled(...)
- 1.3.18
:SetObjectCacheEnabled(...)
- 1.3.19
:SetFastCastEventsModule(...)
- 1.3.20
:Destroy()
- ActiveCastData
- 2.1 What is ActiveCast
- 2.2 data -> Ref TypeDef ActiveCast
- 2.3 Variants
- TypeDefinitions
- 3.1 Caster
- 3.1.1
WorldRoot
- 3.1.2
Events
- 3.1.2.1
LengthChanged
- 3.1.2.2
Hit
- 3.1.2.3
Pierced
- 3.1.2.4
CastTerminating
- 3.1.2.5
CastFire
- 3.1.3
Dispatcher
- 3.1.4
ObjectCache
- 3.1.5
ObjectCacheEnabled
- 3.1.6
BulkMoveEnabled
- 3.1.7
Motor6DEnabled
- 3.1.8
FastCastEventsModule
- 3.2 ActiveCastData
- 3.2.1
Caster
- 3.2.1.1
Output
- 3.2.1.2
ActiveCastCleaner
- 3.2.1.3
ObjectCache
- 3.2.1.4
CacheHolder
- 3.2.1.5
SyncChange
- 3.2.2
StateInfo
- 3.2.2.1
HighFidelityBehavior
- 3.2.2.1.1
Default
- 3.2.2.1.2
Automatic
- 3.2.2.1.3
Always
- 3.2.2.2
HighFidelitySegmentSize
- 3.2.2.2.1 How does
HighFidelitySegmentSize works
- 3.2.2.3
Paused
- 3.2.2.4
TotalRuntime
- 3.2.2.5
DistanceCovered
- 3.2.2.6
IsActivelySimulatingPierce
- 3.2.2.7
IsActivelyResimulating
- 3.2.2.8
CancelHighResCast (Might remove)
- 3.2.2.9
Trajectories (Might change {[number]: CastTrajectory} to CastTrajectory`)
- 3.2.2.9.1
StartTime
- 3.2.2.9.2
EndTime
- 3.2.2.9.3
Origin
- 3.2.2.9.4
InitialVelocity
- 3.2.2.9.5
Acceleration
- 3.2.2.10
VisualizeCasts
- 3.2.2.11
VisualizeCastSettings -> Ref behavior
- 3.2.2.12
FastCastEventsConfig -> Ref behavior
- 3.2.2.13
FastCastEventsModuleConfig -> Ref behavior
- 3.2.3
RayInfo
- 3.2.3.1
Parameters
- 3.2.3.2
WorldRoot
- 3.2.3.3
MaxDistance
- 3.2.3.4
CosmeticBulletObject
- 3.2.3.5
CanPierceModule
- 3.2.4
UserData
- 3.2.5
Type
- 3.2.6
CFrame
- Other variants
Size (ActiveBlockcastData)
Radius (ActiveSpherecastData)
- 3.3 FastCastBehavior
- 3.3.1
RaycastParams
- 3.3.2
MaxDistance
- 3.3.3
Acceleration
- 3.3.4
HighFidelityBehavior
- 3.3.5
HighFidelitySegmentSize
- 3.3.6
CosmeticBulletTemplate
- 3.3.7
CosmeticBulletContainer
- 3.3.8
AutoIgnoreContainer
- 3.3.9
SimulateAfterPhysic
- 3.3.10
AdaptivePerformance (Might remove)
- 3.3.11
VisualizeCasts
- 3.3.12
VisualizeCastSettings
- 3.3.12.1 Debug_SegmentColor
- 3.3.12.2 Debug_SegmentTransparency
- 3.3.12.3 Debug_SegmentSize
- 3.3.12.4 Debug_HitColor
- 3.3.12.5 Debug_HitTransparency
- 3.3.12.6 Debug_HitSize
- 3.2.12.7 Debug_RayPierceColor
- 3.2.12.8 Debug_RayPierceTransparency
- 3.2.12.9 Debug_RayPierceSize
- 3.2.12.10 Debug_RayLifetime
- 3.2.12.11 Debug_HitLifetime
- 3.3.13
FastCastEventsConfig (Concurrent)
- 3.3.13.1
UseLengthChanged
- 3.3.13.2
UseHit
- 3.3.13.3
UsePierced
- 3.3.13.4
UseCastTerminating
- 3.3.13.5
UseCastFire
- 3.3.13.6
UseCanPierce
- 3.3.14
FastCastEventsModuleConfig (Parallel + Concurrent)
- 3.3.14.1
UseLengthChanged
- 3.3.14.2
UseHit
- 3.3.14.3
UsePierced
- 3.3.14.4
UseCastTerminating
- 3.3.14.5
UseCastFire
- 3.3.14.6
UseCanPierce
- Special
- 4.1 FastCastEventsModule
- 4.1.1 Why?
- 4.1.2 Examples
Performance
- Frame exeuction: WIP benchmark
- average fps, max fps, min fps: WIP benchmark
Refactor/Improvements/Updates
This is WIP.
I think there are a lot of things that need to be improved, like ActiveCast.Trajectories, since it wastes memory. I’ll change it to ActiveCast.Trajectory. I’ll also make FastCast2 support both non-parallel and parallel, add Motor6D transformation optimizations, and fix the HighFide = 2 bug.
I’ll also optimize operations where possible.
As for how FastCast2 currently handles projectiles, it uses multiple RunService loops for each projectile, which I’m considering changing.
Hello everyone, I’ve been inactive on the devforum for the past few weeks and stopped updating FastCast2 last month. I’d like to share my thoughts—what’s good, what needs improvement, and introduce a new API for FastCast2.
Please note that I’m currently unable to work on or update FastCast2 because my PC is on its last legs, and I don’t have enough money to repair it. I also haven’t switched to Linux yet. However, remember my promise: once I get my PC back, I’ll make one final update before switching to Linux.
Documentation updates
I think the documentation is already simple and easy to understand, but the API references alone don’t make it clear how to use it.
.new).newParallel()).newBehavior():RaycastFire(...):BlockcastFire(...):SpherecastFire(...)GetVelocityCast(...)GetAccelerationCast(...)GetPositionCast(...)SetVelocityCast(...)SetAccelerationCast(...)SetPositionCast(...)PauseCast(...)AddPositionCast(...)AddVelocityCast(...)AddAccelerationCast(...)SyncChangesToCast(...)SyncChangesToCastTerminateCast(...):SetBulkMoveEnabled(...):SetObjectCacheEnabled(...):SetFastCastEventsModule(...):Destroy()WorldRootEventsLengthChangedHitPiercedCastTerminatingCastFireDispatcherObjectCacheObjectCacheEnabledBulkMoveEnabledMotor6DEnabledFastCastEventsModuleCasterOutputActiveCastCleanerObjectCacheCacheHolderSyncChangeStateInfoHighFidelityBehaviorDefaultAutomaticAlwaysHighFidelitySegmentSizeHighFidelitySegmentSizeworksPausedTotalRuntimeDistanceCoveredIsActivelySimulatingPierceIsActivelyResimulatingCancelHighResCast(Might remove)Trajectories(Might change{[number]: CastTrajectory} toCastTrajectory`)StartTimeEndTimeOriginInitialVelocityAccelerationVisualizeCastsVisualizeCastSettings-> Ref behaviorFastCastEventsConfig-> Ref behaviorFastCastEventsModuleConfig-> Ref behaviorRayInfoParametersWorldRootMaxDistanceCosmeticBulletObjectCanPierceModuleUserDataTypeCFrameSize(ActiveBlockcastData)Radius(ActiveSpherecastData)RaycastParamsMaxDistanceAccelerationHighFidelityBehaviorHighFidelitySegmentSizeCosmeticBulletTemplateCosmeticBulletContainerAutoIgnoreContainerSimulateAfterPhysicAdaptivePerformance(Might remove)VisualizeCastsVisualizeCastSettings- 3.3.12.1
Debug_SegmentColor- 3.3.12.2
Debug_SegmentTransparency- 3.3.12.3
Debug_SegmentSize- 3.3.12.4
Debug_HitColor- 3.3.12.5
Debug_HitTransparency- 3.3.12.6
Debug_HitSize- 3.2.12.7
Debug_RayPierceColor- 3.2.12.8
Debug_RayPierceTransparency- 3.2.12.9
Debug_RayPierceSize- 3.2.12.10
Debug_RayLifetime- 3.2.12.11
Debug_HitLifetimeFastCastEventsConfig(Concurrent)UseLengthChangedUseHitUsePiercedUseCastTerminatingUseCastFireUseCanPierceFastCastEventsModuleConfig(Parallel + Concurrent)UseLengthChangedUseHitUsePiercedUseCastTerminatingUseCastFireUseCanPiercePerformance
Refactor/Improvements/Updates
This is WIP.
I think there are a lot of things that need to be improved, like ActiveCast.Trajectories, since it wastes memory. I’ll change it to ActiveCast.Trajectory. I’ll also make FastCast2 support both non-parallel and parallel, add Motor6D transformation optimizations, and fix the HighFide = 2 bug.
I’ll also optimize operations where possible.
As for how FastCast2 currently handles projectiles, it uses multiple RunService loops for each projectile, which I’m considering changing.