2.2. Architectural Design I

Slides:



Advertisements
Similar presentations
7.2. AI E NGINE AND S TEERING B EHAVIOUR I Design of an AI Engine and introduction to steering in game AI.
Advertisements

IMS1805 Systems Analysis Topic 3: Doing Analysis (continued from previous weeks)
Software Engineering 2003 Jyrki Nummenmaa 1 OBJECT ARCHITECTURE DESIGN These slides continue with our example application, based on the simplified.
OOP - Object Oriented Programming Object Oriented Programming is an approach to programming that was developed to make large programs easier to manage.
3.1. G RAPHICS I The use of images within games. Reflections and advice on the games proposed in the Week 2 Hand-in.
CS 501: Software Engineering Fall 2000 Lecture 16 System Architecture III Distributed Objects.
Games Development 2 Entity / Architecture Review CO3301 Week
CSE 381 – Advanced Game Programming 3D Game Architecture.
INFO415 Approaches to System Development: Part 2
How to make Space Invaders
CSCA48 Course Summary.
An Introduction to Design Patterns. Introduction Promote reuse. Use the experiences of software developers. A shared library/lingo used by developers.
Architecture styles Pipes and filters Object-oriented design Implicit invocation Layering Repositories.
Description, Classes, Interfaces, Hierarchy, Specifics George Georgiev Telerik Software Academy academy.telerik.com Technical Trainer itgeorge.net.
CSC 395 – Software Engineering Lecture 13: Object-Oriented Analysis –or– Let the Pain Begin (At Least I’m Honest!)
Institute for Personal Robots in Education (IPRE)‏ CSC 170 Computing: Science and Creativity.
3.2. G RAPHICS I Alpha blending within games. An exploration of the use of alpha blending within games.
Test Environment Algorithm Program Requirements/ Enhancements Analyze the Problem and Design a Solution Programming Software Translates the Source Code.
UHD::3320::CH121 DESIGN PHASE Chapter 12. UHD::3320::CH122 Design Phase Two Aspects –Actions which operate on data –Data on which actions operate Two.
Sample Video Game & Sound. The Plan 1.Game Theme 2.Game Structure 3.Sprites 4.Trackers 5.Collisions 6.Score 7.Levels 8.Splash Screens 9.Design 10.Implementation.
2.1. T HE G AME L OOP Central game update and render processes.
Games Development Game Architecture: Entities CO2301 Games Development 1 Week 22.
LanguageLab A Meta-modelling Environment Terje Gjøsæter and Andreas Prinz, University of Agder, Norway SDL Forum 2015, Berlin, Germany.
Open Incremental Model Checking (OIMC) and the Role of Contracts Model-Based Programming and Verification.
CHAPTER 14 Classes, Objects, and Games XNA Game Studio 4.0.
SEG 4110 – Advanced Software Design and Reengineering Topic T Introduction to Refactoring.
Dr Nick Mitchell (Room CM 224)
T HE G AME L OOP. A simple model How simply could we model a computer game? By separating the game in two parts: – the data inside the computer, and –
Computational Thinking
Finite State Machines Logical and Artificial Intelligence in Games Lecture 3a.
The Stingray Example Program CMT3311. Stingray - an example 2D game May be useful as a simple case study Most 2D games need to solve generic problems.
Object Oriented Systems Design
Advanced Computer Systems
OOP - Object Oriented Programming
Algorithms and Problem Solving
Roberta Roth, Alan Dennis, and Barbara Haley Wixom
The Movement To Objects
Systems Analysis and Design
Game Architecture Rabin is a good overview of everything to do with Games A lot of these slides come from the 1st edition CS 4455.
Systems Analysis and Design With UML 2
Introduction to Design Patterns
Unified Modeling Language
Behavioral Design Patterns
Data Abstraction: The Walls
Week 10: Object Modeling (1)Use Case Model
CS101 Introduction to Computing Lecture 19 Programming Languages
Chapter 10: Process Implementation with Executable Models
CO Games Development 2 Week 19 Extensions to Finite State Machines
Service-centric Software Engineering
Introduction Artificial Intelligent.
CSSSPEC6 SOFTWARE DEVELOPMENT WITH QUALITY ASSURANCE
Objective of This Course
Alpha blending within games
Java Programming Loops
Need for the subject.
CSE403 Software Engineering Autumn 2000 Design (Overview)
2.3. Architectural Design I
An Introduction to Software Architecture
Dynamic Authentication of Typing Patterns
Central game update and render processes
Algorithms and Problem Solving
Title of Project Joseph Hallahan Computer Systems Lab
OBJECT ARCHITECTURE DESIGN
Applying Use Cases (Chapters 25,26)
Cohesion and Coupling.
Games Development Game Architecture: Entities
Games Development 1 Review / Revision
Games Development 2 Entity / Architecture Review
From Use Cases to Implementation
Presentation transcript:

2.2. Architectural Design I Introductory exploration of game architectural design

Game Architecture (In the Abstract) Identifying game architectural structures and key modelling techniques

Abstracting Game Architecture Game Layer Game Objects Game Engine Asset Manager Input Events Abstracting Game Architecture Game objects have: Defined type (+ inherited) Properties Functionality The collective property set of all game objects defines the game state at an instance in time Assets Input Devices Graphics Devices Sound Devices Object Object Object Game objects can be grouped together Game objects can interact with one another Object

Software Design Theory You will need to define the type, properties and functionality of your game objects and also how game objects are grouped and interact. This is a process of software design. Software design is a large and important aspect of programming and can include theoretical approaches such as object- oriented design, HCI, design patterns, component-based modelling, etc. and modelling tools such as UML, etc. Most of the above will be considered within your degree. In this module we can restrict our design modelling as follows:

Object-oriented design 2D-GTA clone: AI car Properties = current/max velocity / acceleration, turning speed, damage, etc. Functionality = update( route planning, obstacle avoidance, movement update), draw Encapsulation: For each game object you will need to identify the properties that define the game object functionality offered by the game object Inheritance: You will also need to think about if/how game objects are related to each other via inheritance Asteroid clone: Inheritance = MovingObject class {Ship, Missile, Asteroid} : MovingObject

Data-Structures: Collections Different sized groupings Objects within a game layer might be grouped together into smaller sub-groupings. Both C# and Java offer a number of incredibly useful generic collection classes that can be used to group game objects (see resources) Game Layer Aside: You will learn more about the ‘internal’ workings of the collection classes in the Data Structures and Algorithms module. object Array / Dynamically Sized Array Why do this? A good reason to group object together is if it makes the task of updating/drawing either more easy or more faster (although often, making things faster comes at the expense of extra coding effort or complexity, i.e. there is rarely a win/win design solution). We might group things together for ease of processing if we want to update one bunch of objects in the same manner. We might group things together for performance reasons to save a more expensive search across all game objects or for batching related objects together for drawing (e.g. all objects that use the same image set). object Hash Map Linked List object

Devolved vs. Centralised Control One central process (e.g. defined within a layer) updates a number of game objects Update Process Easy to coordinate behaviour between multiple objects Can be cumbersome to manage if objects differ in their update behaviour Object Object Decentralised Control Each game object updates itself Object Easy to isolate object specific updating Can be difficult to manage inter-object interaction Update Process Object Update Process Or both! – The above options are not mutually exclusive and can be combined, e.g. Common centralised update, combined with secondary devolved update

Doing things in the right order Ordered Drawing For 2D games it is often necessary to draw game objects in the right order (and for performance reasons) Player drawn in front of background and castle wall, but behind rope bridge. Castle wall drawn in front of background scenery Ordered Updating It is normally useful to update game objects in a certain order (e.g. check for collisions, resolve collisions, update score, etc.) Hud drawn on top of everything

Example Game Design Object-oriented version of Space Invaders

Space Invaders… Let us consider one possible design of a classic computer game – Space Invaders. Warning: This is better classified as a final-pass reverse engineered design – i.e. we have a clear understanding of the target game and the final ‘solution’ is presented. The normal design process is often highly iterative and exploratory. Why the large warning? The reason for the large warning is to flag up that presenting a sample design in a set of lectures notes utterly fails to capture essence of the process – it simply presents the final, finished product. Design is by its very nature exploratory –the designer normally considers a range of different approaches towards modelling the system. The different approaches are subject to scrutiny and change and evolve (some getting rejected) towards a finished design. As such, a final presented design usually stands on top of lots of rejected design ideas.

Overlay information / messages 110CSC207 Games Programming Design Considerations Overlay information / messages Game Objects Decorative Effects Not forgetting sounds… but we will... Background decoration

Example design (Identifying objects) ● All extend GameObject ● No deep hierarchies, but identified groupings ● Core objects ○ Ships ○ Missiles ○ Bases ● Temporal Objects ○ Explosions The design presented here is based on the developed SpaceInvaders game within the Java code repository, however, the design slightly deviates from that developed (this design includes a Background object and does not divide missile into player and enemy missile objects). This was done to produce a more simple and consistent design. ○ Messages ● Overlay Objects ○ Lifes ○ Score ● Decorative Objects ○ Background

(Exploiting object reuse) Extracting functionality that is common between related game objects into superclasses. The above examples are merely suggestive – i.e. they provides examples of how common behaviour might be extracted. There are any number of other alternatives in terms of object resuse.

(Grouping objects) Lifes Score 1 of: Background Decomposing the game into layers and smaller groupings TitleLayer Bases AlienShips AlienMissiles Dynamic Array of: InvadersLayer MotherShip PlayerShip PlayerMissile 0 or 1 of: The TitleLayer is conveniently ignored here – although in the developed game it only really consists of graphical objects providing the user within info and some state change tests. SplashMessage 0 to N of:

(Updating/drawing objects) scroll background get input, update position, check fire update position remove if needed check/resolve collision move/appear check move across/down, fire check Deciding upon the order of update and render processes – using centralised control InvadersLayer All aliens destroyed ● Trigger next level Render Update ● Update background ● Update player ship ● Update player missile ● Update mothership ● Update alien ships ● Update alien missiles ● Update score Aliens hit player ● Trigger game over ● Draw background ● Draw bases, ships and missiles ● Draw explosions ● Draw score, lifes and messages Player ship destroyed ● Remove life ● Trigger respawn/ game over

Developing Your Game Design Having a stab at producing your own game design

Making a start (and meeting uncertainty) To do: Complete Design Making a start (and meeting uncertainty) Based on your current game idea, have a go at developing an architectural design, in particular in this exercise: What are the key game objects How do the key objects behave How are the key objects grouped How are the key objects updated Do not try to aim for some mythical ‘correct’ design – this is a first stab and lecture time is very limited. Try to identify the current areas of uncertainty and ask away. Start 2 mins 3 mins 1 min 4 mins 30 sec Finished 8 mins 10 mins 9 mins 7 mins 6 mins 5 mins

To do: Summary Complete Question Clinic Today we explored: Software design techniques Space Invaders example design Initial own game design To do: Complete Question Clinic Finalise initial game idea, team/no-team, development language and complete Project Development Report Do another iteration of your game design