Tag Archives: Game Physics

GDC16 – Day 1

It’s Math Day!!! The first two days of the Game Developers Conference is always given to specialty tracks and summits. For the past twelve years, there has been a Math for Game Programmers summit on Monday and Physics for Game Programmers on Tuesday. They’ve combined the two into a one-day summit, with the majority of talks being focused on the mathematics, but often with the physics of the game play in mind. As with any conference, some of the talks are huge hits, some are misses, some are good talks but not directly pertinent to your work or interests. This was the case on Monday as well. Fortunately, there were far more hits than misses. On the balance, it was a fantastic summit.

First up was J. Kyle Pittman (@piratehearts) to discuss jump physics. In our course, Math and Physics for Game Programmers, we teach students the basics of uniformly accelerated motion and the Forward Euler Method for numerical integration. When doing this, we certainly talk about free-fall motion and the kinematics of a jump, but Mr. Pittman made some great arguments for why doing jumps physically correctly could often be incorrect for good game play. Often, the acceleration due to gravity, g, is preset to a given value, often 9.8 m/s2 downward, and the dynamics of a jump are then determined by the vertical velocity, v_y, of the jump. This can lead to, although realistic, jumps that feel too floaty or too heavy, and often jump physics that do not match the necessary trajectories demanded by the level design. Rather than pre-determining the value of g, Mr. Pittman suggests allowing it to be determined by the constraints of the level design. If a gap distance and maximum height are known, the value of g and v_y can be calculated so that it is possible for the character to complete the jump.

 g = - \frac {2 h} {t_h}
 v_y = \frac {2 h v_x} {x_h}

where h is the maximum height of the jump, t_h is the time to reach the maximum height, v_x is the maximum horizontal speed of the player’s character, and x_h is the horizontal distance covered to the reach the maximum height. Combining these yields a value for the acceleration due to gravity that relies solely on the level design parameters and ensures that a jump is makeable by a player.

 g = - \frac {2 h {v_x}^2} { {x_h}^2}

Groovy!

The other technique Mr. Pittman explained was using a different value for gravity for ascent versus decent. Mario’s jump physics included increasing the acceleration due to gravity by a factor of three once the jump reached it’s maximum height. This, of course, is physically inaccurate, but in developing a game, you’re goal is to produce good gameplay with believable physics, but simulation-level accurate physics. It’s funny how our brains will sometimes see a simulation that is physically accurate, but believe it’s totally fake.

Next up was Squirrel Eiserloh’s talk on camera shake. I always think of this as the Star Trek effect. When there’s trauma to a player, either from being hit or landing on a surface after a jump or fall, a bit of camera shake can lend realism to the visuals, much in the same way as camera shake was used, perhaps overused, in the original Star Trek episodes to indicate trauma to the ship. The big take-away from this talk was to use both rotational and translational shake in 2D environments, but only rotational shake in 3D. If you jitter the translation of a camera, you can easily end up with the camera inside of a wall. In a VR environment, just don’t, unless it is your intent to cause motion sickness and nausea in your players.

Later in the day, Simon Strange discussed finding distances in the training simulator, Strike Group Defense, a serious game designed to train Navy personnel on the best anti-ship missile defense strategies and tactics. Since naval engagements happen over hundreds of miles, the curvature of the earth is significant and must be taken into account. Given this, the game makes use of spherical coordinates to determine distance. Rather than using the complex trigonometry of calculating arc length on a great circle between two points, Mr. Strange opted instead to rotate the world so that the player was at the north pole. This means that the polar angle is a direct measure of the distance between the player and any point on the map, d = R_{Earth} \phi. This is brilliant, and something that Prof. Grondahl and I have tried to explain to our students over the years. Invest in a bit of work up front in order to save a lot of work later on. This is exactly what this method does. You invest in a bit of work ahead of time to rotate the player position to the +z-axis. After you do this, calculating distances on the curved surface of the Earth is a simple and, more importantly, computationally cheap calculation.

The last talk that I’ll highlight is from the always brilliant Gino van der Bergen. This year’s talk was on enforcing rotational joint limits in quaternian space. Quaternians are awesome mathematical objects first developed by Hamilton in the late 1800s. In fact, Hamilton was so excited about his recognition of the key to quaternian on his way home from the pub that he etched the basic complex numbers rules into the stonework of a bridge in Dublin. You have to love mathematical graffiti. Mr. van der Bergen did a great job of explaining why and how quaternions eliminate the singularity and degeneracy issues inherent in traditional matrix-based rotation operators.

Keep an eye on the website Essential Math. You can find slides from the Math for Game Programmers summits of previous GDCs, and in time the 2016 slides, including Mr. van der Bergen’s presentation on quaternian space, will be posted for public consumption.

At the end of the day, I took my camera and set out to capture some images around the Powell and Market region. If you’ve ever been in this area of San Francisco, you know there is a significant homeless population. The reasons for persons finding themselves homeless are as various and unique and the people themselves, but one thing that is common among them is their effective invisibility. Of course, people physically see them, but they consistently choose to disregard their presence, treating them as essentially invisible and separate from the rest of the sea of humanity shopping, commuting to and from conferences and work, waiting to ride the cable cars, and doing all the other things we’re used to doing. One such individual, an amputee, was sitting in his wheelchair off to the side of the rest of the buzz of tourists and townies. The look on his face was one of resigned dejection as people walked by with not even a glimmer of recognition that they just passed a fellow human being.

Photo52-2016_Week11_Lost

GDC 2013 – Tuesday is Physics Day ….kinda

Tuesday was Day Two of the Math and Physics for Game Programmers tutorial. Monday was all about the mathematics, and Tuesday was supposed to be all about the physics. There was one great talk from which I was able to extract a better understanding of configuration space objects, but the rest of it was …meh. As with yesterday, those talks which were edited and tweaked from last year showed improvement, those that weren’t still sucked.

The day started out with a demonstration of a simulation of a Go stone. …yeah. A stone. It seemed that the speaker, Glenn Fiedler from Sony Santa Monica, was simply pleased with himself that he’d recreated the wheel. He went through the process of creating his stone model, then he described the basic translation and rotational dynamics he deployed without discussing the specific details. It might have been a more fruitful talk if there were more details in how he was integrating the motion, why the integration works the way it does, and described the fundamental principles involved. Although his simulation worked pretty well, during talk, there were a few conceptual errors, especially about the properties of the moment of inertia tensor. He kinda had the right idea, but not really. Granted it’s a tough thing to pick up on your own, but if you’re giving a talk on the topic, you should have a genuine and thorough understanding of the topic.

1364390049722The second talk of the day was “The Separating Axis Test” by Dirk Gregorius from Valve. Gino van den Bergen of Dtecta gave a talk last year on collision detection using Minkowski differences and configuration space objects, but I must admit that the process was still fuzzy to me. Dirk’s talk on the issue really helped. Don’t get me wrong, Gino is the man and does a great job, and when his talk came up later in the afternoon, I was able to grasp a bit more about how CSOs work. I doubt that they’ll make it into the PHYS191 course in a formal way, but I may put a bonus section on it in the textbook this summer if for no other purpose than to ensure that I understand it correctly myself. No better way to see if you really understand something that to try to teach it to someone else. The rest of the afternoon was rather blah, unfortunately. Dirk’s and Gino’s talks certainly made up for the mediocrity of the others.

Since the Expo Hall isn’t open until Wednesday, during my downtime between when I left the physics tutorial and supper, I worked on taking some photos. I took some of this earlier in the morning on my way to breakfast, but was disappointed with the results. Yes, I was at the Rally in the 100 Acre Wood, but I didn’t work on many panning shots there so I’m really out of practice. That showed as I tried to get some panning shots of cyclists and streetcars. I gotta get back into proper form before the Kansas City Region SCCA season starts and definitely before the first IndyCar event I’ll work, the Indianapolis 500 Mile Race. Definitely have to have good panning skills there.

GDC-2013_03-26-13_005
Of course, one thing that is ever-present in San Francisco around the touristy areas are the street performers. Most are simply annoying, but there are some, like this duo, that really sounded good!

One of the coolest new things I’ve seen at GDC so far is the Video Game History Museum alcove. They have several coin-ops including one of my favourite games, Asteroids! (where’s my two-liter of Shasta and my Rush mix-tape?) The also had several classic consoles, some well-known, others not as well-remembered. Of course they had the Atari VCS (later known as the 2600), but they also had a Vectrex! That’s a tough find! There weren’t too many of these machines made, and even fewer of them have survived in playable form.

Chinatown_IntricateGraffiti_smThe day ended with a stroll through Chinatown, a requisite visit every year. There wasn’t anything new, really. The same peddlers were peddling the same cheap, cheesy crap. One change that greatly disappointed me was the defacement of one of Banksy’s pieces. I now feel very fortunate to have imaged this a few years ago. It was a really cool work, but now in spite of the plexiglass overlay placed in hopes of preserving the street art, it’s been covered with simple scribbles of white spray. It’s a damn shame.

Next post will be all about swag! The Expo Hall opens on Wednesday, and with a light session load today, I’ll be cruising through as much as I can, collecting as many goodies as I can.