Solving the Networked Physics Puzzle

by Glenn Fiedler on October 16, 2009

cube white

Traditional networking techniques work well for simple linear motion, but start to break down when networking complex rigid-body physics simulations where objects can tumble, stack and interact with each other. This light-hearted and humorous tutorial takes a look at various options, techniques and pitfalls to watch out for when networking this sort of simulation, providing you with a tool-bag of new techniques and ideas you can use to network your physics based game.

I’ll be performing this talk at the Montreal International Game Summit on November 16, 2009 – 10:15AM in the Verdun Room. I’m honored to be invited to perform one of the first sessions at the conference and hope to see some of you guys there! Please come up after the talk if you would like to discuss anything at all I will be available for questions.

Plus, this will be my first time visiting Montreal so I’m very excited! :)

I have the demo for the talk almost ready and have been working on the slides over the last few weekends. Right now I’m trying to lock down the overall theme of the talk and the content. My goal is to provide lots of interesting information without going to deep into the specifics on any one thing. Ideally folks should leave the talk with a great outline of the whole field and some great ideas and inspiration to take home to apply to their own projects!

Here is a more detailed version of my talk plan:

I intend to start by asking the question: why is it that very few games provide meaningful interaction with networked physics objects? In other words, folks it’s 2009 – why exactly are we still running around mostly static worlds shooting other people in the face?

There are many reasons. It is difficult to light a dynamic world. Character movement and animation is difficult. But also, it seems very difficult to network a dynamic world. Why is this? Traditional networking techniques don’t work. Objects can stack and tumble and interact with each other.

In truth: It’s like a puzzle. It’s actually really simple – you just need to think in a different way.

Quick 5-10 minute recap of a game networking engine. UDP vs. TCP, how to construct packets, serialization, reliability, flow control. All of the stuff in my online book and more at a brisk pace for folks already in the field. My goal is simply to get everybody on the same page and provide some very useful, concrete information for folks in the field. Here is my network engine and how I do everything.

The plumbing is out of the way. Now, lets explore options for getting a physics simulation on one computer to be simply *viewed* on another. Two main options: 1) run the simulation on one side and present an approximation on the client side (pure client/server model), 2) run the simulation on both sides and synchronize via state replication. Compare and contrast these two approaches. Touch on time synchronization and real-time nature of protocol and why it is now this way vs. traditional networking technique.

Latency compensation. Consider the same situation: A simulation synchronized between two computers, but now client controls their own object. Recap traditional client side prediction from FPS games. Attempt to apply it to network this physics simulation. Problems: Rewind and replay cost. Simulation islands. Complexity. Authority scheme as an alternative. Dining philosophers problem. Distributed programming. Dykstra. Consistency vs. throughput trade-off. Case studies.

Live demo. P2P authority scheme. Late joins. Corrections. Reverse corrections. Challenge: Think outside the box. Maybe client/server should not be the automatic choice? How important is anti-cheat for your game? How important is meaningful interaction with a dynamic world? Which one wins? Is it possible to have both? How?

Future looking. What can you do moving forward? What can physics engine developers do to make their engines network better? What do we need before this becomes practical? What will game networking look like in 10 years? Bandwidth considerations. Real-time protocol requirements. IPv6. RSVP, Flow Routing. QoS guarantees. Network neutrality.

Summary. Bring it back to the original point about the puzzle. Conclusion. Best approaches for each situation. Call to action. Triumphant dance. Q&A.

That’s about it for now. Please be sure let me know what you think and if you are planning on attending the conference. Sound off in the comments below – thanks guys!

{ 15 comments… read them below or add one }

martijn October 19, 2009 at 7:34 am

Sounds good!

But I certainly hope the the presentation will be available in pdf and/or video, as I can’t attend the conference… And will that demo (fiedlerscubes) become available for public?

Thanks,

Martijn

Reply

Glenn Fiedler October 19, 2009 at 12:30 pm

Thanks for the encouragement!

Yes, this time I have permission to release some videos of the demo. I’m also planning writing a supporting article covering the material in the talk and providing lots of extra resources and ideas for folks to explore. I don’t think I’ll really be able to fit everything I want to cover in a 45 minute talk! :)

Reply

Glenn Fiedler October 20, 2009 at 10:07 pm

Even better news, I just received permission from Sony to release the source code for the demo under an open source license. Thanks Sony!

Reply

martijn October 23, 2009 at 10:36 am

Excelent! Looking forward to that…

btw: you work for Sony now? ;)

Reply

Chris October 26, 2009 at 7:24 am

Always a pleasure to learn from a master, I look forward to sucking every last drop of knowledge I can out of whatever you upload :D

Reply

Glenn Fiedler October 26, 2009 at 9:30 am

Commencing source code obsfucation phase #1 :)

Reply

John Chan October 30, 2009 at 4:13 pm

Awesome! I’ll be attending MIGS and will see you there.
Will I be able to get access to the demo’s source code at the time of the conference?

Reply

Glenn Fiedler October 30, 2009 at 5:28 pm

I’ll have a link up at the end of the talk. You’ll be able to download in there, probably during the talk even if you wish :)

Reply

John Chan October 30, 2009 at 4:16 pm

Sorry, I’ve forgotten to ask one thing specific to MIGS.
This is my first time attending a conference like this and I don’t know how things work.
Do I need to specifically register for your session? What if there are too many people going to your session? Will I not be able to get in?
Your talk is THE reason I go to this conference :)

Reply

Glenn Fiedler October 30, 2009 at 5:29 pm

I think you just turn up. I’ve been told to expect around 80 or so in the room. Just arrive a bit early to make sure you get in, cheers

Reply

Glenn Fiedler October 31, 2009 at 1:32 pm

yes, I have been working for Sony Santa Monica for almost a year now. It’s a great team and I love my job!

Reply

Travis (mm) November 2, 2009 at 6:39 am

Glenn!

Long time – couldn’t find another way to contact you. In the US now I see, and it seems you are doing well too!

Was going through some old photos and thought I’d try to get in touch. Was planning a Sydney visit at Xmas and was hoping you’d still be in Wigram Rd!

I’ve got heaps of news. Pop me an email if you can.

Reply

John Chan November 12, 2009 at 2:02 pm

Hi Glenn,

I see 2 sessions (10:15am and 11:30am) in the final schedule. Are they the same or you’re preparing 2 different talks in MIGS?

Please let me know asap because I need to finalize my timetable with my manager by the tomorrow.

Many thanks,
John

Reply

Glenn Fiedler November 12, 2009 at 3:07 pm

Hello John, the talk is the 10AM session – the 11:30 session is a networking roundtable discussion which I am moderating.

Reply

John Chan November 15, 2009 at 3:23 pm

Awesome! Thanks.
See you tomorrow at your talk :)

Reply

Leave a Comment

Previous post:

Next post: