1 / 18

2 . 2. Architectural Design I

2 . 2. Architectural Design I. Introductory exploration of game architectural design. Game Architecture (In the Abstract). Identifying game architectural structures and key modelling techniques. Input Events. Abstracting Game Architecture . Game objects have: Defined type (+ inherited)

coyne
Download Presentation

2 . 2. Architectural Design I

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. 2.2.Architectural Design I Introductory exploration of game architectural design

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

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

  4. 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:

  5. Object-oriented design 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 2D-GTA clone: AI car Properties = current/max velocity / acceleration, turning speed, damage, etc. Functionality = update( route planning, obstacle avoidance, movement update), draw Asteroid clone: Inheritance = MovingObject class {Ship, Missile, Asteroid} : MovingObject

  6. 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) Aside: You will learn more about the ‘internal’ workings of the collection classes in the Data Structures and Algorithms module. Game Layer object object Array / Dynamically Sized Array object object object object Hash Map object object Linked List object object

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

  8. 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) Ordered Updating It is normally useful to update game objects in a certain order (e.g. check for collisions, resolve collisions, update score, etc.) Player drawn in front of background and castle wall, but behind rope bridge. Castle wall drawn in front of background scenery Hud drawn on top of everything

  9. Example Game Design Object-oriented version of Space Invaders

  10. 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.

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

  12. Example design (Identifying objects) ● All extend GameObject ● No deep hierarchies, but identified groupings ● Core objects ○ Ships ○ Missiles ○ Bases ● Temporal Objects ○ Explosions ○ Messages ● Overlay Objects ○ Lifes ○ Score ● Decorative Objects ○ Background

  13. (Exploiting object reuse) Extracting functionality that is common between related game objects into superclasses.

  14. Background 1 of: Lifes Score Bases TitleLayer Dynamic Array of: AlienShips AlienMissiles MotherShip InvadersLayer PlayerShip 0 or 1 of: PlayerMissile SplashMessage 0 to N of: (Grouping objects) Decomposing the game into layers and smaller groupings

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

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

  17. 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 keygame objects • How do the key objects behave • How are the key objects grouped • How are the key objects updated To do: Complete Design 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 10 mins 9 mins 30 sec 7 mins 8 mins 3 mins 4 mins 6 mins 2 mins 1 min 5 mins Finished

  18. Summary 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

More Related