Made level generator with a Planner AI (GOAP)
Posted: 14 Nov 2016, 16:08
I Wanted to share a project ive been working off and on again for a while.
The idea I had was to use an Planner AI technique (GOAP) to construct video game levels. (I dream of automating most of the design department - those gits ;) )
GOAP - Goal Oriented Action Planning - is a system that takes a goal, a set of provided actions it can perform, and an algorithm(A*) that arranges the actions into a sequence that fullfills this goal. The action sequence is then executed and you get the following result:
The system has the following nice properties:
- Guarantees logical buildup
Every action the system can perform has preconditions and effects.
All the preconditions will need to be met before an action can be executed.
In order meet the preconditions the system will execute actions with the corresponding effects.
Example: The goal is to create a platform with a goomba on it. We start with the action PlaceGoombaOnPlatform which has the precondition: Platform.
The system now looks for an action has the effect Platform. It finds the action PlacePlatform. PlacePlatform has the precondition: JumpPosition etc. etc.
We end up with the sequence: GetJumpPosition -> PlacePlatform -> PlaceGoombaOnPlatform
- Reusability
As the system is highly modular you can easily mix and match actions
GetJumpPosition -> PlacePlatform -> PlaceGoombaOnPlatform
GetJumpPosition -> PlaceMushroomPlatform -> PlaceCoinsOnPlatform
GetJumpPosition -> PlacePlatform -> PlaceCoinBlocksOnPlatform
etc
- Guarantees playability.
Now this is a bit of a bold claim. But because every object placed will go request a position from a dedicated position generating function
every object should be placed in a position that ensure mario will be able to get to the end of the level.
- Dynamic difficulty scaling
You can add preconditions and effects that depend on how many levels the player has already played. This way you can replace
actions that place goombas with actions that place Buzzy Beetles or redshells.
More results:
The idea I had was to use an Planner AI technique (GOAP) to construct video game levels. (I dream of automating most of the design department - those gits ;) )
GOAP - Goal Oriented Action Planning - is a system that takes a goal, a set of provided actions it can perform, and an algorithm(A*) that arranges the actions into a sequence that fullfills this goal. The action sequence is then executed and you get the following result:
The system has the following nice properties:
- Guarantees logical buildup
Every action the system can perform has preconditions and effects.
All the preconditions will need to be met before an action can be executed.
In order meet the preconditions the system will execute actions with the corresponding effects.
Example: The goal is to create a platform with a goomba on it. We start with the action PlaceGoombaOnPlatform which has the precondition: Platform.
The system now looks for an action has the effect Platform. It finds the action PlacePlatform. PlacePlatform has the precondition: JumpPosition etc. etc.
We end up with the sequence: GetJumpPosition -> PlacePlatform -> PlaceGoombaOnPlatform
- Reusability
As the system is highly modular you can easily mix and match actions
GetJumpPosition -> PlacePlatform -> PlaceGoombaOnPlatform
GetJumpPosition -> PlaceMushroomPlatform -> PlaceCoinsOnPlatform
GetJumpPosition -> PlacePlatform -> PlaceCoinBlocksOnPlatform
etc
- Guarantees playability.
Now this is a bit of a bold claim. But because every object placed will go request a position from a dedicated position generating function
every object should be placed in a position that ensure mario will be able to get to the end of the level.
- Dynamic difficulty scaling
You can add preconditions and effects that depend on how many levels the player has already played. This way you can replace
actions that place goombas with actions that place Buzzy Beetles or redshells.
More results: