VCMI random map generator compared with HotA: problems found

This report compares maps made by VCMI's random map generator with maps made by the HotA generator from the same template. Each entry gives the measured evidence, the VCMI code that probably causes it, and the gameplay impact.

Basis

  • Template Clash of Dragons G, 252x252, 1 level, 2 human players, no water.
  • VCMI: 30 maps, VCMI commit 0883081b3 with the HotA mod active and monster strength strong. A small read-only patch was added to export the zone layout; it does not change generation.
  • HotA: 20 maps from HotA 1.8.0 with monster strength 3.
  • 157 metrics were compared; 96 differ significantly. As a control, two halves of the VCMI sample were compared with each other, and no metric was flagged.

Notation: values are medians per map, [min-max]. d is Cliff's delta for VCMI vs HotA: +1 means every VCMI map is above every HotA map, -1 means every VCMI map is below. Every entry has |d| >= 0.83 and q < 0.0001 unless noted. Values use VCMI's scale: object value from rmg.value, monster value as aiValue x count.

P1. Identical obstacles cluster together

  • Pairs of the same obstacle .def within 8 tiles of each other were compared against a random baseline: .def labels shuffled within each terrain, 200 runs.
    • VCMI: ratio 1.28 [1.14-1.44]. Identical obstacles sit together more often than their frequency explains.
    • HotA: ratio 0.32 [0.30-0.36]. HotA actively keeps identical obstacles apart (z about -40 per map).
    • Within 4 tiles: VCMI 1.07, HotA 0.37. Distance to the nearest identical obstacle (10th percentile): VCMI 3.6 tiles, HotA 7.1.
  • Obstacle variety per terrain (entropy of .def use): VCMI 5.96 [5.77-6.11], HotA 6.33 [6.25-6.49].
  • Distinct obstacle .defs per map: VCMI 343 [276-439], HotA 410 [341-483] (d = -0.49, q = 0.006).
  • Suspected code: lib/rmg/modificators/ObstaclePlacer.cpp with ObstacleSetHandler. Each zone draws a few biome sets (for example "Added 2 tree sets" or "Mountain set added" in the generator log) and fills its area from them. Nothing penalizes placing a .def next to the same .def. HotA behaves as if it had such a penalty.
  • Impact: the map looks monotonous.
  • Fix difficulty: moderate. Options are a distance penalty per .def when choosing obstacles, or a window of recently used .defs.

P2. Large empty areas, treasure in heaps

  • Passable tiles more than 4 tiles from any object other than an obstacle: VCMI 4.1% [3.1-6.0%], HotA 0.60% [0.26-0.96%].
  • More than 6 tiles away: VCMI 0.39%, HotA 0.003%.
  • Largest empty disk radius: VCMI 8.6 [7.6-10.8], HotA 6.3 [5.0-7.1]. Every VCMI map is above every HotA map.
  • Treasure spacing, measured with Clark-Evans R (1 = random, above 1 = evenly spread):
    • VCMI 1.22 [1.20-1.23], HotA 1.52 [1.45-1.56].
    • Distance to the nearest treasure neighbour: VCMI 1 tile (objects side by side), HotA 1.41 (diagonal).
    • VCMI piles treasure into clumps with gaps between them. HotA spreads it evenly.
  • Blocked area is the same: obstacles cover 45.7% of tiles in both. VCMI has slightly fewer free tiles (30.9% vs 32.8%).
  • Suspected code: TreasurePlacer, which assembles a treasure pile as one rmg::Object from several instances, and the placement weights in ObjectManager (distance to existing objects and paths).
  • Impact: dead stretches of map, with treasure in heaps.
  • Fix difficulty: moderate to hard. Options are changing the placement weights or making piles smaller.

P3. Few large obstacles instead of many small ones

  • Obstacles per map: VCMI 7,350 [7,120-7,560], HotA 12,720 [12,550-13,180], for the same blocked area.
  • Median obstacle footprint: VCMI 4 tiles, HotA 2.
  • Ratio of large obstacles (6+ tiles) to small ones (1-2 tiles): VCMI 0.67, HotA 0.17.
  • Obstacles per blocked tile: VCMI 0.25, HotA 0.44.
  • VCMI's blocked tiles form fewer, larger connected masses: 624 vs 784 per map, median size 8 vs 3 tiles.
  • Suspected code: ObstaclePlacer. It places large sets and big pieces first and fills little with small pieces.
  • Related to P1, because fewer and bigger pieces make repetition easier to see, and to P2.

P4. More guards, weaker top end, more closed start

  • Monster count: VCMI 1,272 [1,233-1,298], HotA 1,108 [1,068-1,156] (+15%).
  • Median guard strength is similar: VCMI 41.7k [40.6-43.3k], HotA 44.0k [39.4-52.6k] (d = -0.59, q = 0.0009). This is a moderate effect: a typical HotA guard is about 5% stronger. strong is the closest VCMI setting to HotA monster strength 3, because normal would be weaker still.
  • The strongest guards are weaker in VCMI: 90th percentile 157k vs 205k. Total guard strength per map: VCMI 68.5M, HotA 80.6M (d = -0.88).
  • What a player can reach from their start without fighting:
    • VCMI: 1,770 tiles and 288k value.
    • HotA: 2,510 tiles and 601k value.
    • Unguarded share of all treasure value: VCMI 3.1%, HotA 8.4%.
  • Between the two starts, a player must pass 8 guards [5-10] in VCMI and 5 [5-7] in HotA. Strength of the weakest route: VCMI 497k, HotA 371k.
  • Guard strength divided by the value of the pocket it guards: VCMI 3.36, HotA 3.02. VCMI guards are slightly heavier relative to the loot (moderate effect, d = +0.52, q = 0.004).
  • Suspected code:
    • Guard creation in TreasurePlacer. Every pile gets its own guard, while HotA leaves more small treasure free and guards fewer, bigger targets.
    • ConnectionsPlacer, which adds extra guards on the route between starts.
  • Impact: in VCMI the start is slower and more boxed in, with less to collect early.
  • Open question: whether VCMI's monster strength normal moves the guard count and the free area toward HotA.

P5. Different object mix

Mean count per map, VCMI vs HotA:

  • Artifacts 1,243 vs 690:
    • spell scrolls 324 vs 118
    • minor 236 vs 101
    • major 314 vs 176
    • relic 320 vs 250
    • treasure 49 vs 46
  • Resources: 5.1 vs 7.0 piles per 100 passable tiles (1,663 vs 2,207 piles). Gold piles: 533 vs 1,154.
  • Creature banks: 410 vs 485. Dwellings: 175 vs 307.
  • Shrine of Magic level 1: 179 vs 46. Mystical Garden: 93 vs 32.
  • Decorative animals (chicken, pig, rooster): about 85 per VCMI map, almost none in HotA.
  • Found in HotA but never in VCMI: Cartographer, Hill Fort, Sanctuary, Temple of Loyalty, Warlock's Lab. Found only in VCMI: Mini Hill Fort.
  • Total treasure value: VCMI 17.8M vs HotA 14.3M (+24%), mostly from artifacts.
  • Mines and towns match exactly (58 mines, 18 of them gold, and 14 towns), as the template requires.
  • Causes:
    • Part comes from converting the template. The HotA template's map-wide object rules and bans have no direct VCMI equivalent and were dropped.
    • The rest comes from VCMI's object pool and value weighting in TreasurePlacer, and from the HotA mod's object configuration (hota.gamebalance.objects.rmgban, rmgtweak).
    • Converting the object rules would show which differences are conversion gaps and which come from the generator.

P6. Roads and rivers (low priority)

  • Road tiles: VCMI 1,630 [1,485-1,811], HotA 1,084 [972-1,168] (+50%).
  • Share of the route between starts that runs on road: VCMI 1.0 [0.72-1.0], HotA 0.89 [0.58-1.0] (d = +0.52, q = 0.003). VCMI's roads cover the whole route between the starts. HotA leaves part of it off-road.
  • Rivers: VCMI 21 [16-28], HotA 38 [28-42]. The VCMI log shows "River sink is empty!" 143 times across 30 maps.
  • Suspected code: RoadPlacer (extra or wider roads) and RiverPlacer.

V1. The same seed gives different maps (VCMI reproducibility)

  • Three seeds were each generated twice in single-threaded mode, and the second map differed from the first every time.
  • Terrain, roads and the zone layout came out identical. Objects differed in 2-3 zones per seed, for example 623, 1,010 and 117 differing objects in three zones of one seed.
  • Threads are ruled out, and lib/rmg contains no unseeded random number generator. The suspects are containers ordered by pointer value: MapProxy::insertObjects(std::set<std::shared_ptr<CGObjectInstance>>) and maps in CZonePlacer keyed by std::shared_ptr<Zone>.
  • Impact: a VCMI random map cannot be recreated from its seed. The statistics in this report are not affected.

Not VCMI problems

  • Fairness: VCMI balances the two players better than HotA does. The gap between the two starts is 163 tiles of free area in VCMI vs 733 in HotA, and 27k of free value vs 210k.
  • Monolith links: HotA uses 3 [1-3] monolith groups per map, VCMI 1 [0-3]. Both connect zones that the template links but that are not neighbours on the map through portals.
  • Obstacles on the "wrong" terrain (HotA 7.2% vs VCMI 1.2%): this metric checks HotA's obstacles against VCMI's allowed-terrain configuration. It is not a VCMI fault.
  • Zone-based metrics are weaker evidence on the HotA side. HotA's zone layout had to be inferred from the map.
    • Zone areas vs template: HotA log deviation 0.32 vs VCMI 0.02.
    • Border guards: HotA 69 vs VCMI 19.
    • Passages: HotA 86 vs VCMI 22.
    • Inferred borders are rougher than real ones, so they inflate border counts. HotA's zone areas may also really be less even. Without HotA's actual zone layout, the two can't be told apart.
Edit

Pub: 16 Oct 2026 22:45 UTC

Views: 47