Tag Archives: Mathematics

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 – Monday Math Madness

2013-03-24 07.44.26It was a bit sketchy, but we finally made it to San Francisco for the Game Developers Conference (GDC). The insanely late snowfall in Kansas City resulted in our flight being delayed, but at least it wasn’t cancelled. This was the first time I have been through the deicing process. It was interesting, if time-consuming. Once we were in the air and above the clouds, everything seemed far less dreary and dreadful.

Upon arrival, we did the usual things: take the noisy BART ride to Powell station, leave our bags at the hotel, wander aimlessly until check-in time, check-in, get our GDC badges when registration opens, and celebrate with Naan & Curry. I’ve been to many different conferences, some big, some small, and the folks running the GDC have the process down to a science! Once registration opened, we were in and out with our badges within a couple of minutes. It was amazingly quick!

PowellTurnaround_smMonday morning also began in the traditional way with me waiting for the rest of the crew down by the cable car turn-around at Powell St taking photos. I know that I end up taking a lot of the same types of shots year after year, and I need to work on my variety, but I just dig that spot so much for imaging the cable cars. Once everyone has mustered, we head off to the best breakfast joint in the area, Mel’s Drive-In. Mel’s is one of the best places around to have breakfast, and with steak-n-eggs only costing $7.99, it’s tough to beat the price, especially in San Francisco!

checkin_2131427343_photo_1364229522705

Every year, I go to the Math and Physics for Game Programmers. Monday is all about the mathematics and Tuesday is all about the physics. The topics and presentations are usually the same with minor tweaks from year to year, but today the presentations were outstanding. Squirrel Eiserloh from Southern Methodist University gave his usual talk on interpolations and splines, but with more focus and less superfluous material than last year. Here’s last year’s presentation: http://essentialmath.com/GDC2012/GDC12_Eiserloh_Squirrel_Interpolation-and-Splines.ppt. Be sure to also download his OpenGL-based demo tool. It’s a fun little app for exploring the properties of the various types of curves and splines he describes in his talk.

The second talk of the day was by Jim Van Verth, who is notorious for losing his voice at GDC. Normally, this takes about half a day, but this year, he was tight and scratchy from the get-go. His energy level this year, however, was much higher, and he was a much more engaging speaker than in the past. He also did a LOT of work on his presentation. I found his previous presentations on rotations and quaternions rather unenlightening. This year he knocked it out of the park! I think I actually get this quaternion stuff! It helped that he related them back to quantum physics and spin groups, with a nice sprinkling of hyperspatial geometry thrown in for good measure. You know it’s a good conference when you hear a serious discussion of hyperspheres and how to visualize them. His 2013 slides aren’t up just yet, but you can check out his site, http://www.essentialmath.com/ in a couple of weeks. He’ll have them up before too long. If the rest of the conference were cancelled right now, I think that my finally understanding the nature, behaviour, and deeper mathematical roots of quaternions makes the whole trip worth it. The rest of the week is gravy!

Tomorrow is all about the physics! Last year, there were some great talks regarding integration methods and collision detection. Hoping that this year, I can finally wrap my head around this configuration-space stuff.