This is the multi-page printable view of this section. Click here to print.

Return to the regular view of this page.

Map Service

Use Cases

Create new Map Type

Trigger: REST call (POST containing the map type specification, format see TODO)

Responsible Aggregate: MapType

What happens?

  • Store the specifification
  • return the MapType ID

Produced Event(s): MapTypeCreated

Create Map Instance for a new Game, based on a Map Type

Trigger: Event (originating from Game service) that a new game has been created.

Responsible Aggregate: MapType

What happens?

  • TODO

Produced Event(s): MapTypeInstanciated

  • Generating Map
  • Generating Resources
  • Mining / Depleting Resources

Aggregates

See list below.

1 - MapType (Aggregate)

This page documents the design decisions for the MapType aggregate, which is responsible for specifying a certain type of map, and creating an instance for it.

Configuration Principle

A map type is defined by its size and description. The grid cells are then further configured by a configuration which consists of the following sequential sections.

  1. Gravity distribution zones
    • The gravity distribution is defined via a sequence of map areas, each having a certain gravity level.
    • Those grid cells not covered by this definition have the default gravity value.
  2. Map structure - void / planet definition
    • This section consists of several sequential layers of defining either planets or voids.
      • A void is effectively a barrier, while a planet can carry a resource, a space station, or a black hole.
    • Each new layer overwrites the ones before, allowing for complex distributions
      • e.g. you could define a maze-like structure by first setting the whole map (or a large section of it) to void, and then add “pathes” of planets on top.
      • on the other hand, if you want large open space with one or several barriers in it, you start with a planet-defining layer, and then add the voids as barriers.
  3. Distributions of resources, space stations, or black holes.
    • Distributions consist of an area definition

2 - Map Configuration

Map configuration is handled by the aggregate MapConfig.

Functionalities

  • Generating Map
  • Generating Resources
  • Mining / Depleting Resources

Aggregates

  • Map (Constellation):
    • Planets
    • Mining Stations
  • Resources incl. their distribution