Meta-modelling with metaDepth 

  Assignment Goal

The goal of this assignment is to design a domain-specific modelling language (formalism) an subsequently to model Role-Playing Games (RPGs) in that language:

  1. Implement abstract syntax in metaDepth.
  2. Enrich the abstract syntax with constraints (using EOL) so that you can check that every model is well formed.
  3. Create some RPG models that are representative for all the features in your language. Some should be valid models (check by verifying them), and some should be invalid, to show that your constraints are correct.
  4. Write operational semantics (using EOL) that simulate the role-playing game.
Write a report that discusses your solution. Your report should include an overview of your solution, with focus on the difficulties you encountered and how you solved them.

You will have to complete this assignment in groups of 2. Submit your assignment on Blackboard before Friday 18 October 2013, 14h.

Contact Bart Meyers or Simon Van Mierlo if you have a problem.

RPGame Requirements

Required

Syntax and Static Semantics

  1. An RPGGame consists of exactly one scene (or "level"). The scene has a name, such as Forest, Desert, Castle, etc.
  2. In each scene, there are a number of connected tiles.
  3. Tiles can be connected to each other from the left, right, top or bottom. This way, a map is created for the scene.
  4. If a tile has a left neighbor, that neighbor should have the tile as its right neighbor. If a tile has a top neighbor, that neighbor should have the tile as its bottom neighbor.
  5. In the game, there is one character: the hero. The hero is always on exactly one tile.
  6. A tile can be an empty tile, or an obstacle, on which no character can stand.
  7. On an "standard" tile (not an obstacle), there can be an item.
  8. There is one type of item: the goal.

Dynamic Semantics

  1. A character can move from one adjacent tile to another (provided it is not an obstacle or it is not occupied).
  2. An item can be picked up by the hero by walking on its tile. Every item can only be picked up once.
  3. A hero can pick up a goal. The hero wins if he can pick up all goals. There must be at least one goal in the game.
  4. The game stops when the hero wins.

Optional

Syntax and Static Semantics

  1. An RPGame now consists of a world that is divided into a number of scenes.
  2. There is a new type of character: the villain.
  3. There are two new types of tiles: a trap, and a door.
  4. A door is a portal to a door on another scene.
  5. The hero and a villain have a health value that depicts how much damage they can take. The default health for the hero and for a villain is 100 (although it can be set otherwise). The health always has a strictly positive value.
  6. The hero, a villain, and a trap have a damage value that depicts how much damage they inflict. Damage is always strictly positive.
  7. There are two new types of items: a key, and a weapon. A weapon has a strictly positive damage value.

Dynamic Semantics

  1. The hero can pass through a door to enter another scene. If the hero goes back through the door, he goes back to the original door at the original scene.
  2. The hero can attack villains and vice versa, if they stand on adjacent tiles.
  3. Villains do not attack each other.
  4. A trap hurts the hero, but not a villain (they have set these traps...).
  5. A door can be locked, and the hero must pick up a particular key (for that door) to be able to enter that door.
  6. A hero can pick up a weapon, that can give the hero additional damage, according to the damage of the weapon.
  7. The hero and a villain inflict damage (according to their damage value) if they choose to attack (when on a tile adjacent to their adversary's tile). A trap inflicts damage (according to their damage value) on the hero if the hero steps onto it.
  8. The game is simulated in time slices: first, the hero gets one chance to move or attack. Then, all the villains in the same scene, each get their chance to move or attack. The order in which the villains get their chance is not determined.
  9. Villains in a different scene from the "active" scene (i.e., the scene in which the hero currently resides) do not do anything.
  10. When the hero achieves the goals, or dies, the game is over.
An example of an execution/simulation trace is shown here.

  Useful Links