Use Case Diagram Help

Started by
5 comments, last by LorenzoGatti 10 years, 1 month ago

Hi I hope I'm posting this in the right section, if not, I apologize.

I have to make a Use Case Diagram for a game proposal I made ages ago, the only thing is I don't really understand them, like at all.

My game is just a Legend of Zelda 1 clone with grid based movement similar to Startropics and Pokemon Red.

I am required to do:

1. A list of functional Requirements with descriptions.
2. A Use Case diagram
3. A Use Case description for each Use Case on your diagram.

I don't really understand use case diagrams, I sort of get the ATM one but I don't think they work well for games. DO I need to make a different diagram for every aspect of the game or do I need to make one big one?

Also do I have the actor be the player and have all the conditions be button inputs. Or do I have the actor be the player character and have all the conditions be actions like "jump"?

I don't expect ye to do the whole thing for me, I want to learn but I don't understand examples because very few cover games.

If you could just do a small example based off my proposal to help me understand it, I would really appreciate it, thanks.

Advertisement

Now, I don't have time to properly refresh myself nor to properly help you; I'll be as productive as possible.

Use Case diagrams are showing "who can do what in system". They serve the purpose of describing all actors and scenarios the system will have. Actors in video game are usually player(s), server (if exists) and database (if exists).

When drawing a diagram, you need to look at the whole thing from the set level of abstraction (eg. player controls like "jump", "attack" etc.), and not to mix various levels. It's also good idea to draw multiple Use Case diagrams, where each diagram will cover different part of the system. For example, main menu and main game should each have its own use case diagram.

So, suppose we have actor "Player". What are the scenarios he can do in the game itself for the Legend of Zelda-like game? Movement, attack, item select, right? Here you go, you have basic Use Case diagram.

Sadly, I don't have the tools to draw them Use Case diagrams, so I can't make an example based on, for example, Castlevania (NES) game.

I've used http://www.softwareideas.net/

IIRC its free for non-commercial projects and has all UML diagrams by default (use case, ER, sequence, states, etc).

In any case, beyond what Aurioch said, its important to clarify that its all about the interactions. How the actors interact with your systems, what interactions they have available, and what those interactions require.

That said, its one of those things that can vary depending on the person that is asking for them, so you might have more refined use cases like "Jump" use case might require a "Verify ground state" use case to see if the player is on the ground or not. There are actually various levels in which you can do these things, some require more fine grained specification than others.

Actual key presses is too much. For example, you don't have a use case that is named "Click on bounding box at pixel 35,23" (which is actually the "Add to inventory" button), you need to be clear, if the intention of the player is "Draw weapon", then the interaction is "Draw weapon", not "Press F key".

The actor is outside of the system, and your system is the game. Think of the interactions the actor can have with the system, think how the actor would see them, how they would expect them to be, and what the system would need to provide such interactions.

"I AM ZE EMPRAH OPENGL 3.3 THE CORE, I DEMAND FROM THEE ZE SHADERZ AND MATRIXEZ"

My journals: dustArtemis ECS framework and Making a Terrain Generator

Ok thanks for both your help

Hi I hope I'm posting this in the right section, if not, I apologize.

I have to make a Use Case Diagram for a game proposal I made ages ago, the only thing is I don't really understand them, like at all.

My game is just a Legend of Zelda 1 clone with grid based movement similar to Startropics and Pokemon Red.

I am required to do:

1. A list of functional Requirements with descriptions.
2. A Use Case diagram
3. A Use Case description for each Use Case on your diagram.

I don't really understand use case diagrams, I sort of get the ATM one but I don't think they work well for games. DO I need to make a different diagram for every aspect of the game or do I need to make one big one?

Also do I have the actor be the player and have all the conditions be button inputs. Or do I have the actor be the player character and have all the conditions be actions like "jump"?

I don't expect ye to do the whole thing for me, I want to learn but I don't understand examples because very few cover games.

If you could just do a small example based off my proposal to help me understand it, I would really appreciate it, thanks.

I agree with @TheChubu, it depends.

You could model, for example, how the player interacts with the shopkeeper in an item store, or the navigation of the inventory system (e.g. equip/use/discard item).

I really like this introduction to UML. It's simple, clear and concise.

I draw UML diagrams with Violet when the need arises.

I am required to do:
1. A list of functional Requirements with descriptions.
2. A Use Case diagram
3. A Use Case description for each Use Case on your diagram.


Who is requiring it?

A teacher? In that case, consider asking your teacher for clarification.

I really don't imagine any other group asking for such a thing. Requirements documents and use-case examples are really only useful for communications and not so much for implementation.


When I think of use cases and requirements I imagine short design documents. I can easily imagine this because game objects often have 2-4 page descriptions and use case examples.

Since this is completely unrelated to your Zelda-style game, I'm hoping it will be useful enough to serve as an example but useless enough that you cannot turn it in. I worked on a locking door in The Sims. (Useful link so you can see what actually shipped). The requirements basically were described like this:

The object is a turnstile door. Variations include a half-height turnstile gate, a full-wall turnstile gate, and a full-wall solid door.

{Assorted pictures from the Internet suggesting an art style}

The player can click the door to select what kind of locks they want to set, or clear locks that are already set.

Locks should include:
* Ticket holder {red, green, blue, yellow tickets}
* Lock based on gender
* Age older than {toddler through adult}
* Age younger than {child through elder}
* Age exactly {toddler through elder}
* Lock based on occults, listing any installed occult type (vampire, zombie, fairy, mummy, etc)
* Lock based on species, listing any installed species
* Lock based on celebrity level, if celebrities are installed
* Any other lock that programmers can think would be easy to include
* Future-proofing to include new features in the next few expansion packs if possible

The UI is flexible. The menu to handle all the locks might look like {picture}, but we are planning to try other options based on feedback. The programmer has agreed to try several variations, and allow up to 3 days in the schedule for design and production to attempt additional variations.

Then there is a roughly 15 line checklist description of the typical behavior. If a player would be blocked by the rules, the player should attempt a different route rather than being blocked. Player walks to the door. If the only criteria they are missing is a ticket, they will automatically buy the ticket. If they meet the criteria a light appears, a sound is played, and the door opens. If they do not meet the criteria the red light stays on and a rejection sound plays. Emergency workers and critical services should be permitted through the door. Etc.

Additional notes: From various discussions, we allow people to be locked in the room indefinitely if the player changes the door locks or the sim somehow changes criteria, such as aging up. If the programmers can figure out an easy way for people to escape when locked in during a fire or other emergency that is fine, but if the sim is trapped and dies that is fine too. This is a story-telling object, so if you can find a good way to limit contradicting locks that is nice, but not required. It would be nice if we prevent doors that lock everyone out, but since both our QA and our programmers keep reminding me that we have an impossibly-high number of combinations to test, focus on what is funnest for the players with as many comprehensive spot-check tests as possible.

Use cases:

Firefighters, police, thieves, and other critical roles are always permitted through the door, no matter what the settings.
You can build a room that allows anyone.
You can build a room that allows only family members. Everyone else is rejected.
You can build a room that allows only the active player. Everyone else is rejected.
You can build a room that allows any young man and also the active player. Everyone else is rejected.
You can build a room that allows old women and allows kittens. Everyone else is rejected.
You can build a room that allows teenage girls, allows male teenage vampires, and allows male teenage werewolves. Everyone else is rejected.
You can build a room that allows male adults, female celebrities, and bartenders. Everyone else is rejected.
You can build a room that forbids zombies. Everyone else is permitted. (Surprisingly useful with Sims Supernatural.)
You can build a room with a regular door and a locked door. When an actor would be blocked by the locked door, they should choose the regular door instead.


The end result is something that programmers, modelers, animators, and audio know how to develop, QA can create pass/fail tests for, marketing can plan to sell, and any external group can read and understand the requirements.


Actual key presses is too much. For example, you don't have a use case that is named "Click on bounding box at pixel 35,23" (which is actually the "Add to inventory" button), you need to be clear, if the intention of the player is "Draw weapon", then the interaction is "Draw weapon", not "Press F key".

Even the "Add to inventory" button is likely to be too low level for a use case diagram. There will be use cases in which the Player interacts with the Inventory, for example:

  • the player shall be able to review all weapons in use and in the inventory, and switch weapons, as many times as he wants, before each fight

After elaboration of a complete set of use cases defines what the Inventory needs and needs not to do, you'll be able to decide what buttons you should have.

In other words, use case diagrams describe a problem and are a part of requirements analysis that must be done before designing software. Beware of letting early assumptions about the solution pollute requirements with useless and premature details and arbitrary limitations.

Omae Wa Mou Shindeiru

This topic is closed to new replies.

Advertisement