Soft Body Simulation

Total Page:16

File Type:pdf, Size:1020Kb

Soft Body Simulation 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
Recommended publications
  • Regulating Violence in Video Games: Virtually Everything
    Journal of the National Association of Administrative Law Judiciary Volume 31 Issue 1 Article 7 3-15-2011 Regulating Violence in Video Games: Virtually Everything Alan Wilcox Follow this and additional works at: https://digitalcommons.pepperdine.edu/naalj Part of the Administrative Law Commons, Comparative and Foreign Law Commons, and the Entertainment, Arts, and Sports Law Commons Recommended Citation Alan Wilcox, Regulating Violence in Video Games: Virtually Everything, 31 J. Nat’l Ass’n Admin. L. Judiciary Iss. 1 (2011) Available at: https://digitalcommons.pepperdine.edu/naalj/vol31/iss1/7 This Comment is brought to you for free and open access by the Caruso School of Law at Pepperdine Digital Commons. It has been accepted for inclusion in Journal of the National Association of Administrative Law Judiciary by an authorized editor of Pepperdine Digital Commons. For more information, please contact [email protected], [email protected], [email protected]. Regulating Violence in Video Games: Virtually Everything By Alan Wilcox* TABLE OF CONTENTS I. INTRODUCTION ................................. ....... 254 II. PAST AND CURRENT RESTRICTIONS ON VIOLENCE IN VIDEO GAMES ........................................... 256 A. The Origins of Video Game Regulation...............256 B. The ESRB ............................. ..... 263 III. RESTRICTIONS IMPOSED IN OTHER COUNTRIES . ............ 275 A. The European Union ............................... 276 1. PEGI.. ................................... 276 2. The United
    [Show full text]
  • A Patchwork of Potential: a Survey of the European Game Industry
    CHAPTER 10 A Patchwork of Potential: A Survey of the European Game Industry David B. Nieborg and Jeroen de Kloet INTRODUCTION Ask citizens of one the 28 member states of the EU about their national game industry and you will get 28 different answers. Compared to leading regions in North America and Asia, the EU constitutes of highly diverse regions, each differing in market size, demographics, local development communities, and national creative-industries-related policy development. It is immediately apparent that European countries with larger economies (i.e., the UK and Germany) also are preeminent in terms of game-related spending. On the other hand, high consumer spending and player activity does not necessarily translate into more active, let alone profitable, game- development communities. This disparity between local game consump- tion and production has a historical precedent. Apart from British and D.B. Nieborg (*) Media Studies, University of Toronto, Toronto, Canada J. de Kloet University of Amsterdam, Amsterdam, Netherlands © The Author(s) 2016 201 A. Fung (ed.), Global Game Industries and Cultural Policy, Palgrave Global Media Policy and Business, DOI 10.1007/978-3-319-40760-9_10 202 D.B. NIEBORG AND J. DE KLOET French publishers in the 1990s, national game industries in the Eurozone have been unable to compete with, let alone overtake their US and Asian counterparts (Larrue et al., 2005). Drawing on critical political economic theory this chapter will first provide an exploratory mapping of the European game industry offering a macroeconomic perspective of Europe as a game market, including a discussion of individual EU nations’ markets, demographics, and indus- tries.
    [Show full text]
  • About the Computer and Video Game Industry
    ESA_EssentialFacts_09:Layout 1 5/19/09 4:15 PM Page 1 2009 SALES, DEMOGRAPHIC AND USAGE DATA ESSENTIAL FACTS ABOUT THE COMPUTER AND VIDEO GAME INDUSTRY www.theESA.com © 2009 ENTERTAINMENT SOFTWARE ASSOCIATION ESA_EssentialFacts_09_Booklet_3:Layout 1 6/17/09 9:59 AM Page 2 WHAT’S INSIDE WHO IS PLAYING 2 Who Plays Computer and Video Games? 4 How Long Have Gamers Been Playing? 5 Parents and Games 6 Parents Play Games AT PLAY 7 2008 Computer and Video Game Sales by Rating 7 What Were the Top-Selling Game Genres in 2008? 8 What Were the Top-Selling Games of 2008? 9 Who Plays Games Online? 9 How Many Gamers Play Games Online? 9 What is the One Type of Online Game Played Most Often? 9 How Many Americans Play Games on Wireless Devices? THE BOTTOM LINE 10 Recent Sales Information (2007 and 2008) 11 Historical Sales Information (1996 – 2008) 11 How Many Americans Plan to Buy Games in 2008? WHO WE ARE 12 About the ESA 12 ESA Members OTHER RESOURCES 13 ESA Partners ALL DATA IN THIS DOCUMENT IS FROM THE ESA’S 2009 CONSUMER SURVEY UNLESS OTHERWISE NOTED. The Entertainment Software Association (ESA) released its 2009 Essential Facts About the Computer and Video Game Industry at the 2009 E3 Expo. The annual research was conducted by Ipsos MediaCT for the ESA. The study is the most in-depth and targeted survey of its kind, gathering data from almost 1,200 nationally representative households that have been identified as owning either or both a video game console or a personal computer used to run entertainment software.
    [Show full text]
  • Fiscal Year 2009
    annual reportFISCAL YEAR 2009 contents A Message From Michael D. Gallagher 2 Federal Government Affairs 5 State Government Affairs 7 Intellectual Property Policy 13 Anti-Piracy Program 20 Communications & Industry Affairs (C&IA) 23 Research 25 Entertainment Software Rating Board (ESRB) 26 ESA Canada 29 The ESA Foundation 30 ESA Member Listing 32 A Message From Michael D. Gallagher Dear Friends: I am pleased to present the Entertainment Software Association’s (ESA) Annual Report for Fiscal Year 2009. For 15 years now, the ESA has represented the entertainment software industry’s business and public affairs needs. Our industry’s growing role in society, particularly the economy, presents the ESA with an unprecedented array of opportunities and responsibilities. I strongly believe that the following report demonstrates the extent to which we embraced this new reality and worked to advance your objectives. Before you read on, however, I would like to a highlight a few of the activities of which we are most proud. [2] G In FY 09, the ESA welcomed seven new members: Southpeak Interactive, Natsume Inc., Trion World Network, XSEED Games, Crave Entertainment, Koei Corporation and Playlogic Entertainment. G With a growing network of retained partners across the country, ESA State Government Affairs (SGA) effectively monitored, responded to and shaped industry-related legislation during the past year. While 43 bills sought to regulate content and/or access to video games, our actions ensured that no legislature enacted a law regulating game sales. Conversely, Alabama, Arkansas, Georgia, Michigan and Texas enacted into law tax incentives for game development; similar bills are pending in 17 other states.
    [Show full text]
  • European Game Industry Report 2013
    The research is commissioned by The Research Grant Council, Hong Kong Special Administration Region. The project code is 4001-SPPR-09. The European Game Industry dr. David B. Nieborg & prof. dr. Jeroen de Kloet, University of Amsterdam Table of Contents List of figures & tables Executive summary 1. Introduction 1.1 Aim of the report 1.2 Structure of the report 1.3 Methodology and empirical data 2. Defining and segmenting the European games industry 2.1 Which European game industry? 2.2 A brief overview of the European game industry 2.3 Key EU game industry characteristics: continuity & change 2.4 Major EU policy initiatives 3. Dutch Design? The political economy of the Dutch games industry 3.1 The history of the Dutch game industry in a European context 3.2 The Netherlands in the 90's: Planting seeds of growth 3.3 Building a foundation/infrastructure: 2001 - 2005 4. Clusters of the Dutch game industry 5. Conclusion Literature Appendices 2 List of tables & figures Table 1: x Figure 1: x 3 Executive summary This report surveys the European game industries. Similar to the culturally and economically heterogeneous set of nations comprising the European Union, the European game industry consists of a patchwork of individual markets and industries. Rather than exploring the entire European continent in depth, this exploratory research will map the geographical creative clusters in the Netherlands, Sweden and the United Kingdom. Each industry is at a different stage of development and each country gives way to a different political economy and economic geography. Whereas the British game industry market is relatively large and its industry influential and productive, the Swedish and Dutch gaming markets and industries are much smaller.
    [Show full text]
  • ESA-Essential-Facts-2010.Pdf
    2010 SALES, DEMOGRAPHIC AND USAGE DATA ESSENTIAL FACTS ABOUT THE COMPUTER AND VIDEO GAME INDUSTRY © 2010 ENTERTAINMENT SOFTWARE ASSOCIATION WHAT’S INSIDE WHO IS PLAYING 2 Who Plays Computer and Video Games? 4 How Long Have Gamers Been Playing? 5 Parents and Games 6 Parents Play Games AT PLAY 7 2009 Computer and Video Game Sales by Rating 7 What Were the Top-Selling Game Genres in 2009? 8 What Were the Top-Selling Games of 2009? 9 Who Plays Games Online? 9 How Many Gamers Play Games Online? 9 What is the One Type of Online Game Played Most Often? 9 How Many Americans Play Games on Wireless Devices? THE BOTTOM LINE 10 Recent Sales Information (2008 and 2009) 11 Historical Sales Information (1996 – 2009) 11 How Many Americans Plan to Buy Games in 2010? WHO WE ARE 12 About the ESA 12 ESA Members OTHER RESOURCES 13 ESA Partners ALL DATA IN THIS DOCUMENT IS FROM THE ESA’S 2010 CONSUMER SURVEY UNLESS OTHERWISE NOTED. The Entertainment Software Association (ESA) released its 2010 Essential Facts About the Computer and Video Game Industry at the 2010 E3 Expo. The annual research was conducted by Ipsos MediaCT for the ESA. The study is the most in-depth and targeted survey of its kind, gathering data from almost 1,200 nationally representative households that have been identified as owning either or both a video game console or a personal computer used to run entertainment software. WHO IS PLAYING GAMERDEMOGRAPHICS WHO PLAYS COMPUTER AND VIDEO GAMES? 67% of American households play computer or video games.
    [Show full text]
  • Regulating Violence in Video Games: Virtually Everything Alan Wilcox
    Journal of the National Association of Administrative Law Judiciary Volume 31 | Issue 1 Article 7 3-15-2011 Regulating Violence in Video Games: Virtually Everything Alan Wilcox Follow this and additional works at: http://digitalcommons.pepperdine.edu/naalj Part of the Administrative Law Commons, Arts and Entertainment Commons, and the Comparative and Foreign Law Commons Recommended Citation Alan Wilcox, Regulating Violence in Video Games: Virtually Everything, 31 J. Nat’l Ass’n Admin. L. Judiciary Iss. 1 (2011) Available at: http://digitalcommons.pepperdine.edu/naalj/vol31/iss1/7 This Comment is brought to you for free and open access by the School of Law at Pepperdine Digital Commons. It has been accepted for inclusion in Journal of the National Association of Administrative Law Judiciary by an authorized administrator of Pepperdine Digital Commons. For more information, please contact [email protected]. Regulating Violence in Video Games: Virtually Everything By Alan Wilcox* TABLE OF CONTENTS I. INTRODUCTION ................................. ....... 254 II. PAST AND CURRENT RESTRICTIONS ON VIOLENCE IN VIDEO GAMES ........................................... 256 A. The Origins of Video Game Regulation...............256 B. The ESRB ............................. ..... 263 III. RESTRICTIONS IMPOSED IN OTHER COUNTRIES . ............ 275 A. The European Union ............................... 276 1. PEGI.. ................................... 276 2. The United Kingdom ................ ....... 279 3. Germany. ..........................
    [Show full text]
  • About the Computer and Video Game Industry
    2010 SALES, DEMOGRAPHIC AND USAGE DATA ESSENTIAL FACTS ABOUT THE COMPUTER AND VIDEO GAME INDUSTRY © 2010 ENTERTAINMENT SOFTWARE ASSOCIATION WHAT’S INSIDE WHO IS PLAYING 2 Who Plays Computer and Video Games? 4 How Long Have Gamers Been Playing? 5 Parents and Games 6 Parents Play Games AT PLAY 7 2009 Computer and Video Game Sales by Rating 7 What Were the Top-Selling Game Genres in 2009? 8 What Were the Top-Selling Games of 2009? 9 Who Plays Games Online? 9 How Many Gamers Play Games Online? 9 What is the One Type of Online Game Played Most Often? 9 How Many Americans Play Games on Wireless Devices? THE BOTTOM LINE 10 Recent Sales Information (2008 and 2009) 11 Historical Sales Information (1996 – 2009) 11 How Many Americans Plan to Buy Games in 2010? WHO WE ARE 12 About the ESA 12 ESA Members OTHER RESOURCES 13 ESA Partners ALL DATA IN THIS DOCUMENT IS FROM THE ESA’S 2010 CONSUMER SURVEY UNLESS OTHERWISE NOTED. The Entertainment Software Association (ESA) released its 2010 Essential Facts About the Computer and Video Game Industry at the 2010 E3 Expo. The annual research was conducted by Ipsos MediaCT for the ESA. The study is the most in-depth and targeted survey of its kind, gathering data from almost 1,200 nationally representative households that have been identified as owning either or both a video game console or a personal computer used to run entertainment software. WHO IS PLAYING GAMERDEMOGRAPHICS WHO PLAYS COMPUTER AND VIDEO GAMES? 67% of American households play computer or video games.
    [Show full text]