browser and game engines
play

Browser and Game Engines Ali Rantakari T -106.5840 Seminar on - PowerPoint PPT Presentation

Browser and Game Engines Ali Rantakari T -106.5840 Seminar on Software Systems Presentation on 24 November 2010 Aalto University School of Science and Technology Department of Computer Science and Engineering Contents Introduction


  1. Browser and Game Engines Ali Rantakari T -106.5840 Seminar on Software Systems Presentation on 24 November 2010 Aalto University School of Science and Technology Department of Computer Science and Engineering

  2. Contents • Introduction • Definition • Game Engines • Reference architecture • Provided features • Web Browser Engines • Interface design • Conclusion

  3. Introduction The topic is wide and deep. Let’s not get lost, or drown. Focus in this presentation is on the usage of engines in Application applications; the relevant things in connecting the two. We perceive the engine as a black box of which we may know the provided Engine features and perhaps a general ? structure but we are not concerned with internal implementation details.

  4. Questions • What is the engine? • What does the engine provide? • How is the engine used in an application? • As a library? • As a framework (inversion of control)? To what extent? • What is the interface like? • Where is the boundary between engine and application?

  5. Inversion of Control (IoC) • Term used in this presentation not in the design pattern sense but in the architectural principle sense • Who is responsible for the control flow? • Martin Fowler: “defining characteristic of a framework ”

  6. Inversion of Control: Library Library Direct calls to library App code Program flow

  7. Inversion of Control: Framework Framework Program flow Callbacks on registered handlers App code

  8. Game Engines

  9. Game Engine: Definitions • Sherrod: “a framework comprised of a collection of different tools, utilities, and interfaces that hide the low-level details of the various tasks that make up a video game” • Lewis and Jacobson: “collection of modules of simulation code that do not directly specify the game’s behaviour (game logic) or game’s environment (level data)” • J.Gregory: “We should probably reserve the term ‘game engine’ for software that is extensible and can be used as the foundation for many different games without major modification” • “The part that’s not specific to any one game”

  10. Game Engine: Definitions • Generally: a bit vague • Consensus: Not just a rendering engine (e.g. OGRE) • Is the toolset part of the engine? • In this presentation we use the concept of the runtime game engine which excludes the toolset from the definition

  11. Game Engine: Definitions • J.Gregory: “Clearly this is not a black-and-white distinction. We can think of a gamut of reusability onto which every engine falls” (see figure) • In this presentation we focus on (somewhat) generic (3D) game engines Picture credit: J.Gregory; Game Engine Architecture.

  12. Folmer: A Reference Architecture for Games Picture credit: E.Folmer; Component based game development - a solution to escalating costs and expanding deadlines?

  13. Game (Engine) Components Summary: Lots of stuff Picture credit: J.Gregory; Game Engine Architecture.

  14. Game (Engine) Components 1/3 Continues

  15. Game (Engine) Components 2/3 Continues

  16. Game (Engine) Components 3/3 “Runloop” or “Main loop”

  17. Domain Boundary • J.Gregory in Game Engine Architecture : • “If a line can reasonably be drawn between the game engine and the game itself, [the engine’s gameplay foundation systems] lie just beneath this line” • “[in practice] the line between the engine and the game can probably be best visualized as one big blur – a gradient that arcs across these components as it links the engine to the game”

  18. Panda3D Implementing game- specific functionality • Application base class has a runloop implementation (although it can easily be substituted with something else) • Lacks a predefined entity system so it has to be manually built • Custom tasks can be attached to runloop via a TaskManager • Custom Event handlers can be registered for arbitrary global events

  19. Unreal Engine Implementing game- specific functionality • Scripting system divided into UnrealScript (textual scripting) and Kismet (visual scripting) • Inheritance-based entity system • Custom game entities (Actor, Info, Controller...) can be created with custom behavior and properties • Actors (entities) may define handlers for events and trigger them in other Actors globally

  20. Crystal Space ( ) + CEL ( ) Implementing game- specific functionality • Crystal Space is primarily a rendering engine; CEL provides entity management and other features for games • Composition-based entity system • Custom entities and behaviors composed declaratively (XML) or imperatively (Python) • Behaviors and property sets attached to Entities via Property Classes • Property classes may message each other through Entity channels

  21. Commonalities Somewhat homogeneous: • Main connection points are in the gameplay foundations modules • Implementation / lower level design of the interface varies • Entity system may be composition- or inheritance- based, or it might not exist • Messaging/event channels may be e.g. per-entity or “entity system” global • Connection based on IoC (delegates / callback interfaces for game model objects, event handlers)

  22. Web Browser Engines

  23. Browser Engine: Definitions • webkit.org: “WebKit is an open source web browser engine”, “All of the rendering logic, SVG support, transforms, network support, etc. is [in WebCore]” “WebKit: the front-end layer used by applications” • MDN: Gecko: “Gecko is the name of the layout engine developed by the Mozilla Project.” • MDN: Introduction to Gecko and Embedding: “Gecko is the browser engine, networking, parsers, content models, chrome and the other technologies that Mozilla and other applications are built from. In other words, all the stuff which is not application specific.”

  24. Browser Engine: Definitions • Generally: quite clear • Confusion: rendering engine and browser engine • Grosskurth and Godfrey: “an embeddable component that provides a high-level interface to the Rendering Engine. It loads a given URI and supports primitive browsing actions such as forward, back, and reload. It provides hooks for viewing various aspects of the browsing session such as current page load progress and JavaScript alerts. It also allows the querying and manipulation of Rendering Engine settings.”

  25. A Reference Architecture for Web Browsers Application Engine

  26. WebKit, as provided in in OS X Safari Architecture WebKit Main API connection points Connect app to browser engine by User User Interface hosting a WebView instance and providing Persistence delegate protocol implementations User Interface Secure Brower Engine (WebKit) Persistence (Keychain) Browser Engine WebView Adapter (KWQ) Engine Persistence KHTML Data Persistence Rendering Engine Core KJS Expat Cocoa / Carbon Foundation Networking XML Display Backend WebScripting, WebScriptObject PCRE Parser JavaScript Interpreter Connect app to scripting environment via a WebView’s windowScriptObject and by attaching Picture credit: A. Grosskurth and M. W. Godfrey; Architecture and evolution your own WebScripting protocol of the modern web browser implementation(s) there

  27. Mozilla’s Gecko Mozilla’s Main API connection Mozilla Architecture points Connect app to browser engine by hosting User Interface an ns WebBrowser instance and providing delegate interface implementations UI Toolkit (XPFE) User Interface User, Secure, Browser Engine & Engine Persistence Gecko Rendering Engine nsWebBrowser Data Persistence Spider − GTK+ Necko Expat Monkey Adapter JavaScript XML Security Interpreter Parser GTK+ / X11 Libraries (NSS/PSM) Networking Display Backend XPConnect Connect app to scripting environment via a nsIDOMWindow ’s wrappedJSObject and by Picture credit: A. Grosskurth and M. W. Godfrey; Architecture and evolution attaching your own XPConnect wrappers there of the modern web browser

  28. The Internet Explorer engine, as provided in Windows IE Main API connection points Connect app to browser engine by hosting a WebBrowser instance (or to rendering engine by hosting an WebBrowser MSHTML instance) and providing delegate interface implementations MSHTML IDispatch Connect app to scripting environment by providing IDispatch interface implementations for WebBrowser or MSHTML through the IDocHostUIHandler interface implementation

  29. Commonalities Very homogeneous: • Main connection point for embedding or hosting: a class representing the browser engine • Possibly also a class representing the “raw” rendering engine (e.g. MSHTML in IE) • Connection based on IoC (delegates / callback interfaces) • Interface between JavaScript environment and host via mechanisms in the type system that connects the engine to the JS environment

  30. Summary Game Engines Browser Engines Definition Vague Clear Features Variant Static Interface Somewhat homogeneous Homogeneous Relevant Gameplay system, Browser engine Entity management system, component, (Rendering Interface Event/Messaging system engine component), modules JavaScript environment’s window object Interface Framework (IoC) Framework (IoC) Design

  31. Questions; Discussion.

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend