docs: build times the Die Stämme way, their table, floor and HQ factor, the bases for our own buildings, no free finish

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Fabian @ Blax Software 2026-11-03 12:06:53 +01:00
parent d7dcb9603d
commit 70f07d87fc
1 changed files with 24 additions and 3 deletions

View File

@ -86,7 +86,18 @@ One instance of each type is enough, as in Die Stämme. A copy works at a fallin
### Builders ### Builders
Each village has `builders` (default 2, +1 at the HQ levels listed in world config, for example 10 and 20). All orders share one queue. A free builder takes the first order that is not blocked by an order still running, for example a second upgrade of the same building instance. Build time is scaled by the HQ's level and staffing. Each village has `builders` (default 2, +1 at the HQ levels listed in world config, for example 10 and 20). All orders share one queue. A free builder takes the first order that is not blocked by an order still running, for example a second upgrade of the same building instance.
Build time follows Die Stämme (`economy.build_time`, `BuildingRules::buildSeconds`; the research repo's `die-staemme/pace.md` has the sources):
- A level takes `max(min, base × factors[level] × hq_factor^−HQ level)` seconds at world speed 1, divided by world speed and by the HQ's staffing factor, so an understaffed HQ is slower at every level.
- `base` is per building, Die Stämme's: HQ 900, barracks 1800, stable and workshop 6000, market 2700, timber camp and clay pit 900, iron mine 1080, farm 1200, storage 1020, hiding place 1800, wall 3600, watchtower 13200, rally point 10860. The hospital has no Die Stämme twin and builds at the barracks' pace. Die Stämme's academy has one level (586800 at 0.0075); ours has three, and levels 2 and 3 take 1.5 times the level before (its own `factors`).
- `factors` is Die Stämme's table, one entry per level from 1 and the same for every building: 0.0075 at levels 1 and 2, 0.16 at 3, 0.96 at 5, 4.9 at 10, 36 at 20, 209 at 30. Levels past the end grow by the ratio of the last two entries.
- Each HQ level divides by `hq_factor` (1.05): HQ 20 builds in 0.377 of the time, HQ 30 in 0.231. The HQ that counts is the one standing when a builder takes the order.
- `min` is the floor: 10 s, 30 s for the watchtower, 240 s for the wall. Levels 1 and 2 of most buildings take the floor.
- So a timber camp with the HQ at its level takes 0:10 at levels 1 and 2, 2:06 at 3, 11:15 at 5, 45:04 at 10, 3:23:10 at 20 and 12:05:12 at 30 on world speed 1, a quarter of that on World 1 (speed 4).
- Demolishing takes `demolish_time_factor` (half) of the level's build time. There is no free finish: in Die Stämme that is a premium-world feature.
- Lint: the table has an entry for every level up to each type's `max_level`, all above 0 and none below the one before; every floor is at least 1 s; `hq_factor` is at least 1.
### Starvation ### Starvation
@ -99,7 +110,7 @@ A wave takes the fewest units that make income cover upkeep again: support stati
- Each village has a building space budget that grows with its headquarters: `space + village.space_per_hq_level × (HQ level − 1)` (defaults 40 and 5, so 40 at level 1, 45 at level 2 and 85 at level 10). Space is scarce on purpose: one of every building type only fits from headquarters level 5, so what goes in is the village's main choice. The village row stores its own base `space`, so terrain or specials can change it per village later. The new space arrives when an HQ level finishes; a queued HQ demolition already counts, and the HQ can't be demolished below what stands. - Each village has a building space budget that grows with its headquarters: `space + village.space_per_hq_level × (HQ level − 1)` (defaults 40 and 5, so 40 at level 1, 45 at level 2 and 85 at level 10). Space is scarce on purpose: one of every building type only fits from headquarters level 5, so what goes in is the village's main choice. The village row stores its own base `space`, so terrain or specials can change it per village later. The new space arrives when an HQ level finishes; a queued HQ demolition already counts, and the HQ can't be demolished below what stands.
- Each building type takes a fixed `space` from config, for example HQ 9, barracks 6, resource buildings 4, and hiding place 1. The level changes only the look, never the space. A building fits when the space of all buildings plus new buildings still in the queue, plus its own, stays within the budget. The space is reserved when the order is queued. - Each building type takes a fixed `space` from config, for example HQ 9, barracks 6, resource buildings 4, and hiding place 1. The level changes only the look, never the space. A building fits when the space of all buildings plus new buildings still in the queue, plus its own, stays within the budget. The space is reserved when the order is queued.
- There are no tiles and no stored positions. The client draws the village as a low-poly isometric diorama and lays the buildings out itself (HQ in the centre, the rest around it), so where a building stands is presentation, not game state. - There are no tiles and no stored positions. The client draws the village as a low-poly isometric diorama and lays the buildings out itself (HQ in the centre, the rest around it), so where a building stands is presentation, not game state.
- Levels start at 1, as in Die Stämme, and a new instance is built at level 1. Every per-level formula uses `level − 1` as the exponent of its factor, so level 1 has the base values. - Levels start at 1, as in Die Stämme, and a new instance is built at level 1. Every per-level formula uses `level − 1` as the exponent of its factor, so level 1 has the base values. Build time is the exception: it takes a factor per level from a table (see "Builders").
- One of each type is enough: one storage, one farm, one barracks. Copies are the exception and pay twice. `max_per_village` keeps some types unique (HQ, rally point, wall, watchtower, academy). The instance at rank n (the same rank as its share) costs `instance_cost_factor`^n as much at every level (2: a second camp costs double, a third four times), and it works at a falling share (see "Copies"). Upgrading beats copying. - One of each type is enough: one storage, one farm, one barracks. Copies are the exception and pay twice. `max_per_village` keeps some types unique (HQ, rally point, wall, watchtower, academy). The instance at rank n (the same rank as its share) costs `instance_cost_factor`^n as much at every level (2: a second camp costs double, a third four times), and it works at a falling share (see "Copies"). Upgrading beats copying.
- Basic buildings have no requirements: everything in the core set, the wall included, can be built from the start. Only advanced buildings get `requires` (type => minimum level of any instance), for example the academy (Adelshof) needs the headquarters and a barracks (Kaserne). A build option lists what is still missing. - Basic buildings have no requirements: everything in the core set, the wall included, can be built from the start. Only advanced buildings get `requires` (type => minimum level of any instance), for example the academy (Adelshof) needs the headquarters and a barracks (Kaserne). A build option lists what is still missing.
- Demolishing goes through the build queue. It lowers an instance by one level and refunds `demolish_refund` × that level's cost (default 0.5). Taking level 1 down removes the instance (an order with target level 0) and frees its space. - Demolishing goes through the build queue. It lowers an instance by one level and refunds `demolish_refund` × that level's cost (default 0.5). Taking level 1 down removes the instance (an order with target level 0) and frees its space.
@ -174,13 +185,23 @@ A building entry looks like this (numbers start TW-like):
'max_per_village' => null, 'max_per_village' => null,
'max_level' => 30, 'max_level' => 30,
'cost' => ['wood' => 50, 'clay' => 60, 'iron' => 40, 'factor' => 1.25], 'cost' => ['wood' => 50, 'clay' => 60, 'iron' => 40, 'factor' => 1.25],
'build_time' => ['base' => 900, 'factor' => 1.2], // seconds at world speed 1 'build_time' => ['base' => 900], // seconds at world speed 1, × economy.build_time.factors[level]
'workers' => ['base' => 2, 'factor' => 1.12], 'workers' => ['base' => 2, 'factor' => 1.12],
'production' => ['resource' => 'wood', 'base' => 30, 'factor' => 1.163], 'production' => ['resource' => 'wood', 'base' => 30, 'factor' => 1.163],
'requires' => [], 'requires' => [],
], ],
``` ```
The build time table sits in `economy.php` (see "Builders"); a building that differs brings its own `min` or `factors`, for example `'build_time' => ['base' => 3600, 'min' => 240]` for the wall:
```php
'build_time' => [
'factors' => [0.0075, 0.0075, 0.161516, 0.500291, /* one per level */ 208.951],
'hq_factor' => 1.05, // each HQ level divides build time by this
'min' => 10, // seconds at world speed 1
],
```
## Data model ## Data model
| Table | Columns | | Table | Columns |