Unity Plug-in:Multiplayer Synchronized Ragdoll


1.0 Introduction

The Multiplayer Synchronized Ragdoll plugin is capable of achieving network synchronization functionality for up to 30 ragdolls. This plugin provides two types of network synchronization modes to meet the differentiated requirements of synchronization accuracy and efficiency. The network part of this plugin is based on Photon, while the ragdoll part is based on Ramecan Mixer.

2.0 Quick Start

STEP1: Preparing the Doll Character

A structure is required for separating the doll and the model.

Step 2: Mount the Ragdoll Synchronizer Script

Mount the Ragdoll Synchronizer on Root and choose the mode to be used.

Full Body Mode:

The Full body mode does not require any special settings, you just need to name the state well.

Key Bones Mode:

For key bones mode, we need to specify the key skeletons that need to be synchronized and also specify the name of the state.

STEP3:Configure Photon PUN

Open the Photon Server Settings configuration window and fill in your PUN App Id in the corresponding position.

STEP4:run the program

After the program runs, it will automatically generate characters. Press the “R” key to turn on and off the doll’s status.

3.0 Implementation Principles

3.1 Full Body Synchronization:

In order to achieve more accurate effects, we choose full-body synchronization and do not enable physics simulation for the copied objects.This way, the pressure on player devices is low, each person only performs their own physical simulation, but the network pressure is relatively high. Once there is network jitter, all ragdolls except for the player’s own will freeze or behave strangely.After testing, the upload traffic of each client almost reaches 10-20kb/s, which is slightly high, but the effect is excellent.We directly synchronize the position, rotation  on each bone of the ragdoll.

However, such a crude scheme will have some issues:

The network synchronization frequency (about 10 times per second) is much lower than the refresh rate, and the local simulation results are biased, leading to jitter.The Photon component takes into account the interpolation problem, as the still-present jitter is due to excessive physical calculation deviation.It requires simultaneous synchronization of data for 20 bones, posing high requirements for network traffic.

3.2 Key Bones Synchronization:

For network performance, sacrifice a portion of the doll network synchronization accuracy, only sync the key skeletons, and enable all dolls in the client to run physical simulations.The pressure on player equipment is high, each client needs to run physical simulations for all dolls, which has low network pressure.After testing, the upload speed per client is almost only 3-8kb/s.Sync the key skeletons and perform physical simulations for the remaining skeletons.

The synchronization effect is very good, with only minor jitters in the key skeletons that may occur in more significant jitters under complex collision scenarios.

The synchronization quantity further decreases.

发表回复

您的电子邮箱地址不会被公开。 必填项已用*标注

AtomBits

从原子到比特、从现实到虚幻。公司专注于虚拟现实方向的内容和应用的开发,以及虚拟现实方向工程师培训体系的打造。我们已经并且会继续在这个领域不断探索!


业务方向

  • CG内容制作
  • VR开发
  • 虚拟偶像
  • 工程师培训

快捷链接

联系我们

  • 北京市朝阳区新城市广场潮驿178 A座302室-100022
  • (010) 86464993
  • developer1@atombits.cn
  • developer2@atombits.cn