1 / 27

Aspect-Oriented Design of Game Application

Aspect-Oriented Design of Game Application. H. Saygın Arkan, Murat Açar, Ender Demirkaya 30 December 2010. - Outline. Introduction About Aqua Bubble Object-Oriented Design Applied Patterns Problem Statement Aspect-Oriented Programming Related Work Discussion Conclusion Demo.

Download Presentation

Aspect-Oriented Design of Game Application

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. Aspect-Oriented Design of Game Application H. Saygın Arkan, Murat Açar, Ender Demirkaya 30 December 2010

  2. - Outline • Introduction • About Aqua Bubble • Object-Oriented Design • Applied Patterns • Problem Statement • Aspect-Oriented Programming • Related Work • Discussion • Conclusion • Demo

  3. - Introduction • The game at issue is “Aqua Bubble” • The requirements are in hand. • Limited Project • But good start for Aspect Application • Enhancements to the Project • Create & Solve Problems

  4. - AquaBubble • Familiar Game • Shoot Gun • Collect 3 same colored bubbles • Balls are moving down • Bubbles are coming down with a certaintime period. • The time it takes to movedecreases with the increasing number of levels • Purpose: Finish all the balls before they came in the turret’s level.

  5. - AquaBubble • Some sample screenshots...

  6. - Object-Oriented Design • Already distributed responsibilities to packages, thereby classes • UI includes menu panels and visual items as usual. • Controller does the main operation behind. Two main packages:

  7. - Object-Oriented Design • The package diagram is as follows:

  8. - Object-Oriented Design • Ui package class diagram

  9. - Object-Oriented Design • Controller Package class diagram

  10. - AppliedPatterns • Singleton pattern • GameFrame, GameEngine, GamePanel and ControllerFacade, InGameFacade • Facade pattern • Deals with in-game managers as a one-stop solution • Abstract Factory pattern • Creation of balls in game is the subject entry • Strategy pattern • Balls have specific explosion types.Strategy smells

  11. - AppliedPatterns • Singleton Pattern Exactly one instance is necessary and sufficient

  12. - AppliedPatterns Facade Pattern

  13. - AppliedPatterns • Abstract Factory Pattern • Different balls in game are the factory products

  14. - AppliedPatterns • Strategy Pattern • For different type of explosions that the balls have. Context Class Interface View + findExplosion(ball: Ball) + findExplosion(ball: Ball) + findExplosion(ball: Ball) + findExplosion(ball: Ball) + findExplosion(ball: Ball)

  15. - Problem Statement • High coupling & LowCohesion • Enhancements= Tangling Code and Crosscutting concerns. • Sound affects are to be happened instantaneously. • Will we define sounds for each and every UI object individually? • Logging mechanim crosscuts at all times. • Where are the logs of error handling and in-game controls to be kept? • Some game add-ons are to be integrated. • Additional code to all the classes. What a disaster!

  16. - Problem Statement • SoundEffect Concern • Panel changes, button clicks, ball explosion... • Costly without Aspect, needs update & modification on all button listeners, panel change functions andthe related classes. • Logging Concern • Tracing all the process from beginning to the end. • Provides effective error handling • More controllable game process

  17. - Problem Statement • GameAddOn Concern • Functionalities that recurred to the mind. • Graying the panel when game finishes (updating all objects behind) • Changing Ball Colors (gradient, more colorful) • AWTEnforcement Concern • AWT use is strictly forbidden.

  18. - Aspect-Oriented Programming • Sound Effects Aspect is applied to Panel Changes, Button Clicks, Ball Explosions and Level Ends

  19. - Aspect-Oriented Programming • Logging Aspect is applied to the set functions,constructor calls and panel changes.

  20. - Aspect-Oriented Programming • Game Add-On Aspect is applied to change the color of all balls todark gray when the level is finished. Also, ball types shall be re-drawn with different ball images

  21. - Aspect-Oriented Programming • Game Add-On Aspect Previous implementation New implementation

  22. - Aspect-Oriented Programming • Game Add-On Aspect Previous implementation New implementation

  23. - Aspect-Oriented Programming • AWT Enforcement Aspect ensures that the project keeps it’s packagestructure. Thus, only UI package classes would use java.awt library and the use of AWT classes in Controller package is prevented

  24. - Related Work • Inside AspectJ documentation, there exists a computer game named Space War by which we are inspired. • After, we went beyond and made some core changes in the project, such as sound effects and changing theimage of bubbles in the game.

  25. - Discussion • AOP stepped into the breach • Aspect discovery and refactoring are the bottlenecks as per usual. • Legacy code, aspect mining has vital necessity all along the migration process. • Manual examination of aspect candidates. • AspectJ is a useful to track pointcuts, weaving etc.

  26. - Conclusion • The transition process of a non-modular application into a well-defined aspect-oriented structure is illustrated. • Almost at all levels that the old design congests, the fresh design pioneers the mechanism. • Shortfalls are attached to distinct aspect mechanisms with reference to the ostensible constraints. • Aspect-orientation is worth applying in the cases where the stakeholders do know much about the current system, and see the initiatory steps of migration process.

  27. Any Questions?(if not, let’splay...)

More Related