Template:DifficultyDef: Difference between revisions
obelisk-bot: uploading initial Cargo templates |
obelisk-bot: Pushing translation table rework |
||
| (2 intermediate revisions by the same user not shown) | |||
| Line 5: | Line 5: | ||
* The source <code>nameSid</code> values (<code>EasyDifficultySid</code>, <code>NormalDifficultySid</code>, …) are ''not'' L10n entries — they don't resolve in any <code>Lang/<locale>/</code> file. We store them on the row for fidelity, but the canonical display name is the <code>id</code> itself. | * The source <code>nameSid</code> values (<code>EasyDifficultySid</code>, <code>NormalDifficultySid</code>, …) are ''not'' L10n entries — they don't resolve in any <code>Lang/<locale>/</code> file. We store them on the row for fidelity, but the canonical display name is the <code>id</code> itself. | ||
* The source <code>descriptionSid</code> field carries literal English text ("This is an Easy difficulty setting."), not an L10n key | * The source <code>descriptionSid</code> field carries literal English text ("This is an Easy difficulty setting."), not an L10n key. | ||
Because | Because the source ships English-only, this table's [[Template:TranslationDef|Translation]] rows exist only for <code>language=en</code> — a query in any other language correctly returns nothing. The lookup path stays uniform with every other entity even though there's just the one language. | ||
== Page layout == | == Page layout == | ||
<code>Data:Difficulty/<id></code> carries a single <code>{{DifficultyDef}}</code> row. | <code>Data:Difficulty/<id></code> carries a single <code><nowiki>{{DifficultyDef}}</nowiki></code> row followed by one <code><nowiki>{{TranslationDef | type=difficulty | language=en}}</nowiki></code> row. | ||
== Schema == | == Schema == | ||
| Line 16: | Line 16: | ||
| id = String | | id = String | ||
| name_sid = String | | name_sid = String | ||
| neutral_power_multiplier = Float | | neutral_power_multiplier = Float | ||
| player_gold = Integer | | player_gold = Integer | ||
| Line 39: | Line 38: | ||
| id = String <!-- Easy / Normal / Hard / Expert / Impossible --> | | id = String <!-- Easy / Normal / Hard / Expert / Impossible --> | ||
| name_sid = String <!-- nullable; not actually in L10n corpus --> | | name_sid = String <!-- nullable; not actually in L10n corpus --> | ||
| neutral_power_multiplier = Float <!-- 0.5 / 0.75 / 1.0 / 1.5 / 2.0 --> | | neutral_power_multiplier = Float <!-- 0.5 / 0.75 / 1.0 / 1.5 / 2.0 --> | ||
| player_gold = Integer | | player_gold = Integer | ||
| Line 66: | Line 64: | ||
== Related tables == | == Related tables == | ||
* [[Template:TranslationDef|Translation]] — the difficulty's description, joined on <code>id = Translation.target_id WHERE Translation.type='difficulty' AND Translation.language='en'</code> (English-only; the source ships no other languages). | |||
* [[Template:EntryDef|<code>Resource</code>]] — the seven per-side <code><player|ai>_<resource></code> columns mirror the resource ids on the Resource Entry rows (gold / wood / ore / gemstones / crystals / mercury / dust). | * [[Template:EntryDef|<code>Resource</code>]] — the seven per-side <code><player|ai>_<resource></code> columns mirror the resource ids on the Resource Entry rows (gold / wood / ore / gemstones / crystals / mercury / dust). | ||
| Line 72: | Line 71: | ||
| id = {{{id|}}} | | id = {{{id|}}} | ||
| name_sid = {{{name_sid|}}} | | name_sid = {{{name_sid|}}} | ||
| neutral_power_multiplier = {{{neutral_power_multiplier|}}} | | neutral_power_multiplier = {{{neutral_power_multiplier|}}} | ||
| player_gold = {{{player_gold|}}} | | player_gold = {{{player_gold|}}} | ||
| Line 89: | Line 87: | ||
| ai_dust = {{{ai_dust|}}} | | ai_dust = {{{ai_dust|}}} | ||
| source_path = {{{source_path|}}} | | source_path = {{{source_path|}}} | ||
}}</includeonly> | }} | ||
Created <code>Difficulty</code> entry: <code>{{{id|}}}</code></includeonly> | |||
Latest revision as of 20:47, 14 May 2026
One row per game difficulty setting. 5 entries in 2026-05-05: Easy / Normal / Hard / Expert / Impossible. Each carries the balance inputs the engine actually uses: per-side starting-resource buckets and the global neutral_power_multiplier (the scalar applied to adventure-map encounter strength).
Two source-data quirks worth flagging up front:
- The source
nameSidvalues (EasyDifficultySid,NormalDifficultySid, …) are not L10n entries — they don't resolve in anyLang/<locale>/file. We store them on the row for fidelity, but the canonical display name is theiditself. - The source
descriptionSidfield carries literal English text ("This is an Easy difficulty setting."), not an L10n key.
Because the source ships English-only, this table's Translation rows exist only for language=en — a query in any other language correctly returns nothing. The lookup path stays uniform with every other entity even though there's just the one language.
Page layout
Data:Difficulty/<id> carries a single {{DifficultyDef}} row followed by one {{TranslationDef | type=difficulty | language=en}} row.
Schema
This template defines the table "Difficulty". View table.
{{DifficultyDef
| id = String <!-- Easy / Normal / Hard / Expert / Impossible -->
| name_sid = String <!-- nullable; not actually in L10n corpus -->
| neutral_power_multiplier = Float <!-- 0.5 / 0.75 / 1.0 / 1.5 / 2.0 -->
| player_gold = Integer
| player_wood = Integer
| player_ore = Integer
| player_gemstones = Integer
| player_crystals = Integer
| player_mercury = Integer
| player_dust = Integer
| ai_gold = Integer
| ai_wood = Integer
| ai_ore = Integer
| ai_gemstones = Integer
| ai_crystals = Integer
| ai_mercury = Integer
| ai_dust = Integer
| source_path = String
}}
Field notes
idcomes from the sourcesidfield. Five fixed values; new difficulty tiers would be a balance change worth flagging.neutral_power_multiplieris the headline balance number. 1.0 is "Hard" (the canonical reference point); Easy halves encounter strength, Impossible doubles it.- Resource columns: source-side
alchemicalDustis normalized todustto match the canonical naming inResource(perDB/res/resources_info.json). - Asymmetry: on Easy, the player starts with 3× the resources the AI does; this flips on Hard+, with the Impossible AI getting 5× the player's gold. That's the primary difficulty mechanism —
neutral_power_multiplieronly modulates map encounters.
Related tables
- Translation — the difficulty's description, joined on
id = Translation.target_id WHERE Translation.type='difficulty' AND Translation.language='en'(English-only; the source ships no other languages). Resource— the seven per-side<player|ai>_<resource>columns mirror the resource ids on the Resource Entry rows (gold / wood / ore / gemstones / crystals / mercury / dust).


