wallstop / DxGame

1 stars 0 forks source link

Procedural Generation? #5

Open Vatyx opened 7 years ago

Vatyx commented 7 years ago

What would be needed? Implementation?

┆Issue is synchronized with this Asana task

wallstop commented 7 years ago

Procedural Generation is a feature on the horizon, for sure. Specifically, procedural generating levels

Map resources can be found: https://github.com/wallstop/DxGame/blob/master/DxCore/Core/Map/ https://github.com/wallstop/DxGame/tree/master/DxCore/Core/Components/Advanced/Map

There are two major concepts to what a level is.

The first is the Map. Maps are made up of different MapTiles. Current tile types are blocks (impassible) and platforms (can be jumped upwards through). Additionally, Maps are aware of decent spawn locations throughout the map. Maps are described via MapDescriptors, which can be serialized.

The second is the Level. Levels are responsible for all of the custom game logic that is tied to the map. What enemies spawn, when, what items drop, how the level is ended, etc. All of those things must be programmatically attached to a Level. Levels are loaded via the LevelProgressionStrategy that any game that uses this system must provide.

In order to procedurally generate a level, you would need to consider a few things:

The actual spawn logic (what spawns when) can easily be fed into the generator. However, it is absolutely critical that the terrain is traversal, the terrain is interesting, and that spawns aren't directly on top of each other. Implementor likely needs a tie in to our physics system, or some kind of system that is able to describe movement patterns, in order to create reachable and moveable terrain. Ideally, we'd be able to plug in a variety of algorithms to determine fitness of a map. For example, if we wanted a hard map, we could limit the movable room and decrease distance between spawns.

There are a lot of approaches that can be used here. Nuclear throne uses a tunneler - a random mover that "eats" the level. Some games use some sort of base image / layout that they add & detract from. Perlin noise is a potential as well.

Further reading: How spelunky does it http://fbksoft.com/procedural-level-generation-for-a-2d-platformer/ http://www.redblobgames.com/maps/terrain-from-noise/ http://community.clickteam.com/threads/46729-Random-Map-Generator/page2

wallstop commented 7 years ago

Procedural Generation is a feature on the horizon, for sure. Specifically, procedural generating levels

Map resources can be found: https://github.com/wallstop/DxGame/blob/master/DxCore/Core/Map/ https://github.com/wallstop/DxGame/tree/master/DxCore/Core/Components/Advanced/Map

There are two major concepts to what a level is.

The first is the Map. Maps are made up of different MapTiles. Current tile types are blocks (impassible) and platforms (can be jumped upwards through). Additionally, Maps are aware of decent spawn locations throughout the map. Maps are described via MapDescriptors, which can be serialized.

The second is the Level. Levels are responsible for all of the custom game logic that is tied to the map. What enemies spawn, when, what items drop, how the level is ended, etc. All of those things must be programmatically attached to a Level. Levels are loaded via the LevelProgressionStrategy that any game that uses this system must provide.

In order to procedurally generate a level, you would need to consider a few things:

The actual spawn logic (what spawns when) can easily be fed into the generator. However, it is absolutely critical that the terrain is traversal, the terrain is interesting, and that spawns aren't directly on top of each other. Implementor likely needs a tie in to our physics system, or some kind of system that is able to describe movement patterns, in order to create reachable and moveable terrain. Ideally, we'd be able to plug in a variety of algorithms to determine fitness of a map. For example, if we wanted a hard map, we could limit the movable room and decrease distance between spawns.

There are a lot of approaches that can be used here. Nuclear throne uses a tunneler - a random mover that "eats" the level. Some games use some sort of base image / layout that they add & detract from. Perlin noise is a potential as well.

Further reading: How spelunky does it http://fbksoft.com/procedural-level-generation-for-a-2d-platformer/ http://www.redblobgames.com/maps/terrain-from-noise/ http://community.clickteam.com/threads/46729-Random-Map-Generator/page2

[--- Commented from Asana.com

commenter Eli Pinkerton

---[aa]