Download presentation
Presentation is loading. Please wait.
Published byFrederick McCormick Modified over 6 years ago
1
Physics in Games David: Achieving Fun with Physics
Steven: Ronin Game Engine Ryan: Fire and Explosion Effects Dan: Farseer and Bullet Physics Lowell: Physics in Unity; Forcemode Demo *
2
Richer Graphical Environment
Batman: Arkham Asylum Uses PhysX for enhanced graphical effects Simulates colliding particles, smoke, cloth Graphical fidelity requires physical fidelity
3
Richer Physical Environment
Half Life 2 Havok Engine provides a game environment where objects become part of gameplay Conforms to player expectations of a physical environment
4
Realism Grand Theft Auto IV
Uses Rockstar Advanced Game Engine with Euphoria Most realistic vehicle handling of the series Players can be ejected through a windshield Maneuvering a vehicle requires skill Forces the player to consider consequences
5
Lack of Realism Just Cause 2 Uses Havok physics
Parameters like friction and momentum are adjusted for behavior conducive to gameplay, not realism Emphasis on lack of consequence, escapism
6
Emergent Gameplay Crayon Physics Deluxe
Uses Box2D, an open source 2D physics engine Players must guide a ball to touch all stars in a level Draw rigid surfaces, pivots, wheels, and ropes Simple physical interactions lead to complex solutions
7
Character Animation Review
Forward Kinematics Inverse Kinematics Ragdoll Physics
8
Ronin Game Engine Developed by LucasArts Medley of Individual Engines
Havok - Havok Digital Molecular Matter (DMM) - Pixelux Entertainment Euphoria - NaturalMotion
9
Havok Staple physics engine for LucasArts Provides functionality for:
Rigid Body Physics Collision Handling Ragdoll Physics
10
Digital Molecular Matter (DMM)
Define properties of deformable objects Properties such as: Young’s Modulus (measure of a material’s stiffness) Poisson’s Ratio (measure of “volume preservation”) Able to simulate many different materials with very different properties Steel Glass Wood
11
Euphoria Advanced AI behavior Never same scenario twice
Uses Inverse Kinematics to move end effectors to get desired end action
12
Ronin Challenges Euphoria-controlled bodies soar through DMM materials like ghosts The Force (driven by Havok) rips Stormtroopers to shreds
13
Ronin Physics engines interacting
14
Simulating Fire Fire is a tough phenomenon to simulate.
Big trade-off between process time and making it look realistic. Three Main Methods: Particle-Based Fluid-Based Flame-Based
15
Particle-Based Fire Simulation
Uses particle systems Move particles upwards from the base of the flame Uses a user-defined velocity field Change aspect ratio over time Change shape over time Advantages: relatively fast, realistic looking Disadvantages: need many particles, fuzzy outlines
16
Fluid-Based Fire Simulation
Uses vector/scalar fields described by CFD (Computational Fluid Dynamics) Velocity Field Density Field Temperature Field Each field is based off of Navier-Stokes equations The density field is rendered while the temperature field is used to determine color Advantages: very realistic, shows smoke Disadvantages: very slow, complex handling
17
Flame-Based Fire Simulation
A single flame is used as fire primitive Represent fire as a set of flames Advantages: fast, scalable, somewhat realistic, sharp outlines Disadvantages: not physically correct, not as realistic as other methods
18
Simulating Explosions
Methods that will be discussed: Tree-Approach Fluid-Based
19
Tree-Approach to Explosions
Model the explosion as a tree. Each node represents an "explosion event" The parent node represents the larger, initial explosion. Each child is also an explosion that is usually smaller than the parent node explosion. The child node events are triggered after some time t after the parent event is triggered.
20
Fluid-Based Explosion Simulation
Very similar to the fluid-based fire simulation. Makes use of the same three fields: velocity, density, and temperature. Once again, the density field is rendered and the temperature field determines color. Difference from fire - parameters Velocity vectors in all directions Color schemes
21
Physics in Applications - Review
Covered basics of Unity w/ PhysX Discussed how rigid body collisions work in Blender Gave examples of 3rd party engines in XNA *
22
This week - Demos Farseer Physics: 2D collision detection in Unity
Bullet Physics: Keva Planks simulation in Blender *
23
Farseer Physics 2D collision detection built off of Box2D (C++ engine). Implemented in C# for Unity and XNA Can be downloaded and imported as package for Unity *
24
Farseer Physics Primary components involve scripts for FSBodyComponent (collision body properties) and FSShapeComponent (collider shape). Tutorial by catsinthesky.com *
25
Farseer Physics More complex colliders possible through concave/convex components. Uses array of transform points and generated sub-polygons. *
26
Farseer Physics Distance Joint: simple joint that maintains a constant distance between two points in a body. Each sphere is a FS body bound to its neighbors. Can be static to keep a body at a fixed position *
27
Farseer Physics Revolute joints: Two bodies share common anchor point (hinge). Single degree of freedom set. Modifications can be made to motor speed and angle limits. *
28
Blender Simulations based on Bullet Physics.
Developed by physics team Phymec Python scripts control rigid bodies. *
29
Blender Keva planks made up of rectangles bound by simple rectangular colliders. Projectile balls in sphere colliders. Both act as rigid bodies controlled by gravity vector. Colliders stacked on each other cause chain reaction. *
30
Physics in Unity Based on Nvidia PhysX Supports: Rigidbodies
Unbreakable, colliders do not change Softbodies Interactive modifiable colliders Joints Hinges, Ball-sockets, Limbs Cloths Interactive Cloths, Skinned Cloths (animations) Ragdoll Wizard
31
Meshes Geometry representing a 3D object
Can be created from scratch as a set of vertices and faces Can be imported as .FBX, .dae, .3DS, .dxf, or.obj files All models will be converted to triangle meshes
32
Colliders Used to detect collisions of game objects
Multiple types of colliders: Box Collider Sphere Collider Capsule Collider Wheel Collider Mesh Collider Does not need to match object renderer
33
Rigidbodies Enables game objects to act under control of physics
Allows forces to be applied to gameobject Variables for rigidbody properties: Mass Drag (Air Resistance and Angular) Interpolation (smoothes movement) Kinematic Collision Detection Freeze Position, Rotation Materials (Friction, Bounce)
34
Colliders Vs. Rigidbodies
Usually use both collider and rigidbody on game object Useful for playable characters and interactive objects Collider only is called static collider Has no physics properties Useful for objects you want to interact with but don’t move Level geometry Almost never use only rigidbody Kinematic Rigidbody Variable on rigidbody that turns off forces and gravity on object Useful for scripting animations on rigidbodies
35
Physics Manager Gravity Sleep Penetration Solver Iteration Count
Object put to sleep if not moving enough Penetration How deep object must be intertwined before collision occurs Solver Iteration Count Accuracy or joints and collisions Layers Sets which layers of gameobjects interact with each other
36
Forcemode Demo Force Acceleration Impulse VelocityChange
Add a continuous force to the rigidbody, using its mass. Acceleration Add a continuous acceleration to the rigidbody, ignoring its mass. Impulse Add an instant force impulse to the rigidbody, using its mass. VelocityChange Add an instant velocity change to the rigidbody, ignoring its mass.
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.