Petri Net modelling, simulation and analysis of a simple Role Playing Game (using pipe 2)
You will use the Petri net tool pipe 2.
Required
Syntax and Static Semantics
- An RPGGame consists of exactly one scene (or "level"). The scene has a name, 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 the scene.
- 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.
- In the game, there are two characters: the hero and the villain. A character is always on exactly one tile.
- A tile can be an empty tile, or an obstacle, on which no character can stand.
- There can be a trap on a tile. Each trap has a damage value, by default 1 (although it can be set otherwise).
- On an "standard" tile (not an obstacle), there can be an item: a goal or a weapon.
- The hero and a villain have a damage value that depicts how much damage they inflict. The default damage value for the hero and for a villain is 2 (although it can be set otherwise).
- 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 5 (although it can be set otherwise).
Dynamic (Behavioural) Semantics
- A character can move from one adjacent tile to another (provided it is not an obstacle or it is not occupied).
- The hero can attack villains and vice versa, if they stand on the same tile.
- A trap hurts the hero, but not a villain (they have set these traps...).
- The hero and a villain inflict damage (according to their damage value) if they choose to attack (when on the same tile). A trap inflicts damage (according to their damage value) on the hero if the hero steps onto it.
- A hero or villain dies if their health becomes 0.
- An item can be picked up by the hero by walking on its tile. Every item can only be picked up once.
- A hero can pick up a weapon, that can give the hero additional damage, according to the damage of the weapon (by default 1).
- A hero can pick up a goal. 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, the villain get his chance to move or attack.
- When the hero achieves the goals, or dies, the game is over.
The assignment consists of three parts.
- Build and document a Petri Net model of the RPG game. Create a scene with 3 by 3 tiles, containing everything described above. Do not use inhibitor arcs!
- Perform simulation steps of this process until the game ends, and comment.
- Build the coverability graph for this Petri Net and run conservation analysis
(note that spurious solutions may occur).
This will allow you to draw some conclusions about:
- boundedness;
- deadlock;
- reachability;
- liveness;
- persistence;
- strict alternation of hero and villain acting;
- other insights derived from the conservation analysis.