Skip to content

Sample Constructive Rule Generator

Raluca D. Gaina edited this page Feb 12, 2018 · 1 revision

This generator depends on common knowledge about VGDL games. The problem is it generates a smaller set of games compared to other techniques as the generator have fewer options.

The constructive rule generator generate the game through multiple steps:

  1. Generate Resources Interactions: Adds a collectResource interaction between the avatar and all the resources.
  2. Generate Immovable Interactions: Choose two immovable object at random. Consider the first one as collectible object. Based on that the generator adds killSprite with scoreChange when the avatar collides with this immovable object. While the second one have a chance to be either harmful object or a better collectible object. Based on that the generator adds killSprite either for the avatar if it is a harmful object or for the other object with a bigger scoreChange than the first object otherwise.
  3. Generate NPC Interactions: Is the biggest step and it depends on the type of the NPC itself. If the NPC is Fleeing, the generator adds a killSprite interaction between the NPC and whatever its running from. If the NPC is Bomber or RandomBomber, the generator first adds a killSprite between the avatar and the NPC. While the generated sprites either become collectible or harmful to the avatar. If the NPC is Chaser, AlternateChaser or RandomAltChaser, the generator makes it harmful for whatever its chasing. It will either kill it or transform it to be the same like itself. Finally, if the NPC is Random, the generator either make it harmful or collectible to the avatar.
  4. Generate Spawner Interactions: The generator selects either to make the spawned objects harmful or collectible to the avatar.
  5. Generate Portal Interactions: If the portal is defined as aDoor, the generator will consider it as an exit and will add a killSprite interaction when the avatar reach it. Otherwise if its a Portal, the generator will add teleportToExit interaction when the avatar collides with it.
  6. Generate Movable Interactions: The generator selects either to make the remaining of the objects either harmful or collectible to the avatar.
  7. Generate Wall Interactions: The generator check if there is a wall objects. Wall is a sprite that surround the level and cover at most 50% of the map. Walls can be considered as normal walls where object can pass through them or as a firewall where everything that touch it dies.
  8. Generate Avatar Interactions: If the avatar can shoot bullets or attack. The generator adds a killSprite interaction between the bullets and enemies.
  9. Generate Termination Conditions: The generator checks if there is a Door defined, it consider destroying the door is the winning condition. If there is no door, the generator checks for a Fleeing npc to make collecting all of them is the condition of winning. Otherwise, its time-based winning condition. For the loss condition, the generator attach it to avatar death.

Table of Contents:

Clone this wiki locally