Game Physics Animation in Games

Total Page:16

File Type:pdf, Size:1020Kb

Game Physics Animation in Games Video Game Dev - Univ Insubria Marco Tarini 2017/2018 Video Game Dev 2017/2018 Univ. Insubira Game Physics Marco Tarini Animation in games Non procedural Procedural Assets! Physics engine Artist/Designer Less control controlled (dramatic effects!) Not interactive Interactive Artist dependent Physics driven realism realism Less customizable Auto adaptation Game Physics - 1 1 Video Game Dev - Univ Insubria Marco Tarini 2017/2018 (recall?) Game Engine Game part managing some of the common tasks Scene / levels Renderer Real time transform + lighting Models, materials … Animations Physics engine scripted or computed (soft real-time) Newtonian physical simulations Collision detection + response Networking (LAN – ex. using UTP) Sound mixer and “sound-renderer” HCI devices unified manager Main event loop, timers, windows manager… Memory management Artificial intelligence module AI common sub tasks solution Localization support Scripting GUI (HUD) Physics simulation in videogames 3D, or 2D “soft” real-time efficiency 1 frame = 33 msec (at 30 FpS) physics = 5% - 30% max of computation time plausibility (not necessarily realism) robustness (should almost never “explode”) Game Physics - 1 2 Video Game Dev - Univ Insubria Marco Tarini 2017/2018 Physics engine: intro Game engine module executed at game run time An high-demanding computation on a low-time budget! …but highly parallelizable “embarrassingly parallel” hardware support (as the Rendering Engine) Game engine tasks: (Physics simulation!) Dynamics (Newtonian) for object types such as: Rigid bodies Soft bodies “ragdolling” Free-form deformation bodies: Specific solutions for Ropes Cloth Hair… Fluids Air (e.g. wind) etc Collision handling Collision detection Collision response Game Physics - 1 3 Video Game Dev - Univ Insubria Marco Tarini 2017/2018 Hardware for Physics engine To exploit a strong parallelism, you need a strongly parallel hardware! Recently: PPU “Physical Processing Unit” HW unit specialized on physics More recently: GP-GPU “General Purpose Graphics Processing Unit” Use of the graphics card for generic tasks (not related with 3D computer graphics) Ex.: Cuda (nVidia) Software: libraries / SDK HW accelerated (CUDA) HW accelerated (OpenCL) by open source, free, HW accelerated open source, free 2D! open source, free Game Physics - 1 4 Video Game Dev - Univ Insubria Marco Tarini 2017/2018 PhysX … Physics in games: cosmetics or gameplay? Just a graphic accessory? (for realism!) e.g.: particle effects (w/o feedback) secondary animations Ragdolling Or a gameplay component? e.g. physics based puzzles Popular approach in 2D (since always!) Game Physics - 1 5 Video Game Dev - Univ Insubria Marco Tarini 2017/2018 Physics in games: cosmetics or gameplay? Just a graphic accessory? (for realism!) e.g.: particle effects (w/o feedback) secondary animations Ragdolling Or a gameplay component? e.g. physics based puzzles Rising trend in 3D Physics engine: Dynamics Physics simulation (Newtonian) Revision: object = mass Object state: . position and derivative: velocity . (and momentum) . direction and angular velocity . (and angular momentum) State change: . forces => acceleration, torque Game Physics - 1 6 Video Game Dev - Univ Insubria Marco Tarini 2017/2018 Reminder: Object position 2D Physics 3D Physics Position: Position: (x,y) (x,y,z) Orientation: Orientation: (α) – angle (scalar) quaternion or axis,angle or axis x angle or 3x3 matrix or Euler angles Not really suitable Newtonian dynamics: summary Actual Rate of change object of location (d / dt ) Position 푝 Velocity 푣⃗ 푝 = (x,y,z) 푣⃗ = 푝̇ ( |푣⃗| = “speed” ) Game Physics - 1 7.
Recommended publications
  • Agx Multiphysics Download
    Agx multiphysics download click here to download A patch release of AgX Dynamics is now available for download for all of our licensed customers. This version include some minor. AGX Dynamics is a professional multi-purpose physics engine for simulators, Virtual parallel high performance hybrid equation solvers and novel multi- physics models. Why choose AGX Dynamics? Download AGX product brochure. This video shows a simulation of a wheel loader interacting with a dynamic tree model. High fidelity. AGX Multiphysics is a proprietary real-time physics engine developed by Algoryx Simulation AB Create a book · Download as PDF · Printable version. AgX Multiphysics Toolkit · Age Of Empires III The Asian Dynasties Expansion. Convert trail version Free Download, product key, keygen, Activator com extended. free full download agx multiphysics toolkit from AYS search www.doorway.ru have many downloads related to agx multiphysics toolkit which are hosted on sites like. With AGXUnity, it is possible to incorporate a real physics engine into a well Download from the prebuilt-packages sub-directory in the repository www.doorway.rug: multiphysics. A www.doorway.ru app that runs a physics engine and lets clients download physics data in real Clone or download AgX Multiphysics compiled with Lua support. Agx multiphysics toolkit. Developed physics the was made dynamics multiphysics simulation. Runtime library for AgX MultiPhysics Library. How to repair file. Original file to replace broken file www.doorway.ru Download. Current version: Some short videos that may help starting with AGX-III. Example 1: Finding a possible Pareto front for the Balaban Index in the Missing: multiphysics.
    [Show full text]
  • Physics Simulation Game Engine Benchmark Student: Marek Papinčák Supervisor: Doc
    ASSIGNMENT OF BACHELOR’S THESIS Title: Physics Simulation Game Engine Benchmark Student: Marek Papinčák Supervisor: doc. Ing. Jiří Bittner, Ph.D. Study Programme: Informatics Study Branch: Web and Software Engineering Department: Department of Software Engineering Validity: Until the end of summer semester 2018/19 Instructions Review the existing tools and methods used for physics simulation in contemporary game engines. In the review, cover also the existing benchmarks created for evaluation of physics simulation performance. Identify parts of physics simulation with the highest computational overhead. Design at least three test scenarios that will allow to evaluate the dependence of the simulation on carefully selected parameters (e.g. number of colliding objects, number of simulated projectiles). Implement the designed simulation scenarios within Unity game engine and conduct a series of measurements that will analyze the behavior of the physics simulation. Finally, create a simple game that will make use of the tested scenarios. References [1] Jason Gregory. Game Engine Architecture, 2nd edition. CRC Press, 2014. [2] Ian Millington. Game Physics Engine Development, 2nd edition. CRC Press, 2010. [3] Unity User Manual. Unity Technologies, 2017. Available at https://docs.unity3d.com/Manual/index.html [4] Antonín Šmíd. Comparison of the Unity and Unreal Engines. Bachelor Thesis, CTU FEE, 2017. Ing. Michal Valenta, Ph.D. doc. RNDr. Ing. Marcel Jiřina, Ph.D. Head of Department Dean Prague February 8, 2018 Bachelor’s thesis Physics Simulation Game Engine Benchmark Marek Papinˇc´ak Department of Software Engineering Supervisor: doc. Ing. Jiˇr´ıBittner, Ph.D. May 15, 2018 Acknowledgements I am thankful to Jiri Bittner, an associate professor at the Department of Computer Graphics and Interaction, for sharing his expertise and helping me with this thesis.
    [Show full text]
  • Locotest: Deploying and Evaluating Physics-Based Locomotion on Multiple Simulation Platforms
    LocoTest: Deploying and Evaluating Physics-based Locomotion on Multiple Simulation Platforms Stevie Giovanni and KangKang Yin National University of Singapore fstevie,[email protected] Abstract. In the pursuit of pushing active character control into games, we have deployed a generalized physics-based locomotion control scheme to multiple simulation platforms, including ODE, PhysX, Bullet, and Vortex. We first overview the main characteristics of these physics engines. Then we illustrate the major steps of integrating active character controllers with physics SDKs, together with necessary implementation details. We also evaluate and compare the performance of the locomotion control on different simulation platforms. Note that our work only represents an initial attempt at doing such evaluation, and additional refine- ment of the methodology and results can still be expected. We release our code online to encourage more follow-up works, as well as more interactions between the research community and the game development community. Keywords: physics-based animation, simulation, locomotion, motion control 1 Introduction Developing biped locomotion controllers has been a long-time research interest in the Robotics community [3]. In the Computer Animation community, Hodgins and her col- leagues [12, 7] started the many efforts on locomotion control of simulated characters. Among these efforts, the simplest class of locomotion control methods employs re- altime feedback laws for robust balance recovery [12, 7, 14, 9, 4]. Optimization-based control methods, on the other hand, are more mathematically involved, but can incor- porate more motion objectives automatically [10, 8]. Recently, data-driven approaches have become quite common, where motion capture trajectories are referenced to further improve the naturalness of simulated motions [14, 10, 9].
    [Show full text]
  • Physics Engine Design and Implementation Physics Engine • a Component of the Game Engine
    Physics engine design and implementation Physics Engine • A component of the game engine. • Separates reusable features and specific game logic. • basically software components (physics, graphics, input, network, etc.) • Handles the simulation of the world • physical behavior, collisions, terrain changes, ragdoll and active characters, explosions, object breaking and destruction, liquids and soft bodies, ... Game Physics 2 Physics engine • Example SDKs: – Open Source • Bullet, Open Dynamics Engine (ODE), Tokamak, Newton Game Dynamics, PhysBam, Box2D – Closed source • Havok Physics • Nvidia PhysX PhysX (Mafia II) ODE (Call of Juarez) Havok (Diablo 3) Game Physics 3 Case study: Bullet • Bullet Physics Library is an open source game physics engine. • http://bulletphysics.org • open source under ZLib license. • Provides collision detection, soft body and rigid body solvers. • Used by many movie and game companies in AAA titles on PC, consoles and mobile devices. • A modular extendible C++ design. • Used for the practical assignment. • User manual and numerous demos (e.g. CCD Physics, Collision and SoftBody Demo). Game Physics 4 Features • Bullet Collision Detection can be used on its own as a separate SDK without Bullet Dynamics • Discrete and continuous collision detection. • Swept collision queries. • Generic convex support (using GJK), capsule, cylinder, cone, sphere, box and non-convex triangle meshes. • Support for dynamic deformation of nonconvex triangle meshes. • Multi-physics Library includes: • Rigid-body dynamics including constraint solvers. • Support for constraint limits and motors. • Soft-body support including cloth and rope. Game Physics 5 Design • The main components are organized as follows Soft Body Dynamics Bullet Multi Threaded Extras: Maya Plugin, Rigid Body Dynamics etc. Collision Detection Linear Math, Memory, Containers Game Physics 6 Overview • High level simulation manager: btDiscreteDynamicsWorld or btSoftRigidDynamicsWorld.
    [Show full text]
  • Physics Application Programming Interface
    PHI: Physics Application Programming Interface Bing Tang, Zhigeng Pan, ZuoYan Lin, Le Zheng State Key Lab of CAD&CG, Zhejiang University, Hang Zhou, China, 310027 {btang, zgpan, linzouyan, zhengle}@cad.zju.edu.cn Abstract. In this paper, we propose to design an easy to use physics applica- tion programming interface (PHI) with support for pluggable physics library. The goal is to create physically realistic 3D graphics environments and inte- grate real-time physics simulation into games seamlessly with advanced fea- tures, such as interactive character simulation and vehicle dynamics. The actual implementation of the simulation was designed to be independent, interchange- able and separated from the user interface of the API. We demonstrate the util- ity of the middleware by simulating versatile vehicle dynamics and generating quality reactive human motions. 1 Introduction Each year games become more realistic visually. Current generation graphics cards can produce amazing high-quality visual effects. But visual realism is only half the battle. Physical realism is another half [1]. The impressive capabilities of the latest generation of video game hardware have raised our expectations of not only how digital characters look, but also they behavior [2]. As the speed of the video game hardware increases and the algorithms get refined, physics is expected to play a more prominent role in video games. The long-awaited Half-life 2 impressed the players deeply for the amazing Havok physics engine[3]. The incredible physics engine of the game makes the whole game world believable and natural. Items thrown across a room will hit other objects, which will then react in a very convincing way.
    [Show full text]
  • Systematic Literature Review of Realistic Simulators Applied in Educational Robotics Context
    sensors Systematic Review Systematic Literature Review of Realistic Simulators Applied in Educational Robotics Context Caio Camargo 1, José Gonçalves 1,2,3 , Miguel Á. Conde 4,* , Francisco J. Rodríguez-Sedano 4, Paulo Costa 3,5 and Francisco J. García-Peñalvo 6 1 Instituto Politécnico de Bragança, 5300-253 Bragança, Portugal; [email protected] (C.C.); [email protected] (J.G.) 2 CeDRI—Research Centre in Digitalization and Intelligent Robotics, 5300-253 Bragança, Portugal 3 INESC TEC—Institute for Systems and Computer Engineering, 4200-465 Porto, Portugal; [email protected] 4 Robotics Group, Engineering School, University of León, Campus de Vegazana s/n, 24071 León, Spain; [email protected] 5 Universidade do Porto, 4200-465 Porto, Portugal 6 GRIAL Research Group, Computer Science Department, University of Salamanca, 37008 Salamanca, Spain; [email protected] * Correspondence: [email protected] Abstract: This paper presents a systematic literature review (SLR) about realistic simulators that can be applied in an educational robotics context. These simulators must include the simulation of actuators and sensors, the ability to simulate robots and their environment. During this systematic review of the literature, 559 articles were extracted from six different databases using the Population, Intervention, Comparison, Outcomes, Context (PICOC) method. After the selection process, 50 selected articles were included in this review. Several simulators were found and their features were also Citation: Camargo, C.; Gonçalves, J.; analyzed. As a result of this process, four realistic simulators were applied in the review’s referred Conde, M.Á.; Rodríguez-Sedano, F.J.; context for two main reasons. The first reason is that these simulators have high fidelity in the robots’ Costa, P.; García-Peñalvo, F.J.
    [Show full text]
  • Physics Tutorial 1: Introduction to Newtonian Dynamics
    Physics Tutorial 1: Introduction to Newtonian Dynamics Summary The concept of the Physics Engine is presented. Linear Newtonian Dynamics are reviewed, in terms of their relevance to real time game simulation. Different types of physical objects are introduced and contrasted. Rotational dynamics are presented, and analogues drawn with the linear case. Importance of environment scaling is introduced. New Concepts Linear Newtonian Dynamics, Angular Motion, Particle Physics, Rigid Bodies, Soft Bodies, Scaling Introduction The topic of this set of tutorials is simulating the physical behaviour of objects in games through the development of a physics engine. The previous module has taught you how to draw objects in complex scenes on the screen, and now we shift our focus to moving those objects around and enabling them to interact. Broadly speaking a physics engine provides three aspects of functionality: • Moving items around according to a set of physical rules • Checking for collisions between items • Reacting to collisions between items Note the use of the word item, rather than object this is intended to suggest that physics can be applied to any and all elements of a game scene { objects, characters, terrain, particles, etc., or any part thereof. An item could be a crate in a warehouse, the floor of the warehouse, the limb of a jointed character, the axle of a racing car, a snowflake particle, etc. 1 A physics engine for games is based around Newtonian mechanics which can be summarised as three simple rules of motion that you may have learned at school. These rules are used to construct differential equations describing the behaviour of our simulated items.
    [Show full text]
  • Physics-Based Simula1on
    Physics-based Simula1on • simple (independent par1cles), or complex (robust colliding, stacking, sliding 3D rigid bodies) • many many simulators! – PhysX (Unity, Unreal), Bullet, Open Dynamics Engine, MuJoCo, Havok, Box2D, Chipmunk, OpenSim, RBDL, Simulink (MATLAB), ADAMS, SD/FAST, DART, Vortex, SOFA, Avatar, Project Chrono, Cannon.js, … – many course projects, theses, abandon-ware Resources • hUps://processing.org/examples/ see “Simulate”; 2D par1cle systems • Non-convex rigid bodies with stacking 3D collision processing and stacking hUp://www.cs.ubc.ca/~rbridson/docs/rigid_bodies.pdf • Physically-based Modeling, course notes, SIGGRAPH 2001, Baraff & Witkin hUp://www.pixar.com/companyinfo/research/pbm2001/ • Doug James CS 5643 course notes hUp://www.cs.cornell.edu/courses/cs5643/2015sp/ • Rigid Body Dynamics, Chris Hecker hUp://chrishecker.com/Rigid_Body_Dynamics • Video game physics tutorial hUps://www.toptal.com/game/video-game-physics-part-i-an-introduc1on-to-rigid-body-dynamics • Box2D javascript live demos hUp://heikobehrens.net/misc/box2d.js/examples/ • Rigid body collisions javascript demo hUps://www.myphysicslab.com/engine2D/collision-en.html • Rigid Body Collision Reponse, Michael Manzke, course slides hUps://www.scss.tcd.ie/Michael.Manzke/CS7057/cs7057-1516-09-CollisionResponse-mm.pdf • Rigid Body Dynamics Algorithms. Roy Featherstone, 2008 • Par1cle-based Fluid Simula1on for Interac1ve Applica1ons, SCA 2003, PDF • Stable Fluids, Jos Stam, SIGGRAPH 1999. interac1ve demo: hUps://29a.ch/2012/12/16/webgl-fluid-simula1on Simula1on
    [Show full text]
  • Physically Based Character Simulation – Rag Doll Behaviour in Computer Games
    Physically Based Character Simulation – Rag Doll Behaviour in Computer Games Johan Gästrin TRITA-NA-E04008 NADA Numerisk analys och datalogi Department of Numerical Analysis KTH and Computer Science 100 44 Stockholm Royal Institute of Technology SE-100 44 Stockholm, Sweden Physically Based Character Simulation – Rag Doll Behaviour in Computer Games Johan Gästrin TRITA-NA-E04008 Master’s Thesis in Computer Science (20 credits) at the School of Computer Science and Engineering, Royal Institute of Technology year 2004 Supervisor at Nada was Kai-Mikael Jää-Aro Examiner was Lars Kjelldahl Abstract The focus of this thesis is the feature known in the games industry as rag doll behaviour. Rag doll is the feature that, in a computer game, lets a character be influenced by actual physical laws. This enables the computer game characters to move in a more realistic way. It also gives the characters an infinite amount of possible motion patterns in contrast to animated motion. The interaction with the environment also enables more realism and better feedback. Rag doll behaviour and the techniques necessary for implementation in real-time 3D simulation are investigated. Many different approaches have been used during the last few years to simulate physics in computer games. Some are more physically correct than others. We describe and discuss benefits and drawbacks of the most accepted and used techniques that are suitable for simulation in real time, i.e. a computer game. We will furthermore investigate how vertex blending can be used to mix standard animations with physical calculations to enhance computer games. Fysikbaserad figursimulering ’Rag Doll’-beteende i dataspel Sammanfattning Detta examensarbete fokuserar på den egenskap som inom dataspels- industrin är känd som rag doll-beteende.
    [Show full text]
  • 10: Multiple Contact Resolution 22/02/2016
    10: MULTIPLE CONTACT RESOLUTION 22/02/2016 CS7057: REALTIME PHYSICS (2015-16) - JOHN DINGLIANA PRESENTED BY MICHAEL MANZKE 22/02/2016 2 Image © 2003 E. Guendelman, R. Bridson and R. Fedkiw CS7057: REALTIME PHYSICS (2015-16) - JOHN DINGLIANA PRESENTED BY MICHAEL MANZKE 22/02/2016 3 COMPLEX CONTACT MANIFOLDS Most contacts usually not just a single point colliding but contact manifold Contact Force and Equivalence Principle [Erleben05] : Equivalent forces or impulses exist such that when they are applied to the convex hull of the contact region, the same resulting motion is obtained, which would have resulted from integrating the true contact force or impulse over the actual contact region [Erleben05] Erleben, K., Sporring, J., Henriksen, K., and Dohlman, H., Physics Based Animation. Charles River Media, August 9, 2005. CS7057: REALTIME PHYSICS (2015-16) - JOHN DINGLIANA PRESENTED BY MICHAEL MANZKE Images © 2014 John Dingliana 22/02/2016 4 CONTACT REDUCTION Contacts reduced to those on the convex hull of the manifold. Use K-means clustering Then further reduce those that and cluster reduction cause minimal change to the hull area Pre-process features in a scene making edges inactive if not important for collisions e.g. interior edges, concave edges Use initial guess and then warm starting in subsequent frames exploiting temporal coherency. [Morvanszky04] Morvanszky and Terdiman. Fast Contact Reduction for Dynamics Simulation. Game Programming Gems 4. Charles River Media. 2004. pp 253-263 CS7057: REALTIME PHYSICS (2015-16) - JOHN DINGLIANA PRESENTED BY MICHAEL MANZKE 22/02/2016 5 PENALTY METHODS Amongst the earliest solutions and still widely used Easy to implement compared to other methods Some problems for rigid objects Objects too springy → not plausible Increase stiffness → leads to instability for large time steps Increase # timesteps → computationally expensive Images © Erleben et al & Charles River Media 2005.
    [Show full text]
  • Physics-Based Simulabon
    Physics-based Simulaon • simple (independent par1cles), or complex (robust colliding, stacking, sliding 3D rigid bodies) • many many simulators! – PhysX (Unity, Unreal), Bullet, Open Dynamics Engine, MuJoCo, Havok, Box2D, Chipmunk, OpenSim, RBDL, Simulink (MATLAB), ADAMS, SD/FAST, DART, Vortex, SOFA, Avatar, Project Chrono, Cannon.js, … – many course projects, theses, abandon-ware Resources • hUps://processing.org/examples/ see “Simulate”; 2D par1cle systems • Non-convex rigid bodies with stacking 3D collision processing and stacking hUp://www.cs.ubc.ca/~rbridson/docs/rigid_bodies.pdf • Physically-based Modeling, course notes, SIGGRAPH 2001, Baraff & Witkin hUp://www.pixar.com/companyinfo/research/pbm2001/ • Doug James CS 5643 course notes hp://www.cs.cornell.edu/courses/cs5643/2015sp/ • Rigid Body Dynamics, Chris Hecker hUp://chrishecker.com/Rigid_Body_Dynamics • Video game physics tutorial hUps://www.toptal.com/game/video-game-physics-part-i-an-introduc1on-to-rigid-body-dynamics • Box2D javascript live demos hUp://heikobehrens.net/misc/box2d.js/examples/ • Rigid body collisions javascript demo hUps://www.myphysicslab.com/engine2D/collision-en.html • Rigid Body Collision Reponse, Michael Manzke, course slides hUps://www.scss.tcd.ie/Michael.Manzke/CS7057/cs7057-1516-09-CollisionResponse-mm.pdf • Rigid Body Dynamics Algorithms. Roy Featherstone, 2008 • Par1cle-based Fluid Simulaon for Interac1ve Applicaons, SCA 2003, PDF • Stable Fluids, Jos Stam, SIGGRAPH 1999. interac1ve demo: hUps://29a.ch/2012/12/16/webgl-fluid-simulaon Simulaon Basics
    [Show full text]
  • Physics and Motion the Pedagogical Problem
    the gamedesigninitiative at cornell university Lecture 17 Physics and Motion The Pedagogical Problem Physics simulation is a very complex topic No way I can address this in a few lectures Could spend an entire course talking about it CS 5643: Physically Based Animation This is why we have physics engines Libraries that handle most of the dirty work But you have to understand how they work Examples: Farseer, Box2D, Bullet the gamedesigninitiative 2 Physics and Motion at cornell university The Compromise Best can do is give the problem description Squirrel Eiserloh’s Problem Overview slides http://www.essentialmath.com/tutorial.htm Hopefully allow you to read engine APIs Understand the limitations of physics engines Learn where to go for other solutions Will go more in depth on a few select topics Example: Collisions and restitution the gamedesigninitiative 3 Physics and Motion at cornell university Physics in Games Moving objects about the screen Kinematics: Motion ignoring external forces (Only consider position, velocity, acceleration) Dynamics: The effect of forces on the screen Collisions between objects Collision detection: Did a collision occur? Collision resolution: What do we do? the gamedesigninitiative 4 Physics and Motion at cornell university Take Away for Today Difference between kinematics and dynamics How do each of them work? When is one more appropriate than another? What dynamics do physics engines provide? What is a particle system? When is it used? What is a constraint solver? When is it
    [Show full text]