Common usecase diagram for games - diagram

I developed a simple 2D puzzle game (like "bejeweled"). It can be played in two modes - "campaign" and "quick game". "Campaign" mode has several levels. Player can save his progress when quit a campaign level. "Quick game" mode just generates random level and can't be saved. In both modes player can pause the game and a menu will show up. After completing a level (no matter game mode) a statistic window will show up with buttons for exit and next level (if "campaign mode").
Main menu structure:
Continue (if there is a saved progress)
New game (game starts from first level; clears the progress)
Quick game
Exit
Pause menu structure:
Continue (resumes the game)
Back (goes to main menu and saves the progress if it's "campaign" mode)
I have to create an usecase diagram, but I have difficulties. I have made usecase diagrams for windows based software (where there are forms, buttons, textboxes, etc.), but never for games. How should look an use case diagram for a video game (and more particularly for my kind of game)? After that I have to create activity diagrams to explain the whole process in details... if it's important for the use case diagram.

Try some of these links:
These are pretty good examples of designs...
http://xnagamedevelopment.blogspot.com/2009/03/use-case-diagram.html
https://github.com/ryanalane/Sudoku-Game/blob/master/documentation/Use%20Case%20Diagram/sudoku_usecasediagram.png
This is a detailed paper on UML for games...
http://homepages.inf.ed.ac.uk/perdita/guide.pdf
This is a pretty good discussion about the use of UML in game design, in general...
http://www.gamedev.net/topic/192120-uml-for-games/

Related

How to represent the flow of a real-time web application

I am writing my thesis and need to represent the process flow of my application. I need to have a diagram that represents the flow of each process in my application. How do I represent an application which is meant to be "real-time". I have a shared whiteboard where whatever a user draw/write is reflected on the whiteboard of the other participants in the same room. For example if a user draw a rectangle, the coordinates and stuff will be sent to the other users for the rectangle to appear on their whiteboard. At the same time, the coordinates are stored in the database.
Well, there are obviously many solutions, but a sequence diagram can show what you need. Assuming you have two representation boards and a central instance then a change on the first board will be communicated to the central instance. This broadcasts the change to all connected other boards which in turn show the change.
Of course there are a zillion different ways to implement the scenario. But with a seuqence diagram the involved communication can be shown best.
Below picture shows an example how this can look like:
You will need to draw quite a number of those to show how the concurrent board drawings are communicated.

UML for a simple board game review

I'm starting to develop a board game in C++ using OpenGL.
Before starting, I want to draw the UML diagram, as shown bellow.
The game has:
A board that contains a desktop, a footer and the points of both players to show.
Pieces to put on the board
Followers (soldiers)
Mouse events
A set of rules that the players must obay in order to play
Something like The Risk, of Monopoly, etc
I'm not an expert in UML, so by looking at what I've written so far, do you think the UML (arrows and relations) is accurate with the description?
What would you change, and why?
Hard to tell without knowing the game (use case). Generally you seem to over-use aggregation. Also I miss the basic properties/methods of the single classes. Those are general observations.
Some detail observations:
The model does not differentiate between the game and the technology.
What for it this Object? It seems rather pointless. You'd better be off designing the game logic first: what are those Pieces and what can they do? Think of a better name (my dictionary suggests Token, Meeple, PlayingPiece). Things are only what their name is!
What are the Rules? I don't see any rule class at all.
Create a 2nd diagram/layer where you can concentrate on technology in a later stage.

How-to model user interaction with GUI controls in UML activity diagram?

Imagine that you have a simplistic GUI application. When you open it, there is an input box and a button placed on the application window. When you press the button you should see the entered value displayed in a popup message box. Of course, the button can be clicked without entering the value into the input box. Another possibility is that user exits the application right after opening it.
How-do you model this in UML activity diagram?
The typical UML elements like
a) decision node
b) fork/join node
do not seem appropriate to me.
According to my understanding a) is used when a check on certain set property is made and according to the outcome, the flow is routed somewhere; this is not appropriate since no checks are made
b) is not appropriate since it assumes parallel execution (?) which is not the case in the modeled situation.
There is a similar question here on SO though I don't understand what is meant by the suggested "Event element" in the accepted answer.
This seems not appropriate for a useful activity diagram:
Of course, the button can be clicked without entering the value into the input box.
Then there was no noteworthy activity, so nothing to model.
Another possibility is that user exits the application right after opening it.
Same here.
Most aspects of UML are rather GUI-unaware. You want to not spend your time modeling trivial cases but instead focus on actual workflows. Such diagrams will add way more value.
Nevertheless if you were to model something for your example, your assumption is basically right. The input validation is not bound to the willing user decision of leaving an input blank, though. You gotta do it anyway.
It is possible.
Use call operation for operation invocation on classes instance which represent GUI elements and also use Accpet Event Actions to receive events from GUI elements.GUI elements should be defined as standard classes. See Action Model part in UML Superstructure document. UML Website
It's a very interesting question. As already said in the previous post, a UI typically receive events and send informations in a visual form.
So, the particular UML actions (activity diagram) like "accept event" and "signal sending" are appropriate when the UI can receive different s events in no predefine order. Activity diagram are generally based on a "scenario" point of view, showing some scenarios but not all. Make events oriented activity diagram is more difficult; sometimes, "interruption region" have to be used.

Use Case diagram for board game

I'm creating a use case diagram for a checkers game that I programmed. How in-depth are you really supposed to go when making these? I read that they are supposed to be simple, but that is kind of vague. Do I need to create more arrows, for example between "move regular" (which means move a regular piece, as oppose to a king) and "jump"? Or is it fine not having a connection there? I just don't want to make too many arrows because it will begin to look pretty messy. Any input will be appreciated.
1) ..UML..diagram..how in-depth are you..supposed to..do I need..more arrows..don't want..it..look..messy..?
How in-depth and how simple depends on many factors, basically on an answer to "why you need it" and "who will read it".
Actually the set of questions and guides and other practices that can help you decide can be quite long. Especially useful one is listed in the chapter Agine Modeling: Agile/Lean Documentation: Strategies for Agile Software Development in Scott W. Ambler's online book.
One thing that you should get absolutely clear is what kinds of UML diagrams you need/want
2) UML..use case diagram..more arrows..or..no..connection..too many arrows..?
The arrows in use case diagrams are not an arbitrary connection lines but instead they have precise meaning, especially the <<include>> and <<extend>> relationship, see http://www.uml-diagrams.org/use-case-reference.html for their definition and examples
Besides being graphical bubbles the use case represent how an actor interacts with the System Under Design. Content of the bubbles is then described in more/less formalized text form, see Wikipedia: Use case and especially Alistair Cockburn's use case pages as he basically defined meaning of the term (later adopted by UML) his opinion matters.
3) I'm creating a..UML..diagram for a checkers game that I programmed..
In your case the King Piece bubble does not seem to be included-in or extending the Start Game bubble initiated by the Player and I don't see what sequence of steps might be hidden inside its textual representation (or in your code).
The things you began to draw look much more like UML Activity Diagram, an example
and some explaining links:
overview Debenedetti Emanuele, Activity diagrams in UML 2.0
background by Conrad Bock (one of UML authors), UML 2 Activity and Action Models, The Journal of Object Technology
UML 2 Activity and Action Models
UML 2 Activity and Action Models, Part 2: Actions
UML 2 Activity and Action Models, Part 3: Control Nodes
UML 2 Activity and Action Models, Part 4: Object Nodes
UML 2 Activity and Action Models, Part 5: Partitions
UML 2 Activity and Action Models, Part 6: Structured Activities
tool manuals
PaceStar UML Diagrammer, UML Diagramming Guide - http://www.pacestar.com/uml/udg60.pdf
Sparx Enterprise Architect, Using UML Part Two – Behavioral Modeling Diagram - http://www.sparxsystems.com.au/downloads/whitepapers/UML_Tutorial_Part_2_Introduction.pdf
Microsoft Visual Studio, UML Activity Diagrams - http://msdn.microsoft.com/en-us/library/vstudio/dd409360.aspx
There are much less use cases here. Pls refer to the following diagram drawn by myself:
The other requirements can be written in use case specification, specially the business rules.
Use case name: Move piece
Actors: Player (Primary)
Pre-conditions: ******
Post-conditions: ******
Stakeholders and Interests: ******
Basic Path:
Player selects one piece and the destination square, and submit a move request.
System validates destination square.
System moves the piece and calculates the moving.
System displays the moving result.
Exception Path:
2a. destination square is not valid:
2a1. System ****
Business Rule:
valid destination square : ……
calculating rule, such as king piece, win game……

What is the best way to graphically represent page flow, as applicable to an action oriented web application?

What is the best way to graphically represent page flow, as applicable to an action oriented web application?
What model do you use to represent page flows (page flow diagrams) encompassing pages (views), user actions on those views (events) and processes?
These diagrams should act as a starting point for understanding between a business domain expert (say someone specifying an e-commerce web site), a technical analyst (someone responsible for designing the web application) and a web developer (someone responsible for implementing the solution)
I am not looking for a software solution to help me draw those diagrams, nor am I looking for a web flow framework that will let me implement these page flows in software.
I am, however looking for a good scheme for drawing out a page flow using pencil and paper
For example, a good answer could be as follows
Rectangle with label in CAPS represents page
Arrow with label in lowercase represents user action
Diamond with label in CAPS represents a process
Entry points always from the left (arrows come into a page from the left)
Exit points always from the right (arrows go out of a page to the right)
If there is an accepted standard, or if this problem space is actually a specific case of a larger problem space for which there exists a standard, please highlight this.
In the spirit of Stack Overflow, one scheme per answer please, and votes rather than duplicates
I have always liked Jesse James Garret's Visual Language.
Check out nAML (.NET Application Modeling Language). It includes a Visio stencil and is very interesting amd expressive.
http://code.msdn.microsoft.com/naml
I have found that modifying the state chart diagram is most useful for this purpose. I represent a visual resource (html or jsp page) as a state and the transitions are the actions that the user can perform on that page.
I then introduce another symbol for the actions between the visual pages.
State diagrams are easy for the non-technical person to follow and expressive enough to capture some complex interactions.
take a look at yuml.me as this is pretty easy to use and generates nice "scruffy" diagrams

Resources