Rule-Based Operational Semantics
|
The goal of this assignment is to build a rule-based transformation for the operational semantics of RPGame in AToM3.
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.
A note on creating rules in AToM3: do not delete something from your pattern. It can cause inconsistencies. It is highly recommended to first model your LHS, and then explicitly model your RHS, both from scratch. Afterwards, you can change the GGLabels to correspond if necessary.
You will have to complete this assignment in groups of 2.
Submit your assignment on Blackboard before Friday 23 November 2012 Friday 30 November at 14h00.
Contact Bart Meyers if you have a problem.
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.