<<

S. Marks, J. Windsor, B. W¨unsche, ‘Collaborative Soft Object Manipulation for -Based Surgery Simulators’, Proceedings of Image and Computing New Zealand 2007, pp. 205–210, Hamilton, New Zealand, December 2007.

Collaborative Soft Object Manipulation for Game Engine-Based Virtual Reality Surgery Simulators

Stefan Marks John Windsor Email: [email protected] Email: [email protected] Division for Biomedical Imaging and Visualization Advanced Clinical Skills Center Department of Science Department of Surgery University of Auckland, New Zealand Faculty of Medical and Health Sciences University of Auckland, New Zealand Burkhard W¨unsche Email: [email protected] Division for Biomedical Imaging and Visualization Department of Computer Science University of Auckland, New Zealand

Abstract In this paper we analyse and evaluate the capabilities of popular game engines to simulate and interact with soft objects. We discuss how these engines can be used for simulated surgical training applications, determine their shortcomings and make suggestions how game engines can be extended to make them more suitable for such applications.

Keywords: game engines, surgical , collaboration, deformation

1 Introduction A third drawback is the constant “reinvention of the wheel.” All simulators require the basic Training tools using virtual reality (VR) simu- components depicted in figure 1, which in general lations are becoming increasingly important in are developed independently by each vendor. healthcare, in particular for applications which involve complex procedures and tasks, such as Surgical Simulator surgical training. The drivers for this include Graphics Content ● 3D models ● Organ models the improvement of quality in medical care and ● GUIs training, the need to reduce errors and costs [1], the ● Physiology model Sound ● Sounds requirement of quality standards and assessment ● Play/Record sound ● methods for the performance of medical staff, and Tasks ● Movies the desire to increase patient safety. Physics ● ● Rigid bodies User Interface User ● Collision response Most commercially available simulators focus on ● Soft bodies ● Fluids/Smoke training individuals on a limited range of surgical procedures. This restriction is a major drawback Events since cooperation is considered an important di- ● Input events mension of [2]. Only very expensive ● Output events simulators (mainly mannequins) are capable of addressing this dimension. Figure 1: Functional components of a surgical simula- The second drawback of commercially available tor. simulators is their high price, mainly due to There have been attempts to create extendable the high-end hardware and specialised input and frameworks for building surgical simulators (e.g. output devices (e.g. for force feedback). Only a SPRING [3], GiPSi [4], SOFA [5], [6]). They limited number of training centers have the means all incorporate the above mentioned components to obtain simulators, so that surgeons and interns and a variety of mathematical models for the have to travel to the closest centre to get training. physical simulation and interaction. But except for SPRING (ironically the oldest project in the list) they all lack the capability of networking with

205 other simulators in order to develop collaborative The Graphics Engine loads, displays, manipulates scenarios. Furthermore, sound support is not built and manages all the data related to graphical con- into one of them. tent and visual effects. 3D models of landscapes, buildings, players and other characters and objects Modern game engines are structured similar to sur- can be loaded, textured, lit, and animated. gical simulators (see figure 2) and also incorporate a networking and sound component. Game engines All audible content like sound effects, ambient are well tested, robust and usually available at low noise, and music, but also physical sound phenom- costs. This paper evaluates the suitability of game ena like occlusion or Doppler effect, is handled by engines for handling of soft objects in collaborative the Audio Engine. scenarios, an essential aspect of surgical simulation The implements advanced mathe- and training applications. matical models for calculating rigid body simula- tions of arbitrarily shaped and articulated objects 2 Game Engines (e.g. vehicles, machines). Artificial intelligence, provided by the AI En- The use of games or game engines for medical gine, is needed for enabling Non-Player Characters education is a little explored research subject with (NPC), the computer controlled antagonists or many areas still undiscovered. One reason for team members, to navigate, make decisions, and this might be the incoherency of the seriousness react to their environment. of medicine and the playful, sometimes violent character of computer games. Nevertheless, game The Networking component allows multiple players engines offer a vast pool of useful concepts and to interact over a network. This is achieved by resources in technical as well as in educational sending the game state and actions of all players aspects. and NPCs over the network, such that each con- nected client sees the same instance of the virtual Projects like the “ Initiative” [7] world. focus on offering help to “organize and accelerate the adoption of computer games for a variety of The great flexibility of a game engine is achieved challenges facing the world today.” A subproject by Scripting languages that allow an immediate founded by this initiative is “Games for Health” [8], access to the functions of the engine. focusing mainly on games used in various health The remaining parts of a game engine manage the care sectors. memory and the efficient scheduling of processes Previous authors have so far concentrated on (Memory/Process Management), receive the user applications where the game content was about input and other events, e.g from keyboards, mice, learning facts, rather than tasks and procedures. joysticks (Event handling), or can load media like For example, W¨unsche et al. [9] have examined music or videos (Streaming). how game engines can be used for visualisation of medical datasets, and Mackenzie et al. [10] utilise 2.2 Advantages a game engine for anatomical education. However, so far nobody has tried to simulate complex and Modern game engines utilise the latest graphics cooperative procedures, involving the interactive hardware while still being compatible with older manipulation of soft objects. . This makes game engines capable of handling the same game content on hardware with 2.1 Design different speed, memory and features. Playing computer games is no longer an action A game engine is a complex software system for single players but has evolved into multiplayer necessary for developing and playing games. Two gaming, bringing together several thousand players different games with the same underlying engine at the same time [11]. Consequently, many game differ by the game content, i.e. graphics, sounds, engines offer carefully designed and tested network storyline. Game engines a bridge between support that enables users at different physical this content and the underlying hardware. With locations anywhere in the world to cooperatively the help of an abstraction layer, accomplish tasks. Built-in support for recording the same game content can be run on many and playing sound over the network enables the platforms (e.g. Windows, , ) without players to communicate in a natural way to co- change. ordinate their actions. Textual input of messages Modern game engines consist of all or a subset of serves as an alternative way. functional blocks depicted in figure 2. The stability and reliability of game engines is secured by customers and developers worldwide,

206 ihi-ul en fcetn e aeenvi- game new creating those selected of we means engines, in-built remaining with the the Of from removed other list. also or were sound main- components without or essential Engines developed more. not any were development tained that early We those an and in state engines. still 278 engines engine contained (July disregarded evaluation game database this this internet of time 2007), an the At of [12]. engines database evaluation game suitable an of with selection our started We Selection Engine 3.1 Methodology 3 of improved. diversity be and new can quality contribute simulations the to scenarios, users and allowing application models By the making stable. sim- with more the helps of which users potential ulation, of that number ensures the and increases updated engines regularly game is of underlying the base in user simulation large participants. The the the of of skills the parameters with accordance participants change with to interact observe and to spoken to feedback, provide trainer written to supervising or simulation, surgery a ongoing by an used be can This and participants. verbal between communication provides textual and construction scenarios the collaborative of enables support networking The hardware. developing on for run consumer which useful simulations, scientific are and advantages biomedical these of developed, All then customers. are the Fixes to errors returned those flaws. and and for errors patches about and feedback give who Us I nt ernet e r Gam o I np m e Gr u S t C p a o Devi Ne p u u o h n ter iue2: Figure ics two d n c Me S so e to rk s

/ m CP rage l e o r U y

ucinlbok fagm engine. game a of blocks Functional Operating System A Ope b S s y tra 207 s ra t e c t i m t ng i o nie hs hc eeiepnieadi our distributed: in widely remaining and this and popular the inexpensive by most were opinion from list which chose original those we engines the process, of selection reduction the After all. at setting exist latter and tools, the conversion installing assumed necessary and purchasing, there editors it external for up with need as no process the is editing reduces the requirement of This complexity (maps). ronments pigsses h ipetrpeetto fsoft of representation objects. mass- simplest physics the like systems, for constructs, the spring prerequisite physical of a complicated constraints, stability demon- more resolving step and in This ability engine users . the multiple this strates when physical pull the simulation and several evaluate push the and connect of (joints) we stability constraints step, by second objects the a decrease In scenarios. drastically cooperative would in interactivity This of degree by users. triggered users animations the predefined on connected engine of the objects playback other restrict to would of the test this and state Failing (clients). server the game of engine the replication the of the exact ability by for the pulled surgical demonstrates and of This pushed subset users. are isolated limited objects a with cre- the As actions, map the multiplayer is objects. simple process physical evaluation a our of in ation step first A Evaluation 3.2 n • • • M ● ● ● ● ● ● Gr ● ● ● ● e P A B M S S oreEgn [15] Engine [14] 4 Tech id [13] 2 Engine Unreal A S A P P M mory a n o h cen a o u cou la la udio E ● ● ● S r im n a d p a t r es de y y ic M A V ro els t na E hic e / at r le u id m R s a un

rs e v dio m io t p ecor s eo u ic a gem / e d n s a s d s ming P nts ic n a

ngine E ag t d a r Gam

n oc s ent e o gi m un es en n d e t s e En ● ● ● ● ● ● ● gin C P M J R C C P o a lot ig ollis ollis a h in rtic ● ● ● ● ● ● Ne s id y h t s A S L P S B M C s

e / s io io B les/ e S a tra e I lien c u t i ar o n n t h p w lt E cs r h dy av t r ip nin ipt re de

Fluid e i ng t ork p n / layer g

i S s lan g o t E y g p e i e r i n o c n rv ne i nin s t ns n g gi io / er S g n g e m n oke e ● ● ● ● ● ● ● ● ● S U D M S S M A M Gam Cont crip tor o n s ialo o a o er un im v p d y ie s els

gs t at lin d I s s n s io t e e e ns nt rf e ac e A third step is the evaluation of the extendability 4.2 4 of the game engine itself by means of scripting or programming, called “modding.” This facilitates The engine, represented by the game “ 4” was not able to fluently display physical the implementation of features which a game en- object movements on the connected client. Objects gine might lack, such as soft tissue simulation and new interaction tools. moved with more than 25 frames per second on the server, but only with about 5 frames per second on the client. In cases, the same location update 4 Results problems as for the 2 occurred. In addition, it was not possible to connect physical 4.1 Unreal Engine 2 objects by joints, because the map editor did not The Unreal Engine 2, used, e.g., by the game implement the adding of joint constraints in the “ 2004” (see figure 3), is ca- map. This lack was unexpected, as articulated pable of simulating physical objects connected by structures like cranes with swinging load can be joints, but only in single player mode. It cannot seen in the game “ 3,” which also uses the duplicate the state of moving physical objects over id Tech 4 engine. the network. It is possible to access features of the game engine We created a map including simple physical objects by scripting, but only to a limited extent. Adding like a shelve and a table. In addition, we modified a more sophisticated physics engine is not possible a freely available skeleton model1 by adding joints since the low level functionality of the engine is to the arms, the legs and the skull. inaccessible.

When this skeleton is moved by the user on the 4.3 Source Engine server, the user on the client will not see this movement. In contrast the physical modelling of With the purchase of a game of the “Half-Life the skeleton and the with it are 2” series, the user is authorised to download the handled correctly on the server. The client player SDK () for the Source sees the skeleton still lying on the table, but is Engine. This SDK enables the construction of new lifted up when walking over the skeleton, which in maps and even modification of the of reality lies on the ground as correctly seen by the the engine. The engine itself is constructed in a server user. modular manner, so that new features can easily This asynchronism of the physics engine is not be added, e.g. the extension of the render engine considered an error, as in 2003, the time of the for automatic brightness adaption in dark or bright release of the game, the physical simulation of scenes (High Dynamic Range), which was released game objects was not yet an important aspect with the expansion mission pack Half-Life 2:Lost of gameplay. Nevertheless, users wanted to cre- Coast. ate multiplayer maps with synchronised physical The games based on the Source Engine 2 are at objects and thus developed a modification of the the time of writing unique with respect to the physics engine [16] written in the engine’s scripting use of physical objects for the completion of game language UnrealScript. Due to the age of the objectives (e.g. building ramps, moving levers, Unreal Engine 2, this project has undergone no building traps). The engine’s advanced physics further improvement since 2005 and is now no model is reflected in its ability to fluently simulate longer available on servers. objects in our test map on the server and the client. 1Skeleton model source: http://artist-3d.com/free_3d_ For the evaluation, we created a test map with models/dnm/model_disp.php?uid=637 a mass-spring system consisting of 4 4 partially intersecting spheres connected in a× rectangular pattern by 24 springs (see figure 4). This physical

Figure 3: Multiplayer test map for the Unreal Engine 2. The skeleton shows up at different locations on the server (left) and the client (right) when being moved Figure 4: Cooperative manipulation of the mass-spring in multiplayer mode. system.

208 construct can be grabbed by two or more users 5 Conclusion and being pushed and pulled. The simulation of the mass spring system was stable and well All three evaluated engines (see results in table 1) synchronised on server and client. With the allow the playback of animations and are hence custom texture and the shiny surface properties, suitable for implementing simple simulations based it resembled the handling of a colon or a similar on prerecorded animations. The Unreal Engine 2 structure. For a more realistic appearance, the also allows the manipulation of articulated physical mass spring system should deform a single geo- objects for a single user and is thereby suitable for metrical object, but this is not possible without standalone simulators. However, full collaborative extending the engine. Nevertheless, this extension interaction with physical objects is only possible is possible, since the included SDK allows the with the Source Engine. Its physics engine allows modification of the source code of the engine. the simulation of soft objects by skeletal animation or with mass-spring systems. In addition, the SDK We also created a map with a heart model whose also enables the extension of the engine with new vessels are deformable by means of “skeletal ani- features. mation” (see figure 5). To achieve this, the heart model is extended by a skeleton structure with Since in current games soft objects are not im- bones positioned along the centres of the main portant for the gameplay and are thus not imple- vessels. As a result, movement of the skeletal bones mented in the physics engines, this extensibility is a deforms the mesh of the vessels. To achieve softer major selection criterion when using game engines bending and thus a more natural appearance, the for such simulations. influence of the bones on the mesh linearly varies Development times for biomedical and scientific from 0.0 (no influence, blue colour in figure 5) at simulations can be reduced by using game engines the beginning of the vessel to 1.0 (full influence, that include editors for building custom maps. red colour) at the end. Without such editors, the integration of custom content is difficult and time consuming. Engines that allow users to create their own content also are more likely to be stable and well designed, as with increasing exploration of their capabilities in user created maps many bugs, errors and design flaws will eventually be reported and corrected.

Figure 5: Soft deformation of a tube mesh by skeletal animation. 6 Future Work Figure 6 shows how the user can grab a tool and interactively deform the heart vessels with it. At While the mesh-spring system implemented in the the same time, other users are able to observe this Source Engine allows the simulation soft objects, action and to cooperatively interact with the same the process of manually inserting and editing the model. mesh is time consuming. We plan to investigate the integration of new mathematical models for soft objects, e.g. [17, 18, 19]. Towards the end of 2007, new game engines (CryEngine 2 [20], Unreal Engine 3 [21]) will be released. Their physics engines will be more flexi- ble and offer more features, such as the simulation of cloth, fluids and smoke. This new functionality might also be useful for simulating deformable objects.

References [1] L. T. Kohn, J. M. Corrigan, and M. S. Donaldson, Eds., To Err is Human: Building a Safer Health System. Washington, DC, Figure 6: Manipulation of a deformable heart model USA: National Academy Press, Nov. 2000. seen by the acting user (top) and the observing user [Online]. Available: http://www.nap.edu/catalog. (bottom). php?record id=9728

209 Unreal id Tech 4 Source Feature Engine 2 Engine Predefined animation + + + Single physical objects, single player + + + Single physical objects, multiplayer – – (5 fps) + Connected physical objects, single player + – (no constraints available) + Connected physical objects, multiplayer – – (no constraints available) + Extensibility UnrealScript limited Source code

Table 1: Results of the evaluation of game engines.

[2] D. M. Gaba, “The future vision of simulation in [11] K.-T. Chen, P. Huang, and C.-L. Lei, “Game traf- health care,” Quality and Safety in Health Care, fic analysis: An MMORPG perspective,” Com- vol. 13, no. Suppl 1, pp. i2–i10, Oct. 2004. puter Networks, vol. 50, no. 16, pp. 3002–3023, Nov. 2006. [3] K. Montgomery, C. Bruyns, J. Brown, S. Sorkin, F. Mazzella, G. Thonier, A. Tellier, B. Lerman, [12] DevMaster.net. (2007) 3D Game Engines and A. Menon, “Spring: A General Framework Database. [Online]. Available: http://www. for Collaborative, Real-time Surgical Simulation,” devmaster.net/engines/ Studies in Health Technology and Informatics, vol. 85, pp. 296–303, 2002. [13] . (2004) Unreal Engine 2. [Online]. Available: http://www.unrealtechnology.com/ [4] M. C. C¸avu¸so˘glu,T. G. G¨oktekin, and F. Tendick, html/technology/ue2.shtml “GiPSi: A Framework for Open Source/Open Architecture Software Development for Organ [14] Wikipedia. (2007) id Tech 4 — Wikipedia, Level Surgical Simulation,” IEEE Transactions on The Free Encyclopedia. [Online]. Available: Information Technology in Biomedicine, vol. 10, http://en.wikipedia.org/wiki/Doom 3 engine no. 2, pp. 312–322, Apr. 2006. [15] . (2004) Valve [5] J. Allard, S. Cotin, F. Faure, P.-J. Bensoussan, Source Engine Features. [Online]. F. Poyer, C. Duriez, H. Delingette, and L. Grisoni, Available: http://www.valvesoftware.com/ “SOFA – an Open Source Framework for Medical sourcelicense/enginefeatures.htm Simulation,” in Medicine Meets Virtual Reality (MMVR 15), Long Beach, USA, February 2007. [16] J. Zepp. (2005) GoodKarma Physics Beta 4. [Online]. Available: http://www.ataricommunity. [6] S. Tuchschmid, M. Grassi, D. Bachofen, P. Fr¨uh, com/forums/showthread.php?t=440477 M. Thaler, G. Sz´ekely, and M. Harders, “A Flexi- ble Framework for Highly-Modular Surgical Simu- [17] A. Henriques, B. W¨unsche, and S. Marks, “An lation Systems,” in Biomedical Simulation: Third investigation of meshless deformation for fast soft International Symposium, ISBMS 2006, Zurich, tissue simulation in virtual surgery applications,” Switzerland, July 10-11, 2006, ser. Lecture Notes International Journal of Computer Assisted Radi- in Computer Science, vol. 4072. Heidelberg: ology and Surgery, vol. 2, no. Suppl 1, pp. S169– Springer Berlin, Jul. 2006, pp. 84–92. S171, June 2007.

[7] Serious Games Initiative. (2007) Serious Games [18] M. M¨uller, B. Heidelberger, M. Teschner, and Initiative. [Online]. Available: http://www. M. Gross, “Meshless deformations based on seriousgames.org shape matching,” ACM Transactions on Graph- ics, vol. 24, no. 3, pp. 471–478, Jul. 2005. [8] Serious Games Initiative. (2007) Games For Health. [Online]. Available: http://www. [19] A. R. Rivers and D. L. James, “FastLSM: Fast gamesforhealth.org Lattice Shape Matching for Robust Real-Time [9] B. C. W¨unsche, B. Kot, A. Gits, R. Amor, Deformation,” in SIGGRAPH ’07: ACM SIG- J. Hosking, and J. Grundy, “A Framework GRAPH 2007 papers, vol. 26, no. 3. New York, for Game Engine Based Visualisations,” in NY, USA: ACM Press, Jul. 2007, p. 82. Proceedings of Image and Vision Computing [20] . (2002) CryEngine 2 Specifications. New Zealand 2005, Nov. 2005. [Online]. Avail- [Online]. Available: http://www.crytek.com/ able: http://www.cs.auckland.ac.nz/∼burkhard/ technology/index.php?sx=eng2 Publications/IVCNZ05 WuenscheKotEtAl.pdf [21] Epic Games. (2006) Unreal Engine 3. [Online]. [10] J. Mackenzie, G. Baily, M. Nitsche, and Available: http://www.unrealtechnology.com/ J. Rashbass, “Gaming Technologies for Anatomy html/technology/ue30.shtml Education,” Online, May 2003. [Online]. Available: http://www.virtools.com/news/pdf/ 2004/CARET.pdf

210