Generators: Difference between revisions
NerdOfEpic (talk | contribs) |
NerdOfEpic (talk | contribs) No edit summary |
||
| Line 1: | Line 1: | ||
= Map Parts = | = Map Parts = | ||
The map is a nested structure of rooms made of screens. | The map is a nested structure of rooms made of screens built up of structures. | ||
== Rooms == | |||
A room is the smallest part of the world that can be loaded into the engine. Internally they are represented as a 2D array of screens. | |||
'''Some tidbits about rooms:''' | |||
* The space they contain is always bounded by a rectangle that has a position in the world. | |||
* The space is always represented as a rectangle of screens, even not completely filled in. | |||
* Null screens are allowed in the rectangle to indicate that a screen inside the room is not used. | |||
* The room cannot represent multiple disconnected spaces, just make multiple rooms. | |||
* The screens within the space of a room must touch all edges of the containing rectangle. | |||
* Rooms are the level that represent a self contained space that is loadable by the game engine. | |||
* A room can be as small as a single screen (1x1 array). | |||
* There is no specific design limit on how many screens can be involved in a single room. | |||
* Exits for the room are defined at the room level, but they are positioned based on the screens they contain. | |||
== Screens == | == Screens == | ||
A screen is exactly what it sounds like, the amount of space that can be represented on a screenful of space. A room can be a single screen | A screen is exactly what it sounds like, the amount of space that can be represented on a screenful of space. A room can be as small as a single screen that has only one exit. | ||
'''A screen represents:''' | '''A screen represents:''' | ||
* 640x360 pixels. Selected for easy integer scaling to most typical 16:9 screen resolutions. | * 640x360 pixels. Selected for easy integer scaling to most typical 16:9 screen resolutions. | ||
* 32x18 tiles. Each tile is 20x20 pixels. | * 32x18 tiles. Each tile is 20x20 pixels. | ||
* A | * A screen can have up to 4 exits, one per screen edge. | ||
== Structures == | |||
Structures are parameterized chunks of "stuff" that go in a room. They include platforms, room edges, doors, statues, hazards, generators, and anything else that can be visually placed on a screen. The placement of structures is managed by room generators that need the structure in question. | |||
= Map Display = | |||
While playing the game, the player can pull up the map at any time. This map system shows the known world in a way that allows a player to look around, figure out routes, and find places where missing items could be. | While playing the game, the player can pull up the map at any time. This map system shows the known world in a way that allows a player to look around, figure out routes, and find places where missing items could be. Map information is updated when the player enters each screen the first time, by using map stations to reveal chunks of information all at once, and by opening doors or collecting items. | ||
'''For the in-game map:''' | '''For the in-game map:''' | ||
* Each in game tile (20x20) is represented as a single pixel (1x1) resulting in a 20:1 scaling factor. | * Each in game tile (20x20 pixels) is represented as a single pixel (1x1) resulting in a 20:1 scaling factor. | ||
* | * Each screen is part of the map grid and is represented as a rectangle of 32x18 pixels. | ||
* Can be zoomed and panned to search and explore. | * Can be zoomed and panned to search and explore. | ||
* | * There is no automatic routing system, figuring out where to go is part of the fun of exploration. | ||
* | * The screen the player is currently in is highlighted on the map. | ||
* In-world things like doors, upgrades, stations, and bosses are drawn over the map. | |||
* Typically these symbols are larger than 1x1 pixel each, so they should be expected to obscure parts of the map. | |||
= Generators = | |||
There is a procedural generation system that creates the world. It's made up of nested layers that have specific roles in the process. | |||
= Map Generation Manager = | == Map Generation Manager == | ||
This system orchestrates the layout of the entire map. | This system orchestrates the layout of the entire map. Essentially it manages the use of room generators and the placement and interconnection of the generated rooms. | ||
''' | '''The Manager:''' | ||
* Owns the random number | * Owns the random number generator that provides the stream of random numbers used during generation. | ||
* Makes decisions based on the world configuration. | * Makes decisions based on the world configuration. | ||
* Decides how room generators are used to fill in the map. | * Decides how room generators are used to fill in the map. | ||
* Places upgrades in the world. | * Places upgrades and doors in the world. | ||
* Owns item progression logic. | * Owns item progression logic. | ||
* Selects and assigns biomes to rooms. | * Selects and assigns biomes to rooms. | ||
* | * Is also the creator of multi-room constructs, for example boss rooms with nearby saves. | ||
* Escape path router. | * Escape path router that is used to calculate the amount of time allowed for the escape. | ||
= Room Generators = | == Room Generators == | ||
Generators are pieces of code that generate individual types of rooms. They have several parameters that are provided by the map generation manager that control what is generated. | Generators are pieces of code that generate individual types of rooms. They have several parameters that are provided by the map generation manager that control what is generated. | ||
== Types == | === Types === | ||
There is a collection of room generators that is used to build the world. There are also [[Tutorial Generators]] that create the specific set of rooms used for the tutorial area if needed. | There is a collection of room generators that is used to build the world. There are also [[Tutorial Generators]] that create the specific set of rooms used for the tutorial area if needed. | ||
| Line 53: | Line 64: | ||
* The world position of the upper-left screen in this room, in screens. | * The world position of the upper-left screen in this room, in screens. | ||
* The size of the room to generate, in screens. | * The size of the room to generate, in screens. | ||
* | * Information about where the room must make contact with the edges of its space so doors can be placed. | ||
* Item limiters that are allowed to be used. These are items that could have been collected by the time the player gets to this room and can be used to limit travel through the room that will be generated. | |||
'''Generators produce rooms that have markers for:''' | '''Generators produce rooms that have markers for:''' | ||
* | * Where doors can be placed (essentially any screen edge where the room touches the edge of the containing rectangle). | ||
* Enemy spawn points with difficulty flags. | * Enemy spawn points with difficulty flags. | ||
* Locations where upgrade items can be placed if needed. | * Locations where upgrade items can be placed if needed. | ||
| Line 64: | Line 76: | ||
!Generator!!Extra Parameters!!Description | !Generator!!Extra Parameters!!Description | ||
|- | |- | ||
|Single-Screen | |Single-Screen||'''Type'''<br /> | ||
* Empty | * Empty | ||
* Save | * Save | ||
| Line 70: | Line 82: | ||
* Recharge (HP, Ammo, Spawner) | * Recharge (HP, Ammo, Spawner) | ||
* Upgrade Item | * Upgrade Item | ||
'''Exit Direction''' | '''Exit Direction(s)''' | ||
||This room is always exactly 1x1 screen and has a single exit. It can be any of the various 1 screen types. | ||This room is always exactly 1x1 screen and has a single exit. It can be any of the various 1 screen types. | ||
|- | |- | ||
| Line 96: | Line 108: | ||
|} | |} | ||
= | == Structure Generators == | ||
Structures are parameterized chunks of "stuff" that go in a room. They include platforms, room edges, doors, statues, hazards, generators, and anything else that can be visually placed on a screen. The use of these is managed by the room generator that needs the stuff in question. | Structures are parameterized chunks of "stuff" that go in a room. They include platforms, room edges, doors, statues, hazards, generators, and anything else that can be visually placed on a screen. The use of these is managed by the room generator that needs the stuff in question. | ||
== Types == | === Types === | ||
There is a collection of structure generators that can be used by room generators to make things that go in the rooms during generation. | There is a collection of structure generators that can be used by room generators to make things that go in the rooms during generation. | ||
Revision as of 00:45, 13 January 2026
Map Parts
The map is a nested structure of rooms made of screens built up of structures.
Rooms
A room is the smallest part of the world that can be loaded into the engine. Internally they are represented as a 2D array of screens.
Some tidbits about rooms:
- The space they contain is always bounded by a rectangle that has a position in the world.
- The space is always represented as a rectangle of screens, even not completely filled in.
- Null screens are allowed in the rectangle to indicate that a screen inside the room is not used.
- The room cannot represent multiple disconnected spaces, just make multiple rooms.
- The screens within the space of a room must touch all edges of the containing rectangle.
- Rooms are the level that represent a self contained space that is loadable by the game engine.
- A room can be as small as a single screen (1x1 array).
- There is no specific design limit on how many screens can be involved in a single room.
- Exits for the room are defined at the room level, but they are positioned based on the screens they contain.
Screens
A screen is exactly what it sounds like, the amount of space that can be represented on a screenful of space. A room can be as small as a single screen that has only one exit.
A screen represents:
- 640x360 pixels. Selected for easy integer scaling to most typical 16:9 screen resolutions.
- 32x18 tiles. Each tile is 20x20 pixels.
- A screen can have up to 4 exits, one per screen edge.
Structures
Structures are parameterized chunks of "stuff" that go in a room. They include platforms, room edges, doors, statues, hazards, generators, and anything else that can be visually placed on a screen. The placement of structures is managed by room generators that need the structure in question.
Map Display
While playing the game, the player can pull up the map at any time. This map system shows the known world in a way that allows a player to look around, figure out routes, and find places where missing items could be. Map information is updated when the player enters each screen the first time, by using map stations to reveal chunks of information all at once, and by opening doors or collecting items.
For the in-game map:
- Each in game tile (20x20 pixels) is represented as a single pixel (1x1) resulting in a 20:1 scaling factor.
- Each screen is part of the map grid and is represented as a rectangle of 32x18 pixels.
- Can be zoomed and panned to search and explore.
- There is no automatic routing system, figuring out where to go is part of the fun of exploration.
- The screen the player is currently in is highlighted on the map.
- In-world things like doors, upgrades, stations, and bosses are drawn over the map.
- Typically these symbols are larger than 1x1 pixel each, so they should be expected to obscure parts of the map.
Generators
There is a procedural generation system that creates the world. It's made up of nested layers that have specific roles in the process.
Map Generation Manager
This system orchestrates the layout of the entire map. Essentially it manages the use of room generators and the placement and interconnection of the generated rooms.
The Manager:
- Owns the random number generator that provides the stream of random numbers used during generation.
- Makes decisions based on the world configuration.
- Decides how room generators are used to fill in the map.
- Places upgrades and doors in the world.
- Owns item progression logic.
- Selects and assigns biomes to rooms.
- Is also the creator of multi-room constructs, for example boss rooms with nearby saves.
- Escape path router that is used to calculate the amount of time allowed for the escape.
Room Generators
Generators are pieces of code that generate individual types of rooms. They have several parameters that are provided by the map generation manager that control what is generated.
Types
There is a collection of room generators that is used to build the world. There are also Tutorial Generators that create the specific set of rooms used for the tutorial area if needed.
All generators receive parameters:
- The world position of the upper-left screen in this room, in screens.
- The size of the room to generate, in screens.
- Information about where the room must make contact with the edges of its space so doors can be placed.
- Item limiters that are allowed to be used. These are items that could have been collected by the time the player gets to this room and can be used to limit travel through the room that will be generated.
Generators produce rooms that have markers for:
- Where doors can be placed (essentially any screen edge where the room touches the edge of the containing rectangle).
- Enemy spawn points with difficulty flags.
- Locations where upgrade items can be placed if needed.
| Generator | Extra Parameters | Description |
|---|---|---|
| Single-Screen | Type
Exit Direction(s) |
This room is always exactly 1x1 screen and has a single exit. It can be any of the various 1 screen types. |
| Travel | Layout
|
This type of room is for travel across some distance. They always have 2 exits, one on each end. Some have something in them that makes them one-way or prevents travel at all until some criteria is met. Tubes suck you in immediately upon entering a door and elevators have a space that the player interacts with to cause the elevator to move. |
| Hub | Layout
|
This room is expected to have a larger number of exits than most areas. These areas facilitate interconnect between multiple places and can have upgrade items, tricky platforming, and hidden sections to make them interesting. |
| Platform Challenge | None | These rooms are specifically designed to challenge the player to get through them with a set of movement capabilities. They may be dead-ends or travel rooms, but essentially always have some sort of reward or progression at the end. |
| Boss | Type
|
Boss rooms are places where large battles take place. Rooms that are generated are done in a way that align with the selected battle. |
Structure Generators
Structures are parameterized chunks of "stuff" that go in a room. They include platforms, room edges, doors, statues, hazards, generators, and anything else that can be visually placed on a screen. The use of these is managed by the room generator that needs the stuff in question.
Types
There is a collection of structure generators that can be used by room generators to make things that go in the rooms during generation.
All structure generators receive parameters:
- Position of the structure relative to the screen layout, in tiles.
- Size of the structure, in tiles.
| Structure | Extra Parameters | Description |
|---|---|---|
| Platform | Type
Junctions |
This structure builds a platform using pipe style parts. It can also utilize either decorative junctions or simple pipe ends. |