Repository navigation
feat(world,engine): 1-deme-per-hex 169-hex urban/rural simulation & 2.5D illustrated shader world - #2
Merged
Conversation
….5D illustrated shader world
…t action agency Social behaviors (expansion, warfare, raiding, alliances, trade, tribute coercion, betrayal, and unification) previously failed to emerge organically because settlements scored 7 abstract archetypes that were diluted across a 75/25 heuristic blend and gated behind rigid probability and trait thresholds. Redesign the cognitive and biophysical engines around direct, target-bound settlement agency: - Build a per-settlement feasible action menu (`EvoActionMenu`, 16 action types) where each option's `/v1/systemone` criterion is its exact quantified expected payoff (`EvoOutcomeForecast`) computed by shared biophysical formulas (`EvoPayoffs`). - Provide natural-language situation briefings (`EvoSituationReport`) combining strategy doctrine, caloric balance, causal feedback from the prior turn's chosen action, sliding episodic memory, and bilateral neighbor trust, feuds, truces, and open proposals (`EvoRelations`). - Sample concrete actions (`deme.chosen_action`) via temperature-sharpened policy sampling (`EvoActionPolicy`, `T = 0.65`) with zero heuristic weight blending and no coarsened signature caching, and expand the default Ollama context window to 16384. - Split turn resolution into modular phases (`EvoEconomyPhase`, `EvoDiplomacyPhase`, `EvoConflictPhase`, `EvoSettlementPhase`) driven directly by each settlement's chosen action and target. - Replace the Lab Decisions tab with editable strategy doctrines (`StrategyDef.doctrine`) and add a live multi-matchup Ollama emergence harness (`tests/sim_emergence.gd`).
…y for emergent agency Live `/v1/systemone` evaluations showed that settlements under-selected raids, conquests, tribute coercion, and betrayals while over-selecting immediate alliances and premature city unifications because: - Non-forage forecasts stated only incremental food deltas rather than total expected harvest (`base_income + bonus/loot`), biasing the decision model toward `forage`. - Unallied same-lineage neighbors automatically contributed defensive power and defenders mobilized a disproportionate share of population against raids, depressing attacker win probabilities and filtering `demand_tribute` out of the menu. - Newly budded camps (`pop >= 45`) could immediately propose `unite` and get reabsorbed into their parent settlement, and foreign settlements could propose alliances at zero trust on first contact. - `EvoConflictPhase` aborted `betray` actions when the allied target belonged to the same founding lineage. Key changes: - Include expected base harvest alongside action-specific payoffs across all `EvoOutcomeForecast` descriptions so the LLM compares total food and territorial stakes on an equal footing. - Restrict automatic allied defense reinforcement in `EvoPayoffs.defense_power` to active pacts and walled unions, add a martial attack bonus for `cul-warrior-expansion`, and calibrate raid/conquest troop mobilization and surprise betrayal loot caps. - Require `SETTLE_MIN_POP = 80` for colonist budding, require established allied towns (`pact_turns >= 3`, `tier >= 2`) for `unite`, require minimal trust (`trust >= 0.12`) before proposing foreign pacts, and allow opportunistic `betray` against wealthy allies when hungry or martial. - Allow `betray` to execute against same-lineage allies in `EvoConflictPhase.resolve` and update canonical forecast assertions in `test_engine_biophys.gd`.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR implements the Single-Deme-Per-Hex Urban/Rural Simulation & 2.5D High-DPI Illustrated/Shader World Overhaul:
1. Spatial Exclusivity (
1-Deme-Per-Hex) &169-Hex World Scale (map_radius = 7)cell.deme_ids.size() <= 1across all turn phases, flood/mountain relocations, warband invasions, colonist budding, and snapshot imports (WorldState.from_dict).map_radius = 7(169hexes) and fixesHexMath.get_neighbor_idscaching ((q + 16) * 32 + (r + 16)).yaw_deg = 0.0) so 2.5D isometric architecture, mountains, and perimeter walls remain permanently aligned with the hex grid.2. 4-Tier Urban Hierarchy (
I..IV), Urban Salubrity (salubrity) & Rural Hinterlands (crops/pasture)I · Campamento / Camp,II · Aldea / Village,III · Villa / Town, andIV · Metrópolis / Metropolis.crops&pasture): Tier II (1), Tier III (2), and Tier IV (4) cities cultivate adjacent uninhabited terrestrial hexes (owner_deme_id) connected by rural farm tracks with animatedcovered_wagontraffic. Raiders and besiegers can pillage rural hexes into scorched ruins (has_ruins = true) to starve fortified cities without triggering extra Ollama LLM calls.deme.salubrity([0.05, 1.0]), dampening positive demographic growth and triggering"epidemic"outbreaks (salubrity < 0.35,population >= 130).3. Dual Synoecism & Occupied-Hex Interactions
tier_a != tier_b): Lower-tier allied settlements merge into higher-tier cities (merged_count += 1), converting their vacated hex into a cultivated rural hinterland (cropsorpasture) owned by the host city.tier_a == tier_b >= 2): Same-tier allied cities unite under a sharedwalled_union_id, remaining on their respective hexes while pooling combat defense, culling their shared internal wall edge, and linking their plazas with a central cobblestone union boulevard.4. 2.5D High-DPI Illustrated & Shader World (
v3_illustrated_hdpi)ocean_waves.gdshader,hex_terrain.gdshader, andprop_sway_glow.gdshader.TEXTURE_FILTER_LINEAR_WITH_MIPMAPS):256x224biome hex tiles,128x128–160x160isometric buildings (hut_thatch,house_clay,house_stone,granary,windmill,watchtower,temple_totem,citadel_keep,cathedral,crop_field,pasture_pen,palisade_wall,stone_wall,covered_wagon,ruins_stone) with#23150cink outlines and mipmaps.compute_deme_evaluation_signature) with 1-deme-per-hex neighbor states,salubrity,owned_rural_count, andwalled_union_id, and alignedprefetch_for_statewith post-EvoEnvPhasestate for 100% next-turn cache hit rate.README.md,AGENTS.md,src/**/README.md, andgh-pages/with 8 fresh1920x1080screenshots.Verification
godot --headless --path . --script res://tests/test_runner.gd-> PASSED: 623 | FAILED: 0