Is there any way to perfectly validate a cast? I tried using the start and end positions with a projectile motion equation and using tick() to log the start and end times of a cast and using them for t, but the results seem to differ by a good ±10 in the position compared to the simulation.
local function projectileMotionEquation(g, v, initialPosition, t)
return 0.5 * g * t ^ 2 + v * t + initialPosition
end
I am not going to maintain FastCast but I do have this if FastCast where to ever break. (I think FastCast is in a pretty solid state I would not expect it to break for a while… a long while…)
I have a quick question. How can I change my projectiles’ colors on 1 caster instead of having individual casters have different colors because it causes lag. I have tried changing it from the projectile container and then tried taking it out, changing the color, and putting it back it but also didnt work some how. Is there a sort of way to change the custonprojectiles’ color with only 1 caster? Or is there no way?
Hey, did you ever get around latency compensation? I was just about to program this but took a look at DevForum just to make sure it wasn’t done already…
Seems like you just need some API surfaces to accelerate the simulation to any point in time.
Probably need API surfaces along the lines of:
ActiveCast:PredictHit(): Vector3? - Fast forward all the way to the end of trajectories so server can see what the predicted hit location is ahead of time
ActiveCast:GetPositionAtTime(time: number): Vector3? - Get position at t seconds after cast start time
ActiveCast:GetPositionAtTick(tick: number): Vector3? [Bonus] - Get position at a unix timestamp
Is there a GitHub repo where I can submit a pull request if I end up writing this into the library for my own project?
This module is still incredibly useful, though it’s a shame that it’s no longer being developed. I wish someone would extend it to work with parallel lua as I imagine it would improve performance a bit.
If I want the projectile to not be laggy (I don’t want the server to handle it, yet I want every player to see it) / be accurate in terms of hit detection what should I do?
well, fastcast is intended for server sided detection and simulation and not client sided replication of the simulation but you can do your visuals on the client and do the hit detection on the server too, but this will create issues with synchronization.
You should be fine using fastcast on the server for the most part but if u need to use it on the client what I would do is get the time it took from shooter client to the server based on which get current position relative to time and speed and either start hit detection from there or instead u could multiply the time with the velocity of the projectile. You can do whatever u did from client to sever for server to other clients;
Either approach works and has its own limitations.