Soft Body Simulation The addition of soft body dynamics to the Havok Physics Engine on the PlayStation 3 Version 1.01 Author Okke Schrijvers Student number 270359 Date 04-06-2008 Company mentor R. de Feijter School supervisor T. Harkema Summary This report describes the implementation of soft body dynamics using the Havok Physics Engine on the Playstation 3. Soft Body dynamics are a currently barely used form of physics simulation where objects are able to bend or stretch. Because up until now, there have been almost no games that implemented this feature, it is an excellent way for Playlogic to distinguish itself as a developer. To implement soft bodies, the FastLSM algorithm was chosen as it promises to provide fast and stable results. First a demo was created where the algorithm was applied in two dimensions. This provided Playlogic with early feedback to see if the soft bodies would be fun to play with. Furthermore it served as a way to see if the algorithm could deliver what it promised. After the 2D demo, the usability of the soft bodies needed to be proven in three dimensions. The soft bodies were implemented while working in a simple test environment. The development of the soft bodies progressed quickly and a 3D demo was soon created. After the 3D demo was created, time was spent on porting parts of the code to the SPUs, which are five additional processors on the Playstation 3, to improve performance. The soft bodies have the following features: • The soft bodies exist in the same physics environment as all other physics objects. • Any form of soft body is supported. • The soft bodies can be simulated in real time. • The soft bodies provide two way interaction. The environment affects them and they affect the environment. • The soft bodies make use of the SPUs to improve performance. • The soft bodies have minimal dependencies on a particular framework (besides the SPU code) and thus can be ported with minimal effort to any other framework or platform. The soft bodies are ready for use in a real game, after which it can be assessed if they really provide fun gameplay. Soft Body Simulation iii Preface Four years ago I started a bachelor’s study of Computer Science at Hanze University in the hope of landing a job in the games industry. This report is the result of my final internship, followed at Playlogic Game Factory, one of the largest game developers in the Netherlands. Over a period of five months, I implemented and optimised an algorithm of simulating soft body dynamics in a computer game. Although this process involved a great amount of mathematics, I purposefully decided to exclude this from the main report wherever possible. In my opinion this makes the report understandable to all who are interested, rather than only those who have studied mathematics. For those who are interested in the mathematical details, Appendix B provides the used mathematical concepts and equations. During the internship I received help from a few people that I would like to mention here. First of all I would like to thank Ronald de Feijter who was my company mentor and came up with the idea of implementing soft bodies to fit my interest in mathematics. His insight in mathematical problems was of great help to me. Furthermore his feedback on early drafts of this report was excellent. I’d also like to thank Kees van Kooten as he too helped with a lot of the mathematical problems, as well as with programming issues. For his help with programming on the SPUs, I’d like to thank Tijs Gobbens, who spend two whole days pair programming with me to get things to work. From the art team, I would like to thank Bart-Willem van Lith, as he was always there to help me create the graphic side of the demos and report. And last but not least, Tjerk Harkema, who helped me to look differently at how to structure and write a report. Soft Body Simulation v Contents Summary .............................................................................................. iii Preface ................................................................................................. v Notation .............................................................................................. ix 1 Introduction ........................................................................................ 1 2 Game development at Playlogic Game Factory ......................................... 3 2.1 Playlogic Company Description ......................................................... 3 2.2 The needs of Playlogic Game Factory ................................................ 5 3 Physics Simulation in Games ................................................................. 9 3.1 Physics Engines ............................................................................. 9 3.2 Soft Bodies vs. Rigid Bodies ............................................................. 9 3.3 Soft body Implementations ........................................................... 10 4 Soft Body Physics Using FastLSM ......................................................... 13 4.1 Structure .................................................................................... 13 4.2 Fast Summations ......................................................................... 14 4.3 Pre-processing ............................................................................. 17 4.4 Shape Matching ........................................................................... 17 4.5 Interpolation ............................................................................... 17 5 Internship Assignment: Analysis .......................................................... 19 5.1 Goal ........................................................................................... 19 5.2 Tasks ......................................................................................... 20 5.3 Project Scope Limits ..................................................................... 21 5.4 Risks .......................................................................................... 22 5.5 Deliverables ................................................................................ 22 5.6 Project Management ..................................................................... 25 6 Internship Assignment: Realisation ...................................................... 29 6.1 2D Demo .................................................................................... 29 6.2 3D Demo .................................................................................... 31 6.3 Framework Integration ................................................................. 33 6.4 Testing ....................................................................................... 36 7 Conclusions and Recommendations ...................................................... 41 7.1 Soft Body Physics Usability ............................................................ 41 7.2 Innovation in Games .................................................................... 41 7.3 Recommendations ........................................................................ 42 8 Reflection and Evaluation .................................................................... 43 8.1 2D Demo Breakdown .................................................................... 43 8.2 3D Demo Breakdown .................................................................... 44 8.3 Optimizing .................................................................................. 46 8.4 Personal Experience ..................................................................... 47 Soft Body Simulation vii - Contents - Appendix A: Planning ............................................................................ 49 Appendix B: FastLSM ............................................................................ 51 Appendix C: Intern Assignment .............................................................. 59 Appendix D: Internal Structure of the Playstation 3 ................................... 61 References .......................................................................................... 63 Glossary ............................................................................................. 65 viii Okke Schrijvers, Playlogic Game Factory, 2008 Notation Symbol Description Scalar, 0 … 1 , used to indicate how fast particles should go to their goal position. Interpolation weight of tangent vector with regard to the cell vertex with index . Interpolation weight of tangent vector with regard to the cell vertex with index . Interpolation weight of a model vertex with regard to the cell vertex with index . ∆ Difference in velocity between vertex / particle with index and the object / region it’s part of. Directional derivative. Derivative of a scalar function, which is a vector pointing in the direction of the greatest increase. Angular velocity. Partial derivative. Linear transformation matrix. Deformation gradient (as used in mechanics). Goal position of the particle / vertex with index . Time step of simulation. Index (used in various contexts). Inertia tensor. ̂ Base vector of the X axis in the three-dimensional Cartesian coordinate system: 1,0,0. ̂ Base vector of the Y axis in the three-dimensional Cartesian coordinate system: 0,1,0. Base vector of the Z axis in the three-dimensional Cartesian coordinate system: 0,0,1. Scalar 0 … 1 used to dampen the particles by simulating internal friction. Angular momentum. The mass of particle . The mass of particle divided
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages77 Page
-
File Size-