Generators: Difference between revisions

From Fracterebus
Jump to navigation Jump to search
Line 36: Line 36:


== Types ==  
== Types ==  
There is a collection of room generators that is used to build the world. There are also several [[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.


'''All generators receive parameters:'''
'''All generators receive parameters:'''
Line 51: Line 51:
!Generator!!Extra Parameters!!Description
!Generator!!Extra Parameters!!Description
|-
|-
|Single Screen Dead End||Type:<br />
|Single Screen Dead End||'''Type:'''<br />
* Empty
* Empty
* Save
* Save
* Map
* Map
* Recharge
* Recharge (HP, Ammo, Spawner)
* Upgrade
* Upgrade
Exit Direction
Exit Direction
||This room is exactly 1x1 screen with a single exit.
||This room is exactly 1x1 screen with a single exit.
|-
|-
|Travel||Layout:<br />
|Travel||'''Layout:'''<br />
* Horizontal
* Horizontal
* Vertical
* Vertical
* Tube
||This room is for travel across large distances, has an exit on both ends. Assumed to work in either direction.
||This room is for travel across large distances, has an exit on both ends. Assumed to work in either direction.
|-
|-
|Hub||Layout:<br />
|Hub||'''Layout:'''<br />
* Horizontal (Wide, top/bottom exits)
* Horizontal (Wide, top/bottom exits)
* Vertical (Tall, left/right exits)
* Vertical (Tall, left/right exits)
* Major (Large, exits all over the place)
* Large (Exits all over the place)
||This room is expected to have a large number of exits.
||This room is expected to have a large number of exits.
|}
|}

Revision as of 06:41, 28 December 2025

Map Parts

The map is a nested structure of rooms made of 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 and can have as few as 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 space with up to 4 exits. One per screen edge.

Rooms

A room internally represented as is 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 in the array does not need to be full of screens (gaps are allowed) as long as the room is used to make only a single connected space.
  • Rooms are the level that represent a self contained space that is loadable by the game engine.
  • There is no specific design limit on how many screens can be involved in a single room.
  • Exits for the room are defined by the screens they contain.

Map Generation Manager

This system orchestrates the layout of the entire map.

Orchestrates:

  • Owns the random number generators.
  • Makes decisions based on the world configuration.
  • Decides how room generators are used to fill in the map.
  • Places upgrades in the world.
  • Owns item progression logic.
  • Selects and assigns biomes to rooms.
  • Creator of cross-room puzzles.

Room Generators

Generators are pieces of code that generate individual 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:

  • Maximum size the room is allowed to be, in screens.
  • Limiters that are allowed. 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:

  • Locations where doors place the player when entering this room.
  • Enemy spawn points with difficulty flags.
  • Locations where upgrade items can be safely placed if needed.
Types of Room Generators
Generator Extra Parameters Description
Single Screen Dead End Type:
  • Empty
  • Save
  • Map
  • Recharge (HP, Ammo, Spawner)
  • Upgrade

Exit Direction

This room is exactly 1x1 screen with a single exit.
Travel Layout:
  • Horizontal
  • Vertical
  • Tube
This room is for travel across large distances, has an exit on both ends. Assumed to work in either direction.
Hub Layout:
  • Horizontal (Wide, top/bottom exits)
  • Vertical (Tall, left/right exits)
  • Large (Exits all over the place)
This room is expected to have a large number of exits.

Structures

Structures are parameterized chunks of "stuff" that go in a room. They range from statues and platforms to puzzle mazes and hazards. The use of these is managed by the room generator that needs the stuff.