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 26 October 2012, 14h Sunday 28 October 2012, 23h55.

Contact Bart Meyers if you have a problem.

RPGame Requirements

An RPGame consists of a world that is divided into scenes (or "levels"), such as Forest, Desert, Castle, etc.

In each scene, there are a number of connected tiles.

Tiles can be connected to each other from the left, right, top or bottom. This way, a map is created for each scene.

In the game, there is one hero, and there can be villains.

Each of these characters is located on a tile, and only one character can be on a tile at the same time.

A tile can be an empty tile, or a trap, or a door (all on which the characters can stand), or an obstacle (no one can stand on obstacles).

A character can move from one adjacent tile to another (provided it is not an obstacle or it is not occupied).

A door is a portal to a door on another scene. The hero can pass through the door to enter another scene. If the hero goes back through the door, he goes back to the original door at the original scene.

The hero can attack villains and vice versa, if they stand on adjacent tiles.

Villains do not attack each other.

A trap hurts the hero, but not a villain (they have set these traps...).

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.

The hero, a villain and a trap have a damage value that depicts how much damage they inflict. 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. Damage is always strictly positive.

On a "standard" tile (not a trap, obstacle or door), there can be an item. An item can be picked up by the hero by walking on its tile. Every item can only be picked up once. Items can be a key, a weapon, or a goal.

A door can be locked, and the hero must pick up a particular key (for that door) to be able to enter doors.

A hero can pick up a weapon, that can give the hero additional damage, according to the damage of the weapon.

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.

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.

Villains in a different scene from the "active" scene (i.e., the scene in which the hero currently resides) do not do anything.

When the hero achieves the goals, or dies, the game is over.

An example of an execution/simulation trace is shown here.

  Useful Links