Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion config/default.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,5 @@ runtime:
calculation: 'no-distance-simple-multiply'
warehouse: 'base-resource-summary'
queue:
resourceConsumer: 'simple-resource-consumer'
building:
resourceConsumer: 'simple-resource-consumer'
3 changes: 2 additions & 1 deletion config/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,5 @@ runtime:
calculation: 'no-distance-simple-multiply'
warehouse: 'base-resource-summary'
queue:
resourceConsumer: 'simple-resource-consumer'
building:
resourceConsumer: 'simple-resource-consumer'
16 changes: 12 additions & 4 deletions docs/mechanics.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
# Mechanics

Warp Core game engine provides multiple mechanics. They define different ways of processing single task without need to going into details. They are meant to be possible to switch just in config file. All mechanic configs are stored in one `default.yaml` file under specific key. Mechanics are grouped, it is possible to select only one mechanic from group.
Warp Core game engine provides multiple mechanics. They define different ways of processing a single task without the need to going into details. They are meant to be possible to switch just in a config file. All mechanic configs are stored in one `default.yaml` file under a specific key. Mechanics are grouped, it is possible to select only one mechanic from a group.

## Mechanics list

### `resource.calculation`

Group of mechanics that calculate resources for single habitat. Possible values:
Group of mechanics that calculate resources for a single habitat. Possible values:

#### `'no-distance-simple-multiply'`

That mechanic just multiplies time with production rate and adds last calculated value. Limited by existing warehouse storage in habitat.
That mechanic just multiplies time with the production rate and adds the last calculated value. Limited by existing warehouse storage in habitat.

### `resource.warehouse`

Expand All @@ -22,4 +22,12 @@ Gets all build warehouses and calculates possible storage per provided resource.

#### `'disabled'`

Warehouses are not used. Max possible value of single resource is 9007199254740991.
Warehouses are not used. The max possible value of a single resource is 9007199254740991.

### `queue.building.resourceConsumer`

Group of mechanics that decides how to consume resources on building queue change. Based on this mechanic, queue cost calculates.

#### `'simple-resource-consumer'`

Fetches all resources related to the newly added building (or draft) and summarize them in a loop.
2 changes: 1 addition & 1 deletion src/user/queue/building-queue/building-queue.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ import {QueueConsumerMiddleware} from '@warp-core/user/queue/building-queue/queu
SimpleCalculationService,
RegisterMechanic.forFeature(
BuildingQueueResourceConsumerInterface,
'runtime.mechanics.queue.resourceConsumer',
'runtime.mechanics.queue.building.resourceConsumer',
),
],
imports: [DatabaseModule, CoreConfigModule, AuthModule],
Expand Down
Loading