physics

Networked Physics in Virtual Reality

Introduction About a year ago, Oculus approached me and offered to sponsor my research. They asked me, effectively: “Hey Glenn, there’s a lot of interest in networked physics in VR. You did a cool talk at GDC. Do you think could come up with a networked physics sample in VR that we could share with devs? Maybe you could use the touch controllers?” I replied “F*** yes!" cough “Sure. This could be a lot of fun!

State Synchronization

Introduction Hi, I’m Glenn Fiedler and welcome to Networked Physics. In the previous article we discussed techniques for compressing snapshots. In this article we round out our discussion of networked physics strategies with state synchronization, the third and final strategy in this article series. State Synchronization What is state synchronization? The basic idea is that, somewhat like deterministic lockstep, we run the simulation on both sides but, unlike deterministic lockstep, we don’t just send input, we send both input and state.

Snapshot Compression

Introduction Hi, I’m Glenn Fiedler and welcome to Networked Physics. In the previous article we sent snapshots of the entire simulation 10 times per-second over the network and interpolated between them to reconstruct a view of the simulation on the other side. The problem with a low snapshot rate like 10HZ is that interpolation between snapshots adds interpolation delay on top of network latency. At 10 snapshots per-second, the minimum interpolation delay is 100ms, and a more practical minimum considering network jitter is 150ms.

Snapshot Interpolation

Introduction Hi, I’m Glenn Fiedler and welcome to Networked Physics. In the previous article we networked a physics simulation using deterministic lockstep. Now, in this article we’re going to network the same simulation with a completely different technique: snapshot interpolation. Background While deterministic lockstep is very efficient in terms of bandwidth, it’s not always possible to make your simulation deterministic. Floating point determinism across platforms is hard. Also, as the player counts increase, deterministic lockstep becomes problematic: you can’t simulate frame n until you receive input from all players for that frame, so players end up waiting for the most lagged player.

Deterministic Lockstep

Introduction Hi, I’m Glenn Fiedler and welcome to Networked Physics. In the previous article we explored the physics simulation we’re going to network in this article series. In this article specifically, we’re going to network this physics simulation using deterministic lockstep. Deterministic lockstep is a method of networking a system from one computer to another by sending only the inputs that control that system, rather than the state of that system.

Introduction to Networked Physics

Introduction Hi, I’m Glenn Fiedler and welcome to the first article in Networked Physics. In this article series we’re going to network a physics simulation three different ways: deterministic lockstep, snapshot interpolation and state synchronization. But before we get to this, let’s spend some time exploring the physics simulation we’re going to network in this article series: Your browser does not support the video tag. Here I’ve setup a simple simulation of a cube in the open source physics engine ODE.

Collision Response and Coulomb Friction

Introduction Hi, I’m Glenn Fiedler. Welcome to Virtual Go, my project to create a physically accurate computer simulation of a Go board and stones. So far in this series, we have mathematically defined the go stone, rendered it, determined how it moves and rotates, and discussed how its shape affects how it responds to collisions. Now in this article we reach our first milestone: A go stone bouncing and coming to rest on the go board.

Rotation & Inertia Tensors

Introduction Hi, I’m Glenn Fiedler. Welcome to Virtual Go, my project to create a physically accurate computer simulation of a Go board and stones. In the previous article we detected collision between the go stone and the go board. Now we’re working up to calculating collision response so the stone bounces and wobbles before coming to rest on the board. But in order to reach this goal we first need to lay some groundwork.

Go Stone vs. Go Board

Introduction Hi, I’m Glenn Fiedler. Welcome to Virtual Go, my project to create a physically accurate computer simulation of a Go board and stones. In this series so far we’ve defined the shape of a go stone, rendered it using 3D graphics hardware and simulated how it moves in three dimensions. Our next goal is for the go stone to bounce and come to rest on the go board. Understandably, this is quite complicated, so in this article we’ll focus on the first step: detecting collisions between a go stone and the go board.

How The Go Stone Moves

Introduction Hi, I’m Glenn Fiedler. Welcome to Virtual Go, my project to create a physically accurate computer simulation of a Go board and stones. In previous articles we mathematically defined the shape of a go stone and tessellated its shape so it can be drawn with 3D graphics hardware. Now we want to make the go stone move, obeying Newton’s laws of motion so the simulation is physically accurate. The stone should be accelerated by gravity and fall downwards.

Tessellating The Go Stone

Introduction Hi, I’m Glenn Fiedler. Welcome to Virtual Go, my project to create a physically accurate computer simulation of a Go board and stones. In this article we want to draw the go stone using OpenGL. Unfortunately we can’t just tell the graphics card, “Hey! Please draw the intersection of two spheres with radius r and d apart with a bevel torus r1 and r2!”, because modern 3D graphics cards work by drawing triangles.

Shape of The Go Stone

Introduction Hi, I’m Glenn Fiedler. Welcome to Virtual Go, my project to create a physically accurate computer simulation of a Go board and stones. If you play Go, you know that a biconvex go stone has an interesting wobble when it’s placed on the board. This wobble is a direct consequence of its unique shape. I’d like to reproduce this wobble in Virtual Go, so let’s to spend some time studying go stone’s shape, so we can capture this wobble and simulate it on a computer :)

Introduction to Virtual Go

Introduction Hi, I’m Glenn Fiedler. Welcome to Virtual Go, my project to create a physically accurate computer simulation of a Go board and stones. I’m a professional game programmer with 15 years experience in the game industry. Over the years I’ve worked for Irrational Games, Team Bondi, Pandemic Studios, Sony Santa Monica and most recently Respawn Entertainment. During my career I’m extremely proud to have worked on such games as ‘Freedom Force’, ‘L.

Networked Physics (2004)

Introduction Hi, I’m Glenn Fiedler and welcome to Game Physics. In the previous article we discussed how to use spring-like forces to model basic collision response, joints and motors. In this article we’re going to discuss how to network a physics simulation. First Person Shooters First person shooter physics are usually very simple. The world is static and players are limited to running around and jumping and shooting. Because of cheating, first person shooters typically operate on a client-server model where the server is authoritative over physics.

Spring Physics

Introduction Hi, I’m Glenn Fiedler and welcome to Game Physics. In the previous article we discussed how to simulate the motion of rigid bodies in 3D. Now we’re going to discuss how to implement spring physics. The physics behind springs is simple but extremely versatile and useful. You can use springs to link points together to model rope and string, cloth, and even blobs of jelly. Springs can also be used to implement basic collision response, and to create joints that constrain the motion of rigid bodies.

Physics in 3D

Introduction Hi, I’m Glenn Fiedler and welcome to Game Physics. In the previous article we discussed how to integrate our physics simulation forward at fixed delta time increments, regardless of display framerate. In this article we are going to simulate motion in three dimensions. Rigid Bodies We will concentrate on a type of object called a rigid body. Rigid bodies cannot bend, compress or deform in any way. This makes their motion much easier to calculate.

Fix Your Timestep!

Introduction Hi, I’m Glenn Fiedler and welcome to Game Physics. In the previous article we discussed how to integrate the equations of motion using a numerical integrator. Integration sounds complicated, but it’s just a way to advance the your physics simulation forward by some small amount of time called “delta time” (or dt for short). But how to choose this delta time value? This may seem like a trivial subject but in fact there are many different ways to do it, each with their own strengths and weaknesses - so read on!

Integration Basics

Introduction Hi, I’m Glenn Fiedler and welcome to Game Physics. If you have ever wondered how the physics simulation in a computer game works then this series of articles will explain it for you. I assume you are proficient with C++ and have a basic grasp of physics and mathematics. Nothing else will be required if you pay attention and study the example source code. A physics simulation works by making many small predictions based on the laws of physics.