Object Oriented Game Framework Design Riz Verghese Joj.

Slides:



Advertisements
Similar presentations
ANU COMP2110 Software Design in 2003 Lecture 16Slide 1 Lecture 16: Introduction to design patterns 1What are they? 2Where do they come from? 3Why study.
Advertisements

Design Patterns Introduction What is a Design Pattern? Why were they developed? Why should we use them? How important are they?
Design Patterns Examples of smart use of inheritance and polymorphism: Composite Pattern State Pattern FEN 2014UCN Teknologi/act2learn1.
Object-Oriented Design Patterns Composite Singleton State Observer … Autumn 2012UCN Technology: IT/Computer Science1.
SE2811 Week 7, Class 2 The Gang of Four and more … Lab Thursday: Quiz SE-2811 Slide design: Dr. Mark L. Hornick Content: Dr. Hornick Errors: Dr. Yoder.
CS590L - Lecture 6 1 CS590L Distributed Component Architecture References: - E. Gamma, R. Helm, R. Johnson, J. Vlissides, Design Patterns: Elements of.
OOP Design Patterns Chapters Design Patterns The main idea behind design patterns is to extract the high level interactions between objects and.
Plab – Tirgul 12 Design Patterns
Design Patterns CS is not simply about programming
IMS5024 Week 3 Semester 2, IMS 5024 Object orientation (1)
Spring 2010CS 2251 Design Patterns. Spring 2010CS 2252 What is a Design Pattern? "a general reusable solution to a commonly occurring problem in software.
IMS5024 Week 61 IMS 5024 Object orientation (1). IMS5024 Week 62 Content Individual assignment date Group assignment What is object orientation? n Place.
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Design Patterns.
PRESENTED BY SANGEETA MEHTA EECS810 UNIVERSITY OF KANSAS OCTOBER 2008 Design Patterns.
Pattern Myths1 Ten Design Pattern Myths Jim Fawcett condensed from Pattern Hatching, John Vlissides, Addison-Wesley, 1998.
Introduction to software design patterns For CSE 3902 By: Matt Boggus.
1 PH Chapter 1 (pp. 1-10) GoF Composite Pattern (pp ) PH Ch 2 through Fundamentals (pp ) Presentation by Julie Betlach 5/28/2009.
Design Patterns Trends and Case Study John Hurst June 2005.
Chapter 7 GRASP patterns Dr Seham Mostefai CAP 252.
Comp2110 Software Design lecture 13Detailed Design (1)  detailed design contrasted with high level design  introducing the Observer Design Pattern 
An Introduction to Design Patterns. Introduction Promote reuse. Use the experiences of software developers. A shared library/lingo used by developers.
ISP666 MVC & Design Patterns. Outline Review Event Programming Model Model-View-Controller Revisit Simple Calculator Break Design Patterns Exercise.
SOEN 6011 Software Engineering Processes Section SS Fall 2007 Dr Greg Butler
January 12, Introduction to Design Patterns Tim Burke References: –Gamma, Erich, et. al. (AKA, The Gang of Four). Design Patterns: Elements of Reusable.
Creational Patterns CSE301 University of Sunderland Harry R Erwin, PhD.
SOFTWARE DESIGN AND ARCHITECTURE LECTURE 27. Review UML dynamic view – State Diagrams.
CS 325: Software Engineering February 12, 2015 Applying Responsibility-Assignment Patterns Design Patterns Situation-Specific Patterns Responsibility-Assignment.
Patterns and Reuse. Patterns Reuse of Analysis and Design.
Object-Oriented Design Principles and Patterns. © 2005, James R. Vallino2 How Do You Design? What principles guide you when you create a design? What.
L11-12: Design Patterns Definition Iterator (L4: Inheritance)‏ Factory (L4: Inheritance)‏ Strategy (L5: Multiple Inheritance)‏ Composite (L6: Implementation.
Software Design Patterns (1) Introduction. patterns do … & do not … Patterns do... provide common vocabulary provide “shorthand” for effectively communicating.
Chapter 8 Object Design Reuse and Patterns. Object Design Object design is the process of adding details to the requirements analysis and making implementation.
Design Principle & Patterns by A.Surasit Samaisut Copyrights : All Rights Reserved.
Design Patterns CSIS 3701: Advanced Object Oriented Programming.
Frameworks CompSci 230 S Software Construction.
CSC 480 Software Engineering Design With Patterns.
Design Patterns By Mareck Kortylevitch and Piotreck Ratchinsky.
Appreciating OO Design Principles & Patterns Dale Skrien Dept of Computer Science Colby College Waterville, ME 04901
Sadegh Aliakbary. Copyright ©2014 JAVACUP.IRJAVACUP.IR All rights reserved. Redistribution of JAVACUP contents is not prohibited if JAVACUP.
Design Patterns: Elements of Reusable Object- Orientated Software Gamma, Helm, Johnson, Vlissides Presented By: David Williams.
Design Patterns Software Engineering CS 561. Last Time Introduced design patterns Abstraction-Occurrence General Hierarchy Player-Role.
1 Chapter 5:Design Patterns. 2 What are design pattern?  Schematic description of design solution to recurring problems in software design and,  Reusable.
CS251 – Software Engineering Lectures 18: Intro to DP Slides by Rick Mercer, Christian Ratliff, Oscar Nierstrasz and others 1 و ابتغ فيما آتاك الله الدار.
Banaras Hindu University. A Course on Software Reuse by Design Patterns and Frameworks.
Architecture, Design Patterns and Faithful Implementation David Woollard University of Southern California Software Architecture Group NASA Jet Propulsion.
Class Relationships Lecture Oo08 Polymorphism. References n Booch, et al, The Unified Modeling Language User Guide, Chapt 10 p.125 n Fowler & Scott, UML.
1 Good Object-Oriented Design Dr. Radu Marinescu Lecture 4 Introduction to Design Patterns.
Design Patterns CSCE 315 – Programming Studio Spring 2013.
Design Patterns Source: “Design Patterns”, Erich Gamma, Richard Helm, Ralph Johnson, John Vlissides And Created.
GRASP – Designing Objects with Responsibilities
Design Patterns: MORE Examples
COMP2110 Software Design in lecture 14 Patterns(1) /Detailed Design
The Object-Oriented Thought Process Chapter 15
Chapter 5:Design Patterns
Software Design Patterns
Introduction to Design Patterns
Introduction to Design Patterns
Design Patterns Introduction
Design Patterns.
Advanced Programming Behnam Hatami Fall 2017.
Web Programming Language
Patterns.
CSC 480 Software Engineering
DESIGN PATTERNS : Introduction
Informatics 122 Software Design II
CSC 480 Software Engineering
Chapter 8, Design Patterns Introduction
Software Design Lecture : 27.
FRAMEWORKS AND REUSE What is “Framework”?
Presentation transcript:

Object Oriented Game Framework Design Riz Verghese Joj

Frameworks: What are they? Semi complete applications Complete applications can be developed by inheriting from and instantiating parameterized framework components. Provide domain-specific functionality Business, telecom, databases, games. Exhibit inversion of control at run-time Determines which objects and methods to invoke in response to events.

Benefits The most profoundly elegant framework will never be reused unless the cost of understanding it and then using its abstractions is lower than the programmers perceived cost of writing then from scratch. - Booch, Dr. Dobbs Journal, 1994.

Design Patterns Each pattern describes a problem which occurs over and over again in our environment and then describes the core of the solution to that problem, in such a way that you can use the solution a million times over, without ever doing it the same way twice. - Christopher Alexander, A Pattern Language, 1977.

Design Patterns … what are they? A Solution to a problem in context Provide experience reuse instead of code reuse. Hundreds of patterns exists! Vocabulary: Facilitates communication among developers Lets you think at an architecture level, not implementation level. Eg: Factory, Observer, Composite, Singleton

Frameworks and Design Patterns

An example game framework Classic arcade style games 2D tile based games Basic elementary collision Supports dynamic class loading

Another Game

The Design Resource Manager Resource Image Resource Sound Resource Sprite Game board Tile Indexer Tile manager Tiles Immovable Tile Movable Tile

Patterns Resource Manager Factory Reads from an xml file Dynamic creation of classes Associate images and sounds with a tile Tile Manager Observer Tiles created subscribes to the Tile Manager Tile Manager tells the board where the tiles are Tiles have to request movement from the Tile Manager.

Game specific patterns Patterns arent limited to the framework Game specific code can have lots of patterns The Snake game: Especially uses the composite pattern Framework objects mostly follow the singleton pattern where as game specific objects do not.

How does the framework work? Resource manager loads the tiles in memory from information in the XML file. Level loader prepares an instance of the board, tiles and placement of the tiles on the board. Game specific class maps input to tile action (usually movement) Tile asks board if it can move to the desired place Board lets tile move or not Property of the tile determine what happens when two tiles occupy the same space Collide, Consume, Cancel.

Implementation specifics Two threads The first allows the board to redraw/refresh The second allows every tile to think The think method allows the tiles to Keep moving Keep falling Know what to do on collision Tells other tiles what to do

More specifics Tiles can have relations The observer/observable relationship Eg: Acno game: Door disappears when key is eaten Key tells door to disappear Eg: Snake gets longer when apple is eaten Apple tells snake body to spawn

Advantages Allows you to step back and generalize More time spent on the framework Isnt worth it for just one game Allows you to spend time on the game (content) not the implementation Saves a LOT of time for one particular game Clean implementation The framework code is generally hidden Game specific code is small (from reusing framework components)

Disadvantages Games are limited to the framework Cant build all games Features Limited to framework provision and functionality Sometimes overcome through ugly workarounds/tricks/hacks

References The development of a Game Playing Framework using Interface-based programming, Mark Cohen, Issue 12.1, ACM Student Magazine, Fall Object-oriented Game Development, Julian Gold, ISBN: X, Addison Wesley, Introducing Object Oriented Frameworks, Taligent white paper. Designing Reusable Classes, R. Johnson and B. Foote, Journal of Object-Oriented Programming, 1(2):22--35, June/July 1988 Design patterns: Abstraction and reuse of object-oriented design, E. Gamma, R. Helm, R. Johnson, and J. Vlissides, In European Conference on Object-Oriented Programming Proceedings (ECOOP'93), volume 707 of Lecture Notes in Computer Science. Springer-Verlag, July 1993.

The end … Discussion