A Multiplayer Platformer game demo on websocket+UDP peer-to-peer with delayed-input Rollback Netcode inspired by GGPO
v1.3.5 new features
v1.3.4 new features
v1.2.9 new features
v1.2.8 new features
EvtSub
object layer)Please checkout the demo video on YouTube(basic ops, field tests) or BaiduNetDisk(basic ops, field tests) (network setup was 4g Android v.s. Wifi PC via internet while UDP peer-to-peer holepunch failed, input delay = 2 frames i.e. ~32ms).
It's a Unity version of DelayNoMore, a Multiplayer Platformer game demo on websocket with delayed-input Rollback Netcode inspired by GGPO -- but with the backend also rebuilt in C#.
(battle between 4g Android v.s. Wifi Android via internet while UDP peer-to-peer holepunch failed, input delay = 2 frames i.e. ~32ms, the following GIF is converted from this video, please also checkout these older version videos, this dedicated slope dynamics video and this dedicated multi-enemy-head-walk video)
(demo for freezer buff since v1.2.7, original video here)
(a typical framelog comparison from 2 peers)
(where to find framelog files)
(how input delay roughly works)
(how rollback-and-chase in this project roughly works)
(though using C# for both backend & frontend now, the idea to avoid floating err remains the same as shown below)
proj-root/backend> dotnet run
Open OfflineScene
to try out basic operations.
Open LoginScene
after launching the backend to try out multiplayer mode. Available test accounts are listed in DevEnvResources.sqlite. The steps are very similar to that of DelayNoMore CocosCreator version.
Referencing this document from Microsoft by far.
Kindly note that the proxy setting is not very helpful here when download is slow (alternatively, sometimes the download is just timed out due to DNS issue, you might also wanna have a try on changing DNS only), changing the endpoints from https
to http
is critical.
References
It's always non-trivial to mock fluctuating network behaviours, and in this game we might be interested in testing the performance of different input-prediction algorithms, therefore we'd like to mock DETERMINISTIC inputs for a single player including
a)
the initial map setup (from tmx), andb)
the initial character choices of all players, andc)
received RoomDownsyncFrame
s, InputDownsyncFrame
s (from websocket) and InputUpsyncFrame
s (from UDP peers) at EXACTLY THE SAME TIMINGS for different runs of different algorithms in test.The first two, i.e. a)
& b)
are easy to mock and c)
is possible by mocking OnlineMapController.pollAndHandleWsRecvBuffer and OnlineMapController.pollAndHandleUdpRecvBuffer.
I should've provided an example of this type of test for the alleged good performance of my algorithm, especially for
Please refer to FAQ.md.