• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
Physics Solutions for Innovative Game Design
 

Physics Solutions for Innovative Game Design

on

  • 7,035 views

Give your iPhone games a dynamic real-world feel by integrating a physics engine. This session will give an overview of the current physics engines available for iPhone development, discussing the ...

Give your iPhone games a dynamic real-world feel by integrating a physics engine. This session will give an overview of the current physics engines available for iPhone development, discussing the pros and cons of each. We will also discuss how to decide if a physics engine is right for your project or you are better off with custom code. We'll dive into some real world examples with Ragdoll Blaster which uses the Open Dynamics Engine and talk about optimization, debugging and other tips and tricks.

Statistics

Views

Total Views
7,035
Views on SlideShare
6,997
Embed Views
38

Actions

Likes
3
Downloads
80
Comments
0

3 Embeds 38

http://www.slideshare.net 32
http://cea4089.1bestarinet.net 5
http://www.cleeki.com 1

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    Physics Solutions for Innovative Game Design Physics Solutions for Innovative Game Design Presentation Transcript

    • Physics Solutions for Innovative Game Design Give your iPhone games a dynamic real-world feel by integrating a physics engine. Andrei Gradinari Lead Engineer - Backflip Studios Tom Blind Lead Designer - Backflip Studios
    • History of Physics in Games and "Physics Games"
    • History of Physics in Games Very simple physics (Late 80-s to Early 90-s) - Racing games, flight sims, mini golf games, etc ...
    • History of Physics in Games Simple real physics (Middle - Late 90-s) - NFS 1, Unreal, Half- Life, many others
    • History of Physics in Games Simple real physics (Middle - Late 90-s) - NFS 1, Unreal, Half- Life, many others
    • History of Physics in Games Simple real physics (Middle - Late 90-s) - NFS 1, Unreal, Half- Life, many others
    • History of Physics in Games Complex real physics (Early 2000s) - Half-Life 2
    • History of Physics in Games Complex real physics (Early 2000s) - Half-Life 2
    • History of Physics in Games Complex real physics (Early 2000s) - Half-Life 2
    • History of Physics in Games Complex real physics (Early 2000s) - Prey
    • Prey: Flip Gravity Gameplay Mechanic (how to get to the box with candy)
    • Prey: Flip Gravity Gameplay Mechanic (how to get to the box with candy)
    • Prey: Flip Gravity Gameplay Mechanic (how to get to the box with candy)
    • History of Physics in Games Physics on GPUs: Almost real world complexity (Middle to Late 2000's) Crysis engine 3000 Barrels, real time:
    • History of Physics in Games Physics on GPUs: Almost real world complexity (Middle to Late 2000's)
    • What is a Physics Game?
    • What is a Physics Game? These are NOT physics games Even though they use physics Doom 3 Unreal
    • What is a Physics Game? These are physics games! Crayon Physics Fantastic Contraption
    • Physics Engine Definition and How It Works
    • Physics Engine A physics engine is a set of functions that lets you describe layout of your system of physics objects and then tells you how the state of this system changes over time.
    • Physics Engine Define layout of your system of objects (shapes, positions, masses, dimensions, global gravity vector, etc...)
    • Physics Engine The engine tells you how your system changes over time
    • Physics Simulation The process handled by a physics engine that figures out what happens to the given set of objects over a certain period of time is called physics simulation ->Simulation->
    • Physics Simulation Can be: Not Interactive (user input is not taken in consideration) Interactive (user input affects the simulation). Interactive simulations are used in most games
    • Do you need a physics engine?
    • Do you need a physics engine? Sometimes, it's easier to do it yourself! Less memory & CPU usage Less disk space Less time spent linking libraries Simpler, if you don't need anything fancy
    • Do you need a physics engine? Rolling your own physics: acceleration = force / mass Things get trickier with collisions...
    • The Physics of Paper Toss Forces are one-dimensional Add flick force and wind force to determine landing point Animate to make it look pretty No physics library needed!
    • Typical Physics Engine
    • Typical Physics Engine Consists of: Rigid Body Dynamics Simulation Engine Collision Detection Engine
    • Typical Physics Engine Building blocks of your physics world: Geometric Shapes (describe what your objects look like) Joints (describe how your objects are connected to each other)
    • Typical Physics Engine Simulation Step: Collision contact points generation (collision detection engine) Creating temporary joints based on contact points, and attaching them to respective physics objects Performing actual simulation step (rigid body dynamics engine)
    • Simple Simulation Example (Step 1)
    • Simple Simulation Example (Step 2)
    • Simple Simulation Example (Step 3)
    • Performance Tips and Tricks
    • Performance Tips and Tricks Keep things simple More objects in your physics simulation = more time spent to simulate the system = lower framerate as a result. Approximate complex volumes with sets of simple volumes Performance gain is well worth it. User will never see the difference, as long as you do it right. It's still fine to render fully detailed models, while simulating simple shapes on the physics side.
    • Performance Tips and Tricks Example of complex volumes approximation. Rendered models:
    • Performance Tips and Tricks Example of complex volumes approximation. Simulated shapes:
    • Performance Tips and Tricks Do not simulate static objects They should never be simulated in Rigid Bodies Dynamics Engine, because they never move. Do not simulate dynamic objects that are stationary at the moment. ODE, for example, automatically does this for you. It is called Auto Disable. Use spatial partitioning Setup collision detection engine to generate as few contact points as possible
    • Performance Tips and Tricks Several small steps vs one large step Several small steps: One large step: More realistic simulation, Less realistic simulation especially when simulating dynamically Better performance changing forces Less problems with objects flying through each other.
    • Performance Tips and Tricks Probable instability problems with simulation and their causes: Large simulation step Large forces applied to bodies Large masses, especially when mixed with small masses High speeds of the objects Fast spinning objects High friction
    • A Brief Comparison of Physics Engines Used on the iPhone 2D 3D Box2D ODE Chipmunk Bullet
    • Comparison of Physics Engines Box2D Optimized for 2D games Works well with cocos2d Used in many iPhone games such as Crayon Physics and Rolando
    • Comparison of Physics Engines Chipmunk Very lightweight Written in pure C Made by the creators of Crayon Ball for the iPhone "Makes you smarter, stronger, and more attractive to the opposite gender!"
    • Comparison of Physics Engines Open Dynamics Engine (ODE) Industry veteran Supports full 3D simulation Fast, even on the iPhone Used in Touchgrind and Ragdoll Blaster
    • Comparison of Physics Engines Bullet Physics Library Highly optimized for many architectures Multi-threaded Third most popular physics library according to survey by Game Developer Magazine (Aug. 2009) Used by Oolong Engine (Kids vs. Zombies, iPhysics)
    • Contemporary physics in games on consoles and PC's = the nearest future of physics in mobile games...
    • Thanks! jobs@backflipstudios.com