David Smith, technical director, Media Molecule, delivered a talk at GDC on Thursday on the complexities and rewards of implementing physics in LittleBigPlanet -- with his main thrust being that although it's challenging to conform to player expectations, physics add to games in surprising ways.
When it comes to physics, says Smith, "The important thing isn't the answers we chose, but the questions that we chose to answer."
To that end, he posed several questions, and then answered them -- but was careful to note that you will have to answer these questions yourself, for your specific game.
What is physics in games?
Smith wondered about the original 1981 Donkey Kong. "Does this have physics? I would say yes. You have objects moving, colliding with things... Arguably this is a form of physics."
Though it's limited, so is the current definition of physics in games, he argues. "We generally refer to rigid-body physics simulation as physics"; in real life objects collide and deform, and liquids aren't yet simulated very well. Like with what Donkey Kong chose to simulate, "It's a question of computing power."
But with more realistic physics, Smith argues, you can make something that's more than the sum of its parts -- all items in DK act alone; in World of Goo the developers simulate a great deal through the use of springs, and "build complexity, which is interesting and useful in different ways."
Why implement physics?
"The first possible answer, and I think it's one a lot of games would give, is to make the game pretty," says Smith. "It makes the world more believable."
Many developers think physics allow you to get away with a smaller team, since things are simulated rather than hand-created. "I think there's some truth and some wrongheadedness about this answer," says Smith.
"Even though you get a lot of odd behavior [with a ragdoll simulation] it's preferable to have the odd visual effects than having the characters not respond correctly to the environment," Smith admits.
"But I think developers feel you can get something for nothing... You can just rely on one or two simple physical principles... As humans I think we're good at seeing through, seeing to the heart of a game and seeing the true content. You have to have some sort of structured experience you're given to the player."
For LBP, the real reason to use physics was to "make use of players' expectations."
Says Smith, "From a very early age, we develop a very sophisticated understanding of the world around us. I think this is something games can really leverage. Your players already have a whole wealth of experience to solve problems the game poses."
When you use physics, then, "You throw up less walls to define what the player can do. The game becomes more believable as the players can do more what they can do in real life."
Smith admits that some games eschew physics -- and should. "I'm not here to say that all games should be using physics. There are certainly a lot of games that I think would be ruined by using real-world physics."
"The highest level reason not to is the loss of control," says Smith. "If you're trying to control the game and create a very specific ambience, giving the player the freedom to mess things up and do things differently, may work against what you want to do."
For example, in LBP, "Things can go wrong, almost by definition... Sackboy can get trapped under a pile of blocks. Or a bridge can collapse that you need to travel across. This is a real problem."
What's a bigger problem? "Paradoxes," says Smith. "I don't know whether this is generally true of all physics engines, but in LittleBigPlanet the physics engine is able to pose itself problems it is unable to solve, and this is particularly problematic in terms of the user-generated content." This, in fact, formed much of the rest of the talk -- as the physics engine was designed to solve these sorts of problems.
So you've decided to implement physics, despite the fact that things can go wrong. Smith clearly thinks this is good news: "The solution is just to embrace these problems, and even see these as creative opportunities... These can even inform the game design."
"In LBP," Smith says, "we use a custom physics solution" which caused some problems. "But we try to fail gracefully.. But we also try to make sure that this doesn't happen by building the world."
And if you can't control the world, Smith says, "The slightly brutal solution in LittleBigPlanet is to start destroying objects." When complicated object paradoxes arise, "In that case it's better to destroy some offending objects than to let it get worse."
This helps make the world more understandable -- players see objects destruct and it acts as feedback -- and this helps with feedback for user-generated content in particular.
Another problem it creates is the possibility of levels that can't be completed due to the failure of physical objects as physics act on them -- bridges collapsing, and the like.
Smith admits that this wasn't always easy to deal with. "The simple blockage case that we did have a pretty good solution for, which is when Sackboy gets buried -- you can push a button, destroy Sackboy and respawn." But in other cases, players were forced to restart entire levels.
The solution was more design-oriented -- "The longer the levels are, the more we try to make sure the player isn't relying on complicated physics solutions." The more this happens, the more amateur designers "are forced to take risks and learn how the world works," he concludes. It's debatable.
His conclusion: "If you need a lot of control over what the player's doing, you probably shouldn't use physics, get rid of it... Don't go for the middle-ground. Perhaps just use it visually. You have to make a choice -- the middle route doesn't work." And it's good, he says, to remember that control is not just an issue for the developers, but also "how out of control [the player] can feel."
LBP Physics Engine Eccentricities
Smith presented a list of the physics engine's "eccentricities", which illustrated the choices the team made -- and showed how the decisions you will have to make are absolutely game-specific.
The physics engine was "somewhat designed and optimized for worst-case situations" -- Says Smith, "Because we wanted people who don't have a lot of physics experience to design levels."
There's no physics sleeping, as is common in other games, when objects that are off-screen don't operate in the physical model till encountered by the player. Says Smith, "We wanted a brute force approach where we could deal with the worst-case situation." He also later noted that some of the more complicated designs take advantage of this, by using off-screen objects to drive on-screen action.
In the LBP model, there's no cheating -- "If you're in control of the full level design, you can play fast and loose... There are all kinds of tricks. We wanted to let players use physics in clever ways... so we couldn't cheat too much," says Smith.
There's also a minimal expectation of frame to frame coherence. "The worst case was abominable so we used a solution... The best case was slower but the worst case was much faster," he notes.
"I don't draw a strong distinction between" physics and character handling, Smith notes. Sackboy inhabits a fully physical world. However, it's important to note the expectations players have of movement.
Smith notes that in particular, three things really affect player expectations. For instance, people rarely interact with high-speed objects unless they're at a stop -- you only enter or exit a car, for example, when it's stopped. Games have their own expectations -- i.e. that Mario can jump several times his own height, since it's fun.
And Smith thinks that films "have a lot to answer for... Because we don't have a lot of automatic expectations of what might happen, and films have a lot of creative license..." the physics are often extremely unrealistic, as a consequence.
Taken together, these situations add up to a major conflict with technology that pursues a real, mathematical physics simulation.
Though Mario-style air control during jumping is pervasive in the industry, in truth, says Smith, "There's no consistent physical way of describing this."
Take shooters: "[In real life] If you're running sideways and fire a rocket, your sideways motion would be imparted to the rocket, and you'd miss by a wide margin." But it's good that the games ignore this. "Our intuitions about reality can be wrong. We find it really easy to accept that it would work that way."
But on the other hand, you have to be careful what you choose to ignore in your simulation, says Smith. "The more laws of physics you defy the more physical situations you can create which will be confusing to the player, like perpetual motion machines."
He concluded by describing a situation with an object earlier in the game's development, using a physical model which was later eliminated. By picking up the object, Sackboy's mass would increase -- and his momentum would increase as he moved, as a consequence. If you messed with the controls, you could send him flying off the screen.