I’m trying to get the classic brick battle tools (eg rocket, superball, etc) to be as responsive as possible on the client. My first attempt was to use the conventional way of doing things, with the server waiting for the remote event the client fires. However, for a game like brick battle that was built around non-FE, this response time is really unacceptable (averaging at about 300 ms).
Last, I tried TheNexusAvenger’s buffer technique. This is essentially just exploiting a replication quirk. The server pre-creates the projectile with a BodyPosition out in the middle of nowhere, with the firing client as the network owner. The firing client can then retrieve it by locally destroying the BodyPosition and signaling the server to do the same, allowing other clients to see the firing client move it around. The server is responsible for handling damage through a Touched event on the projectile. While this works great for response times, I discovered it doesn’t work perfectly.
The issue with this approach is lag. Let’s say a player with a 300 ms ping fires a superball projectile. Once the remote event’s signal arrives the server has to reenact ~300 ms worth of the projectile’s trajectory. The Touched event only “wakes up” sometime after this reenactment, 9 times out of 10 missing the target player getting hit. Maybe the events only fire once the server is certain it’s done catching up?
A demonstration. Server on the left and client lagged at ~300 ms on the right. I start with a superball using TheNexusAvenger’s technique. Notice how the humanoids are only damaged after the “wake up” of about 300 ms. About half way in, I use a superball that only invokes the server.
I’d really like some help with knowing whether this is unavoidable or if I’m just missing something (after all, this technique was used in the official 2018 ROBLOX Deathbattle rewrite). I’m using Studio settings > Network > IncomingReplicationLag to simulate my lag. Could the lag simulation be causing my problem?