top | item 32936276

(no title)

piinecone | 3 years ago

I'm using a fork of Unreal Engine 4.20, and I'm using the substepped physics that UE ships with. I have a fixed timestep PR simmering for if and when it's time to implement a proper rewind/replay system for all vehicle movement.

I attempted the standard prediction/correction implementation used for deterministic movement systems and got it working for the deterministic aspects of the vehicle's movement system, but naturally couldn't make it work for the core, non-deterministic physics, as that will require fixing the timestep and probably doing other things I haven't thought about / don't understand yet.

For now, the system works like this:

- basic client vehicle movement is non-deterministic physx + deterministic overrides

- special moves are deterministic but client-predicted

- weapons systems are deterministic but client-predicted

- server-side anticheat model is derived from me moving around and generating believable movement curves so the server can check that any given client move it receives is appropriate given its history / state of the world

- server also (supposedly!) handles noclip and flying cheats (this was a fun month)

- clients predict hits, server authorizes them

- simulated proxies (other clients in your world) mostly move according to projective velocity blending[0], though there are special cases for some of the special moves (spins)

- collisions are blended between the replicated state of the world and the client's local simulation [1]

- probably most importantly, the server creates replay files during matches which the game coordinator/serving system scoops up and saves, so I can (at some point) generate useful statistics and review matches to detect and improve cheat handling

I would have loved to do the networked physics really right, like Rocket League did, but I couldn't quite pull it off (I'm one guy with kids and a job and just not enough brainpower!), so I opted for what I hope is "good enough" for a small project like this: give the client a great experience, put all vehicles and projectiles in mostly the same position at the same time in all worlds (since they're momentum-based entities latency-based predictions are usually quite accurate), run an anticheat model on the server, and save replays to find and review anomalies.

If the game does okay and people are enjoying it I will get that fixed timestep/rewind replay PR done.

I hope that was a good answer! Let me know if I can tell you anything else. Something I didn't mention here is the networked projectile movement, which was the most fun to work on. I plan to write about that, too, at some point.

[0]: https://www-inf.telecom-sudparis.eu/COURS/MultiplayerCourse/...

[1]: https://www.youtube.com/watch?v=LPRK5J5-3QQ&list=PLpE81hvqYF...

discuss

order

No comments yet.