Template:MapObjectDef: Difference between revisions

From Heroes of Might and Magic: Olden Era Official Wiki
obelisk-bot: Pushing translation table rework
No edit summary
 
(One intermediate revision by the same user not shown)
Line 34: Line 34:
| resource_name = String
| resource_name = String
| resource_value = Integer
| resource_value = Integer
| units_hire_sid = String
| units_weekly = Integer
| bonus_growth = Integer
| source_path = String
| source_path = String
}}
}}
Line 63: Line 66:
| resource_name = String        <!-- res_mines / res producing-resource -->
| resource_name = String        <!-- res_mines / res producing-resource -->
| resource_value = Integer      <!-- res_mines daily production amount -->
| resource_value = Integer      <!-- res_mines daily production amount -->
<!-- Hiring -->
| units_hire_sid = String
| units_weekly = Integer
| bonus_growth = Integer


| source_path = String          <!-- e.g. DB/objects_logic/res_mines/mines.json -->
| source_path = String          <!-- e.g. DB/objects_logic/res_mines/mines.json -->
Line 115: Line 123:
| resource_name = {{{resource_name|}}}
| resource_name = {{{resource_name|}}}
| resource_value = {{{resource_value|}}}
| resource_value = {{{resource_value|}}}
| units_hire_sid = {{{units_hire_sid|}}}
| units_weekly = {{{units_weekly|}}}
| bonus_growth = {{{bonus_growth|}}}
| source_path = {{{source_path|}}}
| source_path = {{{source_path|}}}
}}
}}
Created <code>MapObject</code> entry: <code>{{{id|}}}</code></includeonly>
Created <code>MapObject</code> entry: <code>{{{id|}}}</code></includeonly>

Latest revision as of 07:42, 20 July 2026

One row per adventure-map structure pulled from DB/objects_logic/ — roughly 150 rows in the 2026-05-05 corpus across ~22 categories (resource piles, mines, dwellings, banks, chests, taverns, markets, portals, shrines, uniques, etc.).

The source data is heterogeneous (chests carry variants loot tables, hires carry unitsData + bonuses, mines carry resArr, etc.) but most of that variance is deferred. This pass captures the universal fields players care about — name, description, icon, basic combat / economy stats — plus a source_path pointer so editors can dig into the raw JSON for specifics the wiki doesn't yet surface.

Battlefield-side objects (DB/field_objects/obstacles, sentries, traps) are out of scope for this table; they'll get their own treatment.

Page layout

Data:MapObject/<id> carries:

  1. {{MapObjectDef | id=… | category=… | …}}
  2. N × {{TranslationDef | type=map_object | target_id=<id> | language=… | name=… | description=… }} — name+description, one row per language
  3. N × {{TranslationDef | type=map_object_narrative | target_id=<id> | language=… | description=… }} — narrative text (in the description column), one row per language, when a narrative_desc_sid exists

Schema

This template defines the table "MapObject". View table.

{{MapObjectDef
| id = String
| category = String              <!-- res, res_mines, magic_mines, hires, chests, event_banks, taverns, markets, item_markets, res_trade_labs, unit_res_trade_labs, outposts, garrisons, portals, sacrificial_shrine, fickle_shrines, mirages, insaras_eye, eternal_dragon, pocket_dimensions, chimerologist, prisons -->

<!-- Localization references — display text lives in the Translation table:
     type='map_object' carries name+description, type='map_object_narrative' carries narrative_desc -->
| name_sid = String
| desc_sid = String
| narrative_desc_sid = String

<!-- Core scalars (sparse — only populated when present in source) -->
| goods_value = Integer
| ai_value = Integer
| custom_guard_value = Integer
| view_radius = Integer
| ai_ignore = Boolean

<!-- Combat: who guards this object. List of "<unit_sid>:<amount>" pairs -->
| guard_units = List (,) of String

<!-- Category-specific scalars (sparse) -->
| fraction = String              <!-- hires faction membership: human, demon, ... -->
| tier = Integer                 <!-- hires tier (1-7) -->
| resource_name = String         <!-- res_mines / res producing-resource -->
| resource_value = Integer       <!-- res_mines daily production amount -->

<!-- Hiring -->
| units_hire_sid = String
| units_weekly = Integer
| bonus_growth = Integer

| source_path = String           <!-- e.g. DB/objects_logic/res_mines/mines.json -->
}}

Field notes

  • id is the source JSON id (e.g. mine_gold, barracks_human_3, celestial_sphere, tavern, portal_1). No synthesis — the source ids are already globally unique.
  • category is the source folder name under DB/objects_logic/. Used for filtering (e.g. "all dwellings" → WHERE category = 'hires').
  • name_sid / desc_sid / narrative_desc_sid follow the convention <id>_name / <id>_description / <id>_narrativeDescription against Lang/<locale>/texts/mapObjects.json, surfaced for traceability. Display text for every language (English included) lives in the Translation table. ~94 of the ~150 rows have player-facing names; the rest (e.g. tavern, outposts, single-instance specials) have no name_sid, emit no type='map_object' Translation row, and rely on category for identification.
  • goods_value is the in-source AI/economy weight (the "value" of taking this object). Universal — present on virtually every entry.
  • ai_value / custom_guard_value appear on chests, hires, mines, resources — used by AI threat assessment.
  • guard_units is the comma-joined list of <sid>:<amount> pairs (e.g. esquire:2,crossbowman:2). NULL when source has empty guardUnits.
  • fraction / tier populated only for category='hires' (creature dwellings on the adventure map — not the city Build_Tier_* dwellings, which live on the Building table).
  • resource_name / resource_value populated only for category='res_mines' (daily producers like mine_gold) and selected res rows. The richer resArr chance-table for resource-pile randomization (used in category='res') is not extracted in this pass — the source path is on the row for editors who need it.

Categories deliberately not extracted

  • cities/ — already modeled in the Building table.
  • items/ — these are placement metadata for artifacts on the map; the canonical Artifact data is in the Artifact table.
  • blocks/, todo/ — terrain blockers and dev TODOs, not player-facing.
  • random_hires/, unit_upgrades/, town_gates/, win_condition_objects/ — generation/AI helpers and campaign-specific mechanics.

Deliberately not extracted (within in-scope categories)

The rich category-specific payloads — chest variants loot tables, event-bank reward sets, hire unitsData weekly/bonus blocks, mine bonuses arrays, magic-mine bonuses, market trade rates, etc. — are out of scope for this pass. They'd each warrant their own side table (MapObjectChestVariant, MapObjectEventBankReward, MapObjectDwellingUnit, etc.) following the Building pattern.

The source_path column on every row points editors at the source JSON file for those specifics until structured wiki coverage catches up.

Related tables

  • Translation — display text in every language (English included), joined on id = Translation.target_id with Translation.type IN ('map_object', 'map_object_narrative') and the desired language filter.
  • Building — sibling table covering city-buildings (DB/objects_logic/cities/).
  • Artifact — canonical artifact data; map placements in DB/objects_logic/items/ reference these by id.
  • Unit — guard_units entries reference Unit ids.