-
Notifications
You must be signed in to change notification settings - Fork 48
Sample Constructive Level Generator
This level generator utilizes the information presented in the GameDescription object to generate better designed levels. For example if the avatar sprite is of type FlakAvatar or HorizontalAvatar (special types of avatar where the avatar can only move horizontally), it should be placed either at the top or the bottom of the level. The generator analyzes the GameDescription object using the GameAnalyzer.
The level generator utilizes the information provided by the GameAnalyzer to generate a well-formed level. The above figure summarizes the core steps done by this approach. The generation procedure is divided into four core steps with a pre-processing step and a post-processing step:
-
(Pre-processing) Calculate Cover Percentages: This step calculates the percentage of tiles in the generated level that should be covered with sprites. It also calculates that percentage for each different sprite category. The total cover percentage is directly proportional to the number of collectible sprites, and it is inversely proportional to the number of harmful sprites and the number of sprites that are created by other sprites. All categories have a percentage directly proportional to the summation of the priority values of each sprite in each category.
-
Build a Level Layout: This step only takes place when there are solid sprites. It picks a random solid sprite and surrounds the level with that sprite. Based on the calculated solid percentage it fills the internal level with solid sprites that are connected to each other without blocking any area.
-
Add an Avatar Sprite: This step places a randomly picked avatar sprite to a random free location.
-
Add Harmful Sprites: This step adds harmful sprites to the game based on the calculated harmful percentage. If the harmful sprite is a moving sprite, the generator chooses a free location away from the avatar sprite but if the sprite is a static sprite, the generator chooses any random free location.
-
Add Collectible and Other Sprites: This step places randomly picked sprites to randomly free locations. The number of added sprites depends on their cover percentages.
-
(Post-processing) Fix Goal Sprites: This step makes sure that the number of goal sprites are greater than the number specified in the termination set for that sprite type; sprites are added until this is the case. \end{enumerate}
-
GVG Framework
- Tracks Description
- Code Structure
- Creating Controllers
- Creating Multi Player Controllers
- Creating Level Generators
- Running & Testing Level Generators
- Creating Rule Generators
- Running & Testing Rule Generators
-
Forward Model and State Observation
- Advancing and copying the state
- Advancing and copying the state (2 Player)
- Querying the state of the game
- Querying the state of the game (2 Player)
- Information about the state of the Avatar
- Information about the state of the Avatar (2 Player)
- Information about events happened in the game
- Information about other sprites in the game
- Game Description Class
- Constraints
- Game Analyzer Class
- Level Analyzer Class
- Sprite Level Description Class
- Sprite, Termination, and Interaction Data Class
- Level Mapping Class
- Competition Specifications
- VGDL Language