[Update] Net Rewinder is now available on the Asset Store here.
Net Rewinder is a server side hitbox rewinder / lag compensator for use with any networking library. It focuses on doing only one thing, and doing that one thing simply and well. One function call rewinds hitboxes (your selected transforms) to exactly where they were at the time you specify. You can use any representation of hitboxes you want, any networking library, and any hit detection routines you want. You can run whatever tests you want against them, and then restore them to their original positions with another call.
Features:
One-button setup for most use cases
One-call hitbox rewind
One-call hitbox restore
Full source code included
Use any hitbox system
Zero update allocations
Supports 2D and 3D - anything with a transform can be rewound
Preview demo scene with commented code
Works with any network library (UNet,Photon, Bolt, Forge, etc)
Sample code used for the preview screenshots above
Net Rewinder freshly added to an FPS character
One click later
Note:
This asset requires some programming skill to use effectively. Hitboxes themselves are not implemented in Net Rewinder. This is to allow you to use whatever hitbox implementation you want (eg UFPS). This asset simply (and I mean simply!) takes care of rewinding so you can do server-side hit checks for networked FPS and other fast-paced network games.
I’d be interested to see how it is working with Forge. Feel free to hit us up (support@beardedmangames.com), maybe we can help to see if there is a way we can make this streamlined with Forge
Do you have to manually add each transform to the list? is there a way of adding a GameObject and then all tagged transforms are then added?
no need to comment, just read the documentation. A script is added to each object and then in the script you add the hit boxes. So I guess once created all hit boxes in that script are updated.
By default everything with a Collider under the gameObject will be added to the list, though if people would find a tag system easier I could certainly add that as an option. Grabbing all the colliders by default just seemed the most natural behaviour to me.
Expected price is $25. It’s under review by the asset store team right now.
No problem, we will be checking our email soon, lots of vacations and such have interrupted our email checking (high volumes). Either @Cranick or I should be getting to it soon
CodeBison, What kind/how much overhead is incurred with the rewinder?
For a multiplayer, FPS game with fast movement and lots of shots fired, can it keep up without bogging down the server, esp. if the server is also hosting a client?
Are there any situations where the rewinding is non-deterministic or you might get different results for different clients shooting at the same target?
Any flaws/caveats not referenced in the documentation?
Net Rewinder is quite performant. You should have no trouble at all using it in a fast-paced FPS game. I’ve tested rewinding 125 npcs with 15 hitboxes each every frame and was able to run the simulation at 45-55FPS on my system, while rendering all 125 npcs and visualizations of their hitboxes (screenshot 2 above). Obviously, in a real FPS, you won’t be rewinding every frame, you won’t be displaying visuals for your hitbox rewinds, and you’ll rarely be rewinding more than a handful of characters at a time. In real-world use cases, you’ll probably never see it above 1% of your frame time. Generally speaking, the raycast to determine if a bullet hits will probably be more expensive than the rewind to make sure the raycast is accurate.
If you need more hard performance data, please let me know.
Regarding deterministic results, you have complete control over how accurate Net Rewinder is. Since it’s run on the server, it gets its data from your authoritative copy of the world state. If you use the default settings (appropriate for most use cases, though massive simulations with thousands of entities might need different settings), it will record the position of every hitbox every single physics frame. This means that you can rewind any character to the exact historical position and orientation they had at any timestep in their history. In the unlikely event that you need to reduce the recording fidelity for any reason (thousands of agents etc), rewind requests for timesteps between the snapshots will be interpolated from their neighbouring timesteps, and may diverge slightly from their actual historical values. It should be noted, however, that hits from all clients will be tested against the same data, so they’ll all get consistent hit/miss results. The one exception to this is if the server is also a client. Since the local host won’t be using rewinding, they’ll be tested against live data rather than the recorded results, and so will have a slight advantage in this case.
There are no Net Rewinder specific flaws/caveats I’m aware of beyond what’s mentioned in the documentation. There are obviously issues common to all network multiuser applications that will apply, but those are not unique to Net Rewinder. The most significant of these is that, due to the nature of predictive movement and interpolation used in fast-paced network games, not all users see the same presentation of the game world. They see close approximations, but there will always be points where their view will differ slightly from the server’s authoritative copy, even with the best compensations in place.
Sorry, I’ve written a bit of a novel here. Hopefully that helps with your questions. If not, please let me know.
Cameron, Thanks for that reply. Appreciate the detail.
One of my issues with multiplayer is the scenario where player A is aiming for player B; player A draws a bead, shoots, and scores on Player B but player B’s view shows player A still turning toward them and, though not quite there, BOOM!
Unfortunately, Rewinder can’t solve that.
However, as I think about it, I think I am confused about when I would use Rewinder.
If an authoritative server is running the simulation of events and the server receives a missile_has_been_shot event/command then the position of the players and the missile are both tracked (with absolute accuracy) on the server, though the representation on the clients may disagree due to lag. If the server says a missile hit a player, that is accurate and there is no need for rewinding is there?
Is Rewinder only for hit-scan type weapons?
Hey, just to clear any misunderstanding here. As I understand, this asset requires an authoritative server to function properly. So in a master-client structure(Photon Cloud without a server) it wouldn’t properly work. Can you confirm on that?
The rewinding itself doesn’t add network pressure. What adds network pressure is having any kind of server authoritative setup. If you have a client acting as the server to ensure the other clients aren’t cheating, that incurs network overhead. Rewinding on the server (matter client) is just how you determine if shots are legit. You’ll be doing a lot of other things on the server as well: Controlling level changes. Verifying movement validity. Handling circle of concern. Etc
If you don’t need to protect against cheating (eg if you have a fully coop experience) then you don’t need a server authoritative setup. Which means you trust the client and let it take care of its own hit detection, movement, etc. In which case you have no need of things like hitbox rewinding.