Introduction to Networked Physics

Hey everybody, I’m Glenn Fiedler, a professional game developer based in Los Angeles.

作者来自洛杉矶,职业游戏开发。

I’ve been doing game development professionally for 15 years and for 10 of these years I’ve specialized as a network programmer. Much of my spare time over this period has been dedicated to researching the problem of networking a physics simulation. In this article series I aim to share everything I’ve learned about networked physics with you.

这哥们儿做游戏15年了,其中有10年是做网络程序员,重点在做物理模拟的网络设计。

It’s a lot of work to write these articles and I do it entirely in my spare time. With your support I can find the time to continue writing articles in this series. Please support my work via patreon if you can.

Getting started with networked physics is pretty difficult. You may wonder if your physics simulation need to be deterministic in order to network it? Should you send state of the physics objects across the network or something else like events for collisions or forces? Should you send data over UDP or TCP? Should you use client/server or peer-to-peer? Do you need a dedicated server? How to hide latency for player actions? How to stop people cheating?

People often ask me these questions. Nine times out of ten the correct answer depends on their network model. You may not even be aware of your network model you are using or plan to use but in fact you have to choose one and your choice of network model makes certain things easy and other things difficult.

In this article series we’re going to build up to a discussion of different network models by networking an example physics simulation in three different ways. I call these basic techniques ‘synchronization strategies’. They are: deterministic lockstepsnapshot interpolation and state synchronization.

这就是重点了,同步策略的三种解决方案。

Bandwidth is another important aspect of networked physics. How can I possibly synchronize the state for all these objects? So we’re going spend an entire article on a case study of bandwidth optimization showing you how to reduce the bandwidth used by the snapshot interpolation technique from 18 megabits per-second to less than 256 kilobits per-second.

带宽的考虑,不考虑带宽的网络程序员就是废柴。作者说它能从18mb/s,降低到256kb/s 。

Armed with the synchronization strategies and reasonable bandwidth usage we’re now ready to discussclient/server vs. peer-to-peer. Pros and cons will be discussed, as well as lessons I’ve learned the hard way shipping peer-to-peer and client/server games. This article has extremely concrete, pragmatic information you’ll not find anywhere else.

心中有同步策略这把剑,有带宽上的优化策略,这个时候才可以讨论网络模型是c/s,还是p2p

Finally, we discuss different network models built on the basic synchronization strategies and the details of each. Here you will find many different options for networking your physics simulation: deterministic lockstep network modelsdistributed authority network models and server authoritative network models with client side prediction.

最后,总结出来的三种网络模型,你选一种就好了。

So strap in and get ready. We have a lot of material to cover!

posted @ 2015-11-03 16:37  DesignYourDream  阅读(149)  评论(0)    收藏  举报