Recent Changes - Search:

Main.SideBar (edit)

PmWiki

Design

Bosons code is based on the document-view design. The "document" is traditionally called the "gameengine" in games.

The center of the gameengine is the "Boson" class. It does the player management and controls the network. Furthermore the "Boson" class reacts to the playerinput. It contains the "BosonCanvas" class, which is probably the most important class, as it contains the items (units and shots) of the game, does the collision detection and the actual game flow. A UML diagram of the gameengine can be found here (made on 2005/08/30, keep in mind that UML diagrams tend to get out of date quickly!):
boson_gameengine_uml-050830.png
A special note on the Player class: the View sends input to the gameengine though IO classes (NOT the PlayerIO class from the gameengine!) that are plugged into the Player. These IO can be

  • mouse IO
  • keyboard IO
  • menu IO
  • computer IO (e.g. an AI player)
  • anything else

An IO can be added/removed on runtime.

On the other side is the view of the application. It consists of the main window which contains

  • The startup widgets (welcome widget, newgame (single/multiplayer) widget, start editor, network options widget, load/save widget, starting progress widget)
  • The gameview widget

(I tend to use the word "View" for the whole thing and "gameview" only for the part that displays the actual game) The "gameview" is a widget that displays the game - the canvas (or map) ("canvas renderer"), the commandframe, the minimap, ...

The View also controls the gameengine, that is it is responsible for creating the gameengine and for sending input to it (e.g. by converting mouse clicks to unit moves). All GUI and and UI takes place in the View. Therefore it is under heavy development most of the time and at least currently there is no UML diagram available.

Edit - History - Print - Recent Changes - Search
Page last modified on August 30, 2005, at 15:20