Development of a Physics-Aware Dead Reckoning Mechanism For
Total Page:16
File Type:pdf, Size:1020Kb
Development of a Physics-Aware Dead Reckoning Mechanism for Distributed Interactive Applications A thesis presented to the National University of Ireland, Maynooth by Patrick Joseph Walsh, B. E. for the degree of Masters of Engineering Science by Research October 2011 Department of Electronic Engineering Faculty of Science and Engineering Supervisor: Dr. Séamus McLoone Co-supervisor: Dr. Tomás Ward Head of Department: Dr. Seán McLoone ABSTRACT Distributed Interactive Applications (DIAs) are a class of software that allow geographically remote users to interact within a shared virtual environment. Many DIAs seek to present a rich and realistic virtual world to users, both on a visual and behavioural level. A relatively recent addition to virtual environments (both distributed and single user) to achieve the latter has been the simulation of realistic physical phenomena between objects in the environment. However, the application of physics simulation to virtual environments in DIAs currently lags that of single user environments. This is primarily due to the unavailability of entity state update mechanisms which can maintain consistency in such physics-rich environments. The difference is particularly evident in applications built on a peer-to-peer architecture, as a lack of a single authority presents additional challenges in synchronising the state of shared objects while also presenting a responsive simulation. This thesis proposes a novel state maintenance mechanism for physics-rich environments in peer-to-peer DIAs composed of two parts: a dynamic authority scheme for shared objects, and a physics-aware dead reckoning model with an adaptive error threshold. The first part is intended to place a bound on the overall inconsistency present in shared objects, while the second is implemented to minimise the instantaneous inconsistency during users’ interactions with shared objects. A testbed application is also described, which is used to validate the performance of the proposed mechanism. The state maintenance mechanism is implemented for a single type of physics- aware application, and demonstrates a marked improvement in consistency for that application. However, several flexible terms are described in its implementation, as well as their potential relevance to alternative applications. Finally, it should be noted that the physics-aware dead reckoning model does not depend on the authority scheme, and can therefore be employed with alternative authority schemes. i ACKNOWLEDGEMENTS Firstly I would like to thank my supervisors, Dr. Séamus McLoone and Dr. Tomás Ward, for their advice, guidance and support in writing this thesis. Thanks also to Dr. Aaron McCoy, Dr. Damien Marshall, and all the other members of the DIA group for the assistance provided over the years. If not for all of you, this would not have been written. Thanks also to the staff in the Electronic Engineering department, as friendly and helpful a group of people as I have ever met. Thank you also to the Irish Research Council for Science, Engineering & Technology, who provided the funding to make this possible. Thanks to all my friends, especially Andrew and Tadhg, who were always there to talk to, and were always willing to help if I asked, and even when I didn’t. I would like to thank my mother for all her support and assistance, I’m not sure she will ever realise how much I appreciate it. I would also like to thank my brother, Donncha, for shouldering so much work at home; it gave me the opportunity focus on this. Finally, thank you, Lorraine. You have always been supportive and patient, despite having your own thesis and just as much (probably more!) of a workload to juggle. Your encouragement has helped me at least get this far. This thesis is dedicated to my parents, Freda Creavin and John Walsh (deceased). ii DECLARATION I hereby declare that this thesis is my own work and has not been submitted in any form for another award at any university or institute of tertiary education. Information derived from published and unpublished work of others has been acknowledged in the text, and a list of references has been provided. Signed: ___________________ Date: ______________ iii CONTENTS Chapter 1 Introduction ........................................................................................... 1 1.1 Background .................................................................................................. 1 1.2 Restrictions in Physics-Aware DIA Development ....................................... 2 1.3 Simulation of Distributed Peer-to-Peer Physics ........................................... 4 1.3.1 Authority ............................................................................................... 4 1.3.2 Responsiveness ..................................................................................... 5 1.3.3 Consistency ........................................................................................... 5 1.4 Aim of Thesis ............................................................................................. 10 1.5 Contributions .............................................................................................. 10 1.6 Layout of Thesis ......................................................................................... 10 Chapter 2 Background.......................................................................................... 12 2.1 DIA History ................................................................................................ 12 2.1.1 Military ................................................................................................ 13 2.1.2 Academic............................................................................................. 14 2.1.3 Industry (Multiplayer games) .............................................................. 16 2.2 Categorising DIAs ...................................................................................... 18 2.2.1 Network Architecture .......................................................................... 18 2.2.2 Time Management .............................................................................. 22 2.3 Physics Simulation in virtual environments ............................................... 23 2.3.1 Causal and Non-causal simulation ...................................................... 25 2.3.2 Determinism in physics simulation ..................................................... 26 2.3.3 Networked Physics Simulation ........................................................... 27 2.4 Immersion in DIAs and Games .................................................................. 30 2.5 Consistency in Distributed Interactive Applications.................................. 31 2.5.1 Metrics of Consistency ........................................................................ 34 2.6 Traffic Reduction techniques and their implications for physics-rich environments .................................................................................................... 36 2.6.1 Compression ........................................................................................ 36 2.6.2 Packet Aggregation ............................................................................. 37 2.6.3 Dead Reckoning .................................................................................. 37 2.7 Summary .................................................................................................... 39 iv Chapter 3 Physics-aware state management in a P2P DIA .................................. 40 3.1 Physics-consistency-cost ............................................................................ 40 3.1.1 Anticipation of Physics-consistency-costs .......................................... 43 3.2 Authority in Physics-aware DIAs .............................................................. 44 3.2.1 Static Authority ................................................................................... 45 3.2.2 Dynamic Authority.............................................................................. 46 3.3 Updating state for physics-aware entities .................................................. 48 3.3.1 Collisions by proxy ............................................................................. 51 3.4 Minimising physics-consistency costs ....................................................... 53 3.5 Adaptive threshold DR with Authority ...................................................... 54 3.6 Testbed Application ................................................................................... 56 3.6.1 Code Development .............................................................................. 56 3.6.2 Tools and Middleware......................................................................... 56 3.6.3 Testbed Structure ................................................................................ 57 3.7 Summary .................................................................................................... 59 Chapter 4 Results and Performance ..................................................................... 60 4.1 Testing and Performance Metrics .............................................................. 60 4.1.1 Physics-aware inconsistency, and physics-consistency-costs ............. 60 4.1.2 Magnitude of Corrections to Physics-aware Entities .......................... 60 4.1.3 Update Rate ......................................................................................... 61 4.2 Motion Data