All posts by dpatter

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

GDC16 – Day 0

So today was interesting. I’m all set to check my bag and fly out to San Francisco and I find out that my flight is overbooked. …great. The ticket agent asks if I would mind moving to another flight. I’m in the process of rejecting by default as I needed to be here by 1700h PDT. Before I get around to doing that and demanding the seat I purchased, he says, “How about a non-stop that leaves 22 minutes later than your flight, but arrives two hours earlier. …blink… Yup! That will work just fine, thank you. As it happens, it was the flight that the Game Development Program Chair, Prof. Russ Hanna was on as well.

The rest of the trip goes great. Flight in was smooth, BART into town was smooth, got my MUNI pass easy-peasy. The problem started when I got to hotel. Paperwork is such a fun thing. Turns out there was a mishandling of the paperwork between the college and the hotel so the new front desk clerk didn’t think that my room was paid. Great. There are worse places than San Francisco to be homeless for a day. Fortunately, the folk at the Hotel Stratford were amazing and very understanding! They knew that this would work itself out in the morning when the business offices opened, and they did.

RainsoakedUnionSquareWhat to do while in the Powell and Market area and your stressed out? Eat! Senior Scientist at Fundamental Technologies, Jerry Manweiler, introduced me to a great burger joint on Union Square, the Burger Bar. Wet, stressed, and hungry, That’s where Russ and I went. It’s an amazing place with an amazing view, although I will say the view during the Christmas season when I come here for the American Geophysical Union Fall Meeting is a bit more colourful.

One thing that did go right was registration at GDC. It used to be such a madhouse. They’ve really streamlined the process and have it working very smoothly. Russ and I were able to walk right up, sign in, and grab our badges. We were in and out in less than five minutes. Brilliant! That left time for some photography work. Before wrapping up the day with more food at an Irish-themed deli. I’m a sucker for corned beef sandwiches!

I’m part of a small group of photogs that post weekly photos on a theme in an effort to push each of us outside of our normal comfort zones and force us out of our photographic ruts. Last week’s theme was “Motion,” and what I wanted was a bus or streetcar moving through the steam rising from the storm grates. I picked the wrong side of the street. Although I didn’t get the steam in the shot like I wanted, I did get some panning practice in before racing season. The lens I used was a 28-mm prime thrift-store special. Auto nothing! It forced me to think about and set every aspect of the exposure and the focus. It’s not tack sharp, but by this time it was starting to pour down rain, and I wasn’t keen on sticking around to grab another.

"Here Comes the Bus"
“Here Comes the Bus”

EXIF
Device: Nikon D7000
Lens: Tokina 28mm f/2.8
Focal Length: 28mm
Focus Mode: Manual
AF-Area Mode: Single
Aperture: f/8
Shutter Speed: 1/15s
Exposure Mode: Manual
Exposure Comp.: 0EV
Metering: Matrix
ISO Sensitivity: ISO 100

Tomorrow, the Math for Game Programmers summit begins! All math, all day!

Found a new planet? Pics or it doesn’t exist.

In January, right at the beginning of the Spring semester, Professor of Planetary Astronomy Michael Brown and Assistant Professor of Planetary Astronomy Konstantin Batygin, both from the California Institute of Technology, published a remarkable prediction in the Astronomical Journal, Evidence for a Distant Giant Planet in the Solar System (read the article here, http://web.gps.caltech.edu/~kbatygin/Publications_files/ms_planet9.pdf) In the article, Dr. Batygin, the theoretician of the pair, uses Dr. Brown’s observations of objects within the Kuiper Belt to argue for the existence of an object in a Sedna-like orbit and approximately ten times the mass of Earth. The basis for their claim is the ordered clustering of the perihelions of the orbits of multiple Kuiper Belt objects, a phenomenon that has a 0.007% of occurring randomly (yes, the significance of the number was not lost on me). After a significant amount of modelling and numerical analysis, Dr. Batygin predicts the likely orbital parameters of the Neptune-sized object as being inclined as much as 40 degrees to the ecliptic and having a semi-major axis of ~700 AU with an eccentricity of ~0.6. Kuiper_oort This places its perihelion around 280 AU. That’s really far out there, and places the proposed object as a member of the distant Kuiper Belt or inner Oort Cloud, or Hills Cloud, rather than a member of the inner Kuiper Belt wherein resides more familiar objects like Pluto and Eris. The mathematics are extremely compelling and the discussion and conclusions well-reasoned, but as the modern saying goes, “Pics or it didn’t happen.”

This certainly isn’t the first time that an object has been predicted to exist by mathematical analysis of the orbit of other objects. The most famous, and earliest, is the prediction by French astronomer and mathematician Urbain Le Verrier of the existence of an eighth planet beyond the orbit of Uranus that would account for the Uranus’ increase and subsequent decrease in orbital speed unrelated to its solar distance. Le Verrier worked on the problem in the summer of 1846 during his position at the Paris Observatory. Using Newton’s mechanics and Law of Gravity and the observed positions of Uranus, he calculated where a more distant planet would have to be and how massive it would have to be to produce the observed deviations. After completing his work, two astronomers, Johann Gottfried Galle and Heinrich Louis d’Arrest at the Berlin University, began searching in the vicinity of Le Verrier’s predicted position for the new planet. Galle, looking through the telescope, called out positions and brightnesses of the visible objects to d’Arrest who compared the observations to previously recorded charts until Galle called out an object that was not on the chart. They had found the planet that would later come to be called Neptune within a single degree of Le Verrier’s calculations. It was a remarkable piece of work from both Le Verrier and from Galle and d’Arrest, and it was a triumph for Newtonian mechanics.

This method of discovering new objects was later attempted by William H. Pickering, Professor of Physics at Harvard University. Based on his calculations, using the apparent discrepancies in the orbits of both Uranus and Neptune, he attempted to image the proposed trans-Neptunian object at the Mount Wilson Observatory outside of Pasadena, CA. His search was unsuccessful, but the hunt for “Planet X” was picked up by Percival Lowell who had founded the Lowell Observatory in Flagstaff, AZ. Lowell’s attempts were equally unsuccessful. After Lowell’s passing, the search was tasked to an amateur astronomer from Burdett, KS, 23-year old Clyde Tombaugh. Rather than relying on sophisticated calculations, Tombaugh was tasked with systematically searching the Zodiac for anything non-stellar. In late January 1930, he captured two images of the object that we now know as Pluto. As it turns out the position of Pluto did not in any way correlate to Pickering’s calculations. In this case, the discrepancies were due to the lack of precision in the measurement of the masses of the outer planets.

discovery_of_Pluto_photographic_plate_comparison

Today, modern astronomers use the periodic motion of stars to mathematically infer the presence of extrasolar planets. The first of these discoveries was 51 Pegasi b. As two bodies orbit each other, such as a planet around its host star, the two bodies both move about their common center of mass. The planet being significantly less massive moves far more noticeably than the star, but the star does still move. Its motion is detectable by analysis of its light spectrum’s becoming alternately slightly bluer and then slightly redder as the star moves towards us and then away from us, respectively. This method has been used to locate many such extrasolar planets that we’re still unable to image directly. These are generally accepted as exceptions to the “Pics or it doesn’t exist” rule in science. The mathematics and analysis are so strongly compelling and there is no other viable alternate explanation that it is accepted that orbiting planetary bodies are responsible for the variations in the radial velocity of 51 Peg and other stars.

So now if we’re willing to take the mathematical word of the existence of extrasolar planets such as 51 Peg b, then why not for this new object proposed by Dr. Batygin and Dr. Brown from Cal Tech? The difference lies in the complexity of the problem. The extra solar planet problem is by comparison a simple problem. The radial velocity curve for 51 Peg is very clean, and the analysis of the data use methods that have long been vetted and refined by astronomers studying binary stars for which one can see the two separate objects. In other words, there is precedent for the methodology. This is not to say that Dr. Batygin’s methods are controversial or that the mathematical tools are not well understood. The Hamiltonian mechanics he deploys in his paper are extremely well understood and have been for over a century, but the data with which Dr. Batygin is working and the significant complexity created by moving from a two-body problem to an n-body problem make the analysis more difficult and intricate as well as making the results of those analyses less precise. For this reason, while I am very excited about this new prediction, I want to see an image before I take it as fact.

The observational discovery this new object, if it exists, likely won’t happen soon. Even at its proposed closest approach to the Sun, 280 AU, the intensity of sunlight striking the object is 0.00128% that of what it is here at Earth. Not only is the light very dim at that distance, most Kuiper Belt and inner Oort Cloud objects are coated with carbonaceous dust making their surfaces very dark and non-reflective. As our observational tools and techniques improve, we may eventually be able to start imaging these remote sentinels of our solar system, but until then, we’re left with only the predictions.

AGU14 – Day 1

If you jump in muddy puddles, you must wear your boots. Yeah, well, I don’t have boots. What I do have are two pairs of completely soaked socks, a pair of shoes that might dry out by March, and two very cold and tired feet! …I need wellies, or at least galoshes. It drizzled and rained all day long, which made getting from one building of the Moscone Center to another a bit of a miserable experience. Inside the sessions was quite a different matter, though.

There were several good talks about the behaviour of the magnetosphere and observations by the Van Allen Probes, but today the two most interesting talks I attended were about Mars. The first was about ancient lakes and outflows on the eastern portion of Valles Marineris. The presenter showed evidence on how the outflow from Eros Chaos was directed with estimations on the approximate time the area was drained based on the cratering density on the surface. By this time, it’s no surprise that there was abundant liquid water on the surface of Mars in the distant past, but it’s fun to see people starting to evaluate how that surface water flowed across the surface and how long it would have been present.

The other Mars talk I attended had the clickbait-style title, “How to snowboard on Mars”. What the talk was really about was providing an explanation of how numerous small gullies form on the sandy slopes of some ridge lines on Mars. At first glance, these gullies look remarkably like snowboard tracks. So… Aliens? No, dry ice. As the ice sublimates, the freshly formed vapour lifts the slab of ice off the surface slightly and serves as a lubricant allowing the slab to slide down the slope with enough energy to gouge out a furrow in the sandy surface. This phenomenon has been replicated with dry ice in the Mojave Desert. See the article on NASA’s website for more details.

AGU14 – Day 0

So yeah, this old FORTRAN guy is using a zero-index reference like those snooty C guys. The American Geophysical Union 2014 Fall meeting (AGU14) doesn’t officially start until tomorrow, but registration is open today and there are a couple of mission-specific meetings. The one I’m responsible for attending and engaging in meaningful participation is the Voyager SSG. Five hours of exploring the future direction of our greatest and most productive robotic mission ever. BRING IT!

In the meantime, I continue to work on bringing the Advanced Composition Explorer’s (ACE) Electron Proton Alpha Monitor (EPAM) data production fully up to date. The basic Level 2 rate data are ready for consumption, but more refined Level 3 fluxes and energy spectra are still on their way. Thankfully, the hotel wifi doesn’t block VPN connections. At least I got the pretty pictures (aka color spectrogram plots) up for viewing.

ACE/EPAM PHA-derived hourly-integrated species-resolved fluxes for 2014

I’ll update this post throughout the day. …more to come!

Evening Update
What a cool day! Five hours of listening to space science lectures doesn’t get most people excited, but wow, there were some very cool things discussed! How much turbulence is there in the Local Interstellar Medium, or even along the heliopause? Is our heliosphere’s tail bifurcated? There were some neck-level questions being asked about the outer reaches of our solar system, and all this leads into the preparation for the 2015 Senior Review. The Voyagers have plenty of hydrazine to last a long time, provided we can keep it from freezing, but the mission-limiting factor is power and money. The power issue centers on the 18 W needed to power the gyros during a fault protection event. The money issue is up to the Senior Review board, but it looks like the Voyager team has a lot of seriously important work ahead of them exploring a region of space that we’ve never seen before, and likely won’t visit again in our lifetimes.